Forum >Bluno iOS Characteristics Values
Bluno iOS Characteristics Values

Hi,
I am trying to use Bluon and writing a code to read the value from Bluno. I am able to detect the service: dfb0 and Characteristic: dfb1, however I am stuck in reading the value in the following part of the code. Can you please provide the code in how to read these values.
________________________________________________________________________________
-(void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
if([characteristic.UUID isEqual:[CBUUID UUIDWithString:TI_TEMP_TEMPERTURE_MEASUREMENT_CHARACTERISTIC_UUID]])
{
/* get characteristic which is a temperature data and send it to getTempData */
[self getTempData:characteristic error:error];
NSLog(@"Found Characteristics"); }
if([characteristic.UUID isEqual:[CBUUID UUIDWithString:TI_TEMP_MANUFACTURER_NAME_UUID]])
{
[self getManufacturerName:characteristic];
}
self.deviceInfo.text = [NSString stringWithFormat:@"%@\n%@\n",self.connected, self.manufacturer];
}
-(void)getTempData : (CBCharacteristic *) characteristic error:(NSError *)error
{
NSLog(@"Got Characteristics"); /*this works fine as I see this in console when I run the code*/
/*can you please provide the code on how to read these values*/
return;
}
____________________________________________________________________________
Thank you
Mohit
I am trying to use Bluon and writing a code to read the value from Bluno. I am able to detect the service: dfb0 and Characteristic: dfb1, however I am stuck in reading the value in the following part of the code. Can you please provide the code in how to read these values.
________________________________________________________________________________
-(void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
if([characteristic.UUID isEqual:[CBUUID UUIDWithString:TI_TEMP_TEMPERTURE_MEASUREMENT_CHARACTERISTIC_UUID]])
{
/* get characteristic which is a temperature data and send it to getTempData */
[self getTempData:characteristic error:error];
NSLog(@"Found Characteristics"); }
if([characteristic.UUID isEqual:[CBUUID UUIDWithString:TI_TEMP_MANUFACTURER_NAME_UUID]])
{
[self getManufacturerName:characteristic];
}
self.deviceInfo.text = [NSString stringWithFormat:@"%@\n%@\n",self.connected, self.manufacturer];
}
-(void)getTempData : (CBCharacteristic *) characteristic error:(NSError *)error
{
NSLog(@"Got Characteristics"); /*this works fine as I see this in console when I run the code*/
/*can you please provide the code on how to read these values*/
return;
}
____________________________________________________________________________
Thank you
Mohit
2014-08-31 16:29:36 Yes I did. Thank you. However it has no comments to tell me what is going on. Anyway I have figure out how to read the values, and trying to figure out how to write the value from the phone. For example as simple as turning a LED ON/OFF using the iPhone app and bluno. Your help will be greatly appreciated to guide me how to write the value. I saw on Bluno webpage there are demonstration of such sort of things but no code to use. Thank you
mjain

2014-08-25 20:07:42 Hello mjain,
Have you checked the [url=https://github.com/DFRobot/BlunoBasicDemo/tree/master/IOS/BlunoBasicDemo]IOS source code[/url]?
I guess it will help you.
Grey.CC
Have you checked the [url=https://github.com/DFRobot/BlunoBasicDemo/tree/master/IOS/BlunoBasicDemo]IOS source code[/url]?
I guess it will help you.

2014-08-24 16:06:36 I am able to read to read the characteristics now using the following method:
-(void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
if([characteristic.UUID isEqual:[CBUUID UUIDWithString:TI_TEMP_TEMPERTURE_MEASUREMENT_CHARACTERISTIC_UUID]])
{
[self getTempData:characteristic error:error];
NSLog(@"Found Charateristics"); }
if([characteristic.UUID isEqual:[CBUUID UUIDWithString:TI_TEMP_MANUFACTURER_NAME_UUID]])
{
[self getManufacturerName:characteristic];
}
self.deviceInfo.text = [NSString stringWithFormat:@"%@\n%@\n",self.connected, self.manufacturer];
}
However how do I read the values, when I read characteristics.value I get the following:
<35370d0a 35370d0a 35370d0a>
How do I convert it to the actual serial port values. Your help is greatly appreciated
Thank you,
Mohit
mjain
-(void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
if([characteristic.UUID isEqual:[CBUUID UUIDWithString:TI_TEMP_TEMPERTURE_MEASUREMENT_CHARACTERISTIC_UUID]])
{
[self getTempData:characteristic error:error];
NSLog(@"Found Charateristics"); }
if([characteristic.UUID isEqual:[CBUUID UUIDWithString:TI_TEMP_MANUFACTURER_NAME_UUID]])
{
[self getManufacturerName:characteristic];
}
self.deviceInfo.text = [NSString stringWithFormat:@"%@\n%@\n",self.connected, self.manufacturer];
}
However how do I read the values, when I read characteristics.value I get the following:
<35370d0a 35370d0a 35370d0a>
How do I convert it to the actual serial port values. Your help is greatly appreciated
Thank you,
Mohit
