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

Is a delay needed between Characteristic updates

Is a delay needed between Characteristic updates

I modified the ble_sdk_app_proximity example. I added x3 services, based on the BLE Characteristics, a beginner's tutorial, and it seems to be working fine. (nrf5-ble-tutorial-characteristic-CompletedCode ported for SDK 13.zip)

The timer updates every 1 second, but can I consecutively update the characteristics of all three services.

I seems the first (original example) updates its cpu temperature fine, but the additional x2 service do not seem to except updates. I can manually write and read from them.

The added x2 services were created exactly as the original example. So in the timer_timeout_handler I also update the two additional services............

our_termperature_characteristic_update(&m_our_service, &temperature); sr2_termperature_characteristic_update(&m_sr2_service, &temperature); sr3_termperature_characteristic_update(&m_sr3_service, &temperature);

Any help appreciated

Parents
  • Hi,

    I think this is related to your other question: How is BLE_CONN_HANDLE_INVALID changed in multiple services.

    However, you are free to call our_termperature_characteristic_update() as fast as you want, but at a certain point the transmit buffer will overflow and sd_ble_gatts_hvx() will return BLE_ERROR_NO_TX_PACKETS. This error is pretty easy to handle though; make some sort of if(returned error == BLE_ERROR_NO_TX_PACKETS) check, and simply try again until the function return NRF_SUCCESS.

Reply
  • Hi,

    I think this is related to your other question: How is BLE_CONN_HANDLE_INVALID changed in multiple services.

    However, you are free to call our_termperature_characteristic_update() as fast as you want, but at a certain point the transmit buffer will overflow and sd_ble_gatts_hvx() will return BLE_ERROR_NO_TX_PACKETS. This error is pretty easy to handle though; make some sort of if(returned error == BLE_ERROR_NO_TX_PACKETS) check, and simply try again until the function return NRF_SUCCESS.

Children
No Data