Reading voltage value from BTLE device
Reading voltage value from BTLE device
- Subject: Reading voltage value from BTLE device
- From: Constantijn Schepens <email@hidden>
- Date: Wed, 07 Nov 2012 21:26:40 +0000
Hi there,
I am working with a custom bluetooth profile which is designed to store multiple voltage values in its GATT database. (BLE112 using BGScript to be specific) This all works correctly. My iPhone connects correctly as well as finds characteristics correctly. My issue arises when I try to read the values of my characteristics. I just am not managing to read the value that is in the GATT database. It always comes out with really large (but consistently so) numbers, yet I cannot understand why because I feel I am reading the correctly number of bytes. The GATT database stores these values (coming from an ADC) in 4 bytes. The code I am currently trying to use(based on the TemperatureSensor example) is:
CGFloat result = NAN;
int32_t val = 0;
{sensorZeroCharacteristic.value getBytes:&val length:sizeof(val)];
result = (CGFloat)val;
Can anyone see what I might be doing wrong or just have a better(correct) way of doing this?
Thanks in advance!
Constantijn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden