This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

what's difference between link-lost and disconnect?

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?

Parents
  • 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)
    
Reply
  • 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)
    
Children
Related