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

ble_hts_is_indication_enabled always false on re-connection

Hi,

I'm developing a peripheral that expose the HTS service. I have the on_hts_evt event handler to handle BLE_HTS_EVT_INDICATION_ENABLED and BLE_HTS_EVT_INDICATION_DISABLED to start and stop a timer that sends temperature value. Suppose I enable indication from central side (a smartphone) ... it works great ... the indication is enabled and the temperature value is received (on the central). Suppose I disconnect from peripheral without disabling indication first. When I reconnect, handling the DM_EVT_LINK_SECURED event in the device_manager_evt_handler event handler, I use the ble_hts_is_indication_enabled to check if indication is enabled (I get the code from ble_app_hts example). However, the above function returns always false even if as I said I disconnected from peripheral without disabling the indication.

Why ?

Thanks, Paolo.

Parents
  • Hi Paolo,

    It's normal that the function return code was false (0) because 0 = NRF_SUCCESS. Meaning the function returns successfully.

    The output of the function is the value of "is_indication_enabled" not the return code of the function.

  • Following my results ...

    Starting from a clean scenario (smartphone and peripheral NOT bonded)

    1. Excuting bonding for the first time ... indication result disabled on peripheral and on smartphone (I'm using Master Control Panel for Android) ... so OK
    2. Enable indication
    3. Click DISCONNECT on Master Control Panel (so bonded information are still on smartphone and peripheral)
    4. Click CONNECT ... the trace on peripheral says me indication disabled ! (I disconnected when indication was enabled)
Reply
  • Following my results ...

    Starting from a clean scenario (smartphone and peripheral NOT bonded)

    1. Excuting bonding for the first time ... indication result disabled on peripheral and on smartphone (I'm using Master Control Panel for Android) ... so OK
    2. Enable indication
    3. Click DISCONNECT on Master Control Panel (so bonded information are still on smartphone and peripheral)
    4. Click CONNECT ... the trace on peripheral says me indication disabled ! (I disconnected when indication was enabled)
Children
No Data
Related