troystribling / BlueCap

iOS Bluetooth LE framework
MIT License
714 stars 114 forks source link

Not getting callback for peripheral Disconnection #78

Closed ankit2002 closed 6 years ago

ankit2002 commented 6 years ago

Hey, If I disconnect the peripheral (bleno in terminal with control+c) i am not getting any callback in Bluecapkit framework. It only get notify on didModifyService of Peripheral.swift. Will you please guide me which class or method should I look in to get that delegate callback for disconnection.

Thanks

troystribling commented 6 years ago

Did you try this https://github.com/troystribling/BlueCap/blob/master/Documentation/CentralManager.md#central_peripheral_connection

One of the failure events is disconnect.

ankit2002 commented 6 years ago

Thanks a lot for your response. Yes I have tried and I think its not the frameworks problem. Actually i am using bleno as peripheral and killing it by pressing control + c in terminal and then I am not getting any disconnect callback. But the framework does get peripherals didModifyServices callback. The problem is iphone doesn't disconnect the bluetooth connection from mac. Do you have any advice for the approach.

troystribling commented 6 years ago

Sorry, I do not have any experience with bleno. If you turn off bluetooth on the computer running bleno do you get the disconnect event?

ankit2002 commented 6 years ago

Yeah, If I turn the bluetooth off from the mac it does notify. Thats why I don't think its an issue on framework. Thanks anyways have a nice weekend :).