Etan, Just to check, you're referring to peripheralManagerDidUpdateState, correct? When my test app is running in Peripheral mode, and I switch that mode off (calling the "stopPeripheral" method I included below), I do not get a call to CBPeripheralManagerStatePoweredOff. Should I be? peripheralManager:didAddService:error: is where I'm currently calling [startAdvertising] I'm currently performing the setup of the service and the [addService] call in the CBPeripheralManagerStatePoweredOn state change. -Allan On 1/11/13 1:08 PM, "Etan Kissling" <kissling@oberon.ch> wrote:
Allan,
regarding the peripheralManagerIsReadyToUpdateSubscribers: delegate call: it is only called after updateValue:forCharacteristic:onSubscribedCentrals: returned NO. This could explain why this delegate method is not invoked for you. I previously thought that it is always called.
What happens if you
- put the [removeAllServices] into the peripheralManagerHasUpdateState: delegate method when the state is CBPeripheralManagerStatePoweredOff?,
- and the [startAdvertising] into the peripheralManager:didAddService:error: method?
- Also add the [addService] call into the peripheralManagerHasUpdatedState: delegate when the state is CBPeripheralManagerStatePoweredOn.
Etan
On 11.01.2013, at 21:49, Allan Young <allany@adobe.com> wrote:
I tried using the LightBlue app (BLExplr wasn't able to discover my service).
LightBlue reported the service the first three times that I added the service (I tore down my peripheral and then re-created the service in between each check).
After that, no more service detected.
To tear down the service, I call:
- (void) stopPeripheral { if ( self.peripheralManager ) {
if ( self.peripheralManager.isAdvertising ) [ self.peripheralManager stopAdvertising ];
[ self.peripheralManager removeAllServices ]; // Seems to have no effect on this issue self.peripheralManager = NULL; } }
... look correct?
Allan
_______________________________________________ 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