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

Notifications disappear on their way

I use two nrf51 chips, one of which works as central and second one as peripheral. After the DM_EVT_LINK_SECURED event is generated on the peripheral side I'm starting the app_timer in single_shot mode with a 15ms period. Inside of this timer, the characteristic is updated (in the same way as in "Bluetooth low energy Characteristics, a beginner's tutorial") with only one byte of data. On the central side I use lbs client profile and after BLE_GATTC_EVT_HVX is generated I change the flag in the program and terminate the connection.

Now, the problem is this notification send by server (peripheral) never reach the client (central). To actually send data I must repeat updates of the characteristic and only after few updates one of the notification come to the client. Could someone explain to me why this happens and how to overcome this? I use SDK 11

Parents
  • I made following experiment:

    On the server side: After the DM_EVT_LINK_SECURED event was received the test_timer is started. The characteristic is updated inside of timeout handler with the counter value. The counter is incremented after each entry to the timeout handler. When the counter reaches the value of 30 the timer is stopped. The connection is terminated by another timer after 10 seconds since the beginning.

    On the client side: Each time when on_hvx function in ble_lbs_c.c is called, the local counter is incremented. After the connection has been terminated, the value of local counter and value of characteristic (updated by server) are displayed:

    local_counter = 23 
    char_value    = 30
    

    It seems that first few notifications are just lost and I guess that it is kind of mistake in SoftDevice implementation. Am I right or I missed something?

Reply
  • I made following experiment:

    On the server side: After the DM_EVT_LINK_SECURED event was received the test_timer is started. The characteristic is updated inside of timeout handler with the counter value. The counter is incremented after each entry to the timeout handler. When the counter reaches the value of 30 the timer is stopped. The connection is terminated by another timer after 10 seconds since the beginning.

    On the client side: Each time when on_hvx function in ble_lbs_c.c is called, the local counter is incremented. After the connection has been terminated, the value of local counter and value of characteristic (updated by server) are displayed:

    local_counter = 23 
    char_value    = 30
    

    It seems that first few notifications are just lost and I guess that it is kind of mistake in SoftDevice implementation. Am I right or I missed something?

Children
No Data
Related