Confusion about BLE connection interval and how often the Peripheral will send data to the Central

Hi everyone,

Does anyone ever get confused about BLE connection interval? As explained in this post, it determines how often the Central will ask for data from the Peripheral (min 7.5 ms -- max 4 sec). For my application, I'm using a timer and set it every 10 seconds which the timer_callback function will be called to send the data to the Central. 

So 10 seconds here will be determined as how often the Peripheral will send the data to the Central, is that correct? What happens if even Central asks for data from the Peripheral, however, the Peripheral hasn't sent it yet because it was set up to send the data to Center every 10 seconds? In this case, during the connection interval, what data the Peripheral will send to the Central? 

Thanks,

Tai 

Parents
  • Hi Tai, 

    You can watch a BLE tutorial here.

    Be noted that in each connection event (or in other words "in each connection interval") the central will send a packet to the perpiheral. It's not the central asking for data from the peripheral. It can be an empty packet from the central and if the peripheral has any data it can choose to send data otherwise it can send an empty packet back. 

    It's a way of keeping the connection alive. The slave can choose not to reply (slave latency) but it should reply (either with data or with empty packet) before the connection is terminated because of the inactivity timeout. 

    The handling of sending empty data or skip the responding (slave latency) is handled by the BLE stack so the application doesn't need to handle this. 


    In your case you send data every 10 seconds, so most of the time it will just reply to the central with empty packet and every 10seconds sending a data packet. 

  • It makes sense anh. I'll definitely watch the video you suggested. Thank you for your answer!

Reply Children
No Data
Related