Hi all, firstly thanks for the help I have received in the past. I am making my way through my first BLE project and this mailing list has been a big help.
The project I am working on is using TI’s CC2540 to talk to the iPhone. When I advertise on the TI CC2540, my app finds it. I then proceed to connect and run to my breakpoint at end of CBCentralManager:didConnectPeripheral. NSLog tells me both the peripheral and service were added in this routine. However when I look at the Service Peripheral object passed to the service (in the debug window) _services shows “Invalid CFArrayRef”. On the TI side, there is a characteristic value handle of 0x0025 and a characteristic UUID of F1:FF. Neither of these match any of the characteristic values I see populate when I connect to the peripheral.
My first question: why does _services return invalid? Second, TI’s characteristic values are much shorter than I was expecting, do I have to prepend my data with the characteristic handle to have it read?
Thanks again
Code below is the most part taken from Temperature sensor project on apple developer:
- (void) centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral
{
LeTemperatureAlarmService *service = nil;
/* Create a service instance. */
service = [[LeTemperatureAlarmService alloc] initWithPeripheral:peripheral controller:peripheralDelegate];
[service start];
if (![connectedServices containsObject:service]){
[connectedServices addObject:service];
NSLog(@"added service object");
}
if ([foundPeripherals containsObject:peripheral])
{
[foundPeripherals removeObject:peripheral];
NSLog(@"added peripheral object");
}
[peripheralDelegate alarmServiceDidChangeStatus:service];
[discoveryDelegate discoveryDidRefresh];//breakpointhere
}