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

Maximum time an event handler may block the application

Hi,

We're working with very specific hardware which requires us to watch very closely. We're currently considering a blocking function in an ble event handler which can take up to 166 ms to return a value.

What's the maximum time a function call may take with respect to the rest of the application and especially the SoftDevice. We're using s110 and SDK v10.

Edit: Or more specifically, what connection interval should we use to get 170 ms of available time and how do we know when that time is available?

Thanks!

Parents
  • It's kind of evident that blocking the MCU for 170ms isn't good idea, especially if you are running any BLE activity with lower interval (connection or advertising). There is time-slot API mechanism in later S110 as well as all newer SD flavors, see this explanation for S132 (there is similar section in S110 Soft Device Specification v2.0 document but that is released just as PDF). If you decide to use it and encounter any problem there are plenty Q&A on this forum about time-slot API usage and problems.

  • Alright, thanks! I was just looking in that document. If I understand correctly I should use sd_radio_request() to obtain a time slot. Which initially has a maximum of 100 ms but can be extended up to 128 s (depending on the other activities). We're currently using an connection interval in between 275 and 280. So that means we should be able to obtain a time slot of 170 ms.

Reply
  • Alright, thanks! I was just looking in that document. If I understand correctly I should use sd_radio_request() to obtain a time slot. Which initially has a maximum of 100 ms but can be extended up to 128 s (depending on the other activities). We're currently using an connection interval in between 275 and 280. So that means we should be able to obtain a time slot of 170 ms.

Children
No Data
Related