Hi,all. i faced a problem:when i take my phone far away from my device,link-lost severce can work,but turn bluetooth switch off on my phone directly,my device can't alarm.What's wrong? Can someone help me?
Hi,all. i faced a problem:when i take my phone far away from my device,link-lost severce can work,but turn bluetooth switch off on my phone directly,my device can't alarm.What's wrong? Can someone help me?
Hi, I had to edit my previous answer because i misunderstood the question the first time.
I am guessing that the link-loss is due to peer out of range or non responsive in that case you will get
p_ble_evt->evt.gap_evt.params.disconnected.reason = BLE_HCI_CONNECTION_TIMEOUT (0x08)
if it is proper disconnect then
p_ble_evt->evt.gap_evt.params.disconnected.reason = BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION(0x13)
that probably just means that iOS and android do something different when you turn off bluetooth. If android closes down the connections before it shuts the bluetooth chip down then you won't see a link loss, you'll see a disconnection, if iOS just turns the bluetooth chip off, then the link will time out and you'll see the link loss.
Put a packet sniffer on to see what's happening.
that probably just means that iOS and android do something different when you turn off bluetooth. If android closes down the connections before it shuts the bluetooth chip down then you won't see a link loss, you'll see a disconnection, if iOS just turns the bluetooth chip off, then the link will time out and you'll see the link loss.
Put a packet sniffer on to see what's happening.