Re: Central connection to peripheral and dynamic characteristics
Hi all, *** updateValue issue: I partly solved the updateValue issue. It seems the CBPeripheralManager::updateValue behaves differently than it is expected. Either the documentation is not appropriate or the implementation is inconsistent. The documentation sais: onSubscribedCentrals is an array of CBCentrals The real experience is: onSubscribedCentrals is accepted if it is an array of the UUIDs of the CBCentrals. The update happens on the remote central but then I receive a memory deallocation exception. Something wants to free a pointer that was not allocated by malloc. I'll try to malloc_error_break debug this. *** centralDidConnect issue: The centralDidConnect callback has never been invoked by the framework. Even if connection was set up. Best regards, Andras 2012/8/3 Andras Kovi <allprog@gmail.com>:
Hi all,
I'm experimenting with the Bluetooth Core APIs and encountered some problems. I'd be grateful if someone could give me a hint of what I am doing wrong. I am using the HeartRateMonitor example application as client and implement the peripheral role on the iPhone 4S.
1. I never get the centralDidConnect callback even though the connection between the devices is established. Or at least the service and characteristic discoveries are successful and static characteristic readings are logged by the HeartRateMonitor application.
2. I receive the didSubscribeToCharacteristic callback but I cannot use the CBCentral received as argument as it raises an exception: 2012-08-03 00:44:45.502 HeartRateServer[489:907] Did subscribe to characteristic central:<CFUUID 0x1ed25740> 00000000-0000-0000-BBDA-427179445E7B characteristic:Unknown (<2a37>) 2012-08-03 00:44:45.505 HeartRateServer[489:907] *** Terminating app due to uncaught exception 'Invalid Object', reason: 'Argument <CBCentral: 0x1ed0d9a0 UUID = <CFUUID 0x1ed25740> 00000000-0000-0000-BBDA-427179445E7B> is invalid'
char heartRateData[2]; heartRateData[0] = 0; heartRateData[1] = 60;
[peripheralManager updateValue:[NSData dataWithBytesNoCopy:&heartRateData length:2] forCharacteristic:heartRateSensorHeartRateCharacteristic onSubscribedCentrals:[NSArray arrayWithObjects:subCentral, nil]]; <<<< EXCEPTION HERE
Best regards, Andras
Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
András Kövi