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

How to save Services and Characteristics configuration of a particular BLE device

Hi,

I'm using the BLE_app_interactive example as a starting point for my prototype (with SDK_17.0.2 and SoftDevice s132). I am using nRF52DK to read and write data from/to BLE characteristics of some commercial devices based on nrf52832 micros, using the sequence:

  • scan on 
  • connect XX:XX:XX:XX
  • gatt services XX:XX:XX:XX
  • gatt characteristics XX:XX:XX:XX YYYY
  • gatt read XX:XX:XX:XX ZZZZ

I observe that there are several seconds of delay to read services and then then the particular characteristic that I need. So, every time I want to read a particular characteristics of the device using my nRF52DK, I have to repeat the sequence above.

I suppose all the above commands allow the nRF52DK to register the services and characteristic configuration of the device, in order to query it in the correct way via BLE when I send the gatt read command to the nRF52DK.

Is there a way to save all the information about services and characteristic once I read them for the first time, so that I can speedly read the characteristics I want, avoiding to read informations that I got before, maybe also if I power down my nRF52DK? Is there an example that I can I follow ?

Thanks in advance,

Best Regards.

Antonino

Parents
  • Hello,

    You can of course hardcode many of these things, but you can try by turning down the connection interval settings in both your devices (remember that it is the central that has the final saying in connection parameters). By decreasing this, it will be quicker to send the packets back and forth to do the service discovery etc.

    Another thing you can try is to apply bonding in your project. This way, the peer manager will keep track of the services, characteristics and what characteristics that you turned on notifications/indications. If you want to really lower the time it takes, then maybe that is the way to go. Besides from that, it shouldn't really take that long (couple of seconds). Try the ble_app_uart and ble_app_uart_c example pair, and measure how long it takes before you can send notifications. I am not sure exactly how long it is, but it is not several seconds.

    What is your connection interval, by the way? And from where does your central call ble_db_discovery_start()?

    Best regards,

    Edvin

Reply
  • Hello,

    You can of course hardcode many of these things, but you can try by turning down the connection interval settings in both your devices (remember that it is the central that has the final saying in connection parameters). By decreasing this, it will be quicker to send the packets back and forth to do the service discovery etc.

    Another thing you can try is to apply bonding in your project. This way, the peer manager will keep track of the services, characteristics and what characteristics that you turned on notifications/indications. If you want to really lower the time it takes, then maybe that is the way to go. Besides from that, it shouldn't really take that long (couple of seconds). Try the ble_app_uart and ble_app_uart_c example pair, and measure how long it takes before you can send notifications. I am not sure exactly how long it is, but it is not several seconds.

    What is your connection interval, by the way? And from where does your central call ble_db_discovery_start()?

    Best regards,

    Edvin

Children
No Data
Related