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

Internal State changes of the SoftDevice

Hello,

I am wondering how the Softdevice works internally with state changes because that's important for error handling. Here's an example:

Let's say the Softdevice is Advertising and at the same time in a connection. Then it first receives a packet through a connection and right after that another Central answers to one of its advertising packets. Now there are two events in the event buffer: the packet received event and another event that that informs about the connection. If I process the first event and call sd_ble_gap_adv_stop, what will happen? Has the Softdevice changed its state internally and will give me INVALID_STATE or does it change states according to the current event in the buffer?

Thanks :-)

Parents
  • The softdevice maintains event slots for all type of air-traffic. And these events are differentiated from the handles. The scenario you mentioned is quite normal and happens in most multi role examples in SDK. When you call sd_ble_gap_adv_stop, the softdevice will mark its advertising state to stop. That means the next allocated slot(s) for the advertisement ar all cancelled. It does not have any relation with what is in in the event buffer.

    Also I do not think we are allowed to discuss in deep details about how softdevice works internally. All I can say is that the scenario you mentioned is handled very gracefully.

Reply
  • The softdevice maintains event slots for all type of air-traffic. And these events are differentiated from the handles. The scenario you mentioned is quite normal and happens in most multi role examples in SDK. When you call sd_ble_gap_adv_stop, the softdevice will mark its advertising state to stop. That means the next allocated slot(s) for the advertisement ar all cancelled. It does not have any relation with what is in in the event buffer.

    Also I do not think we are allowed to discuss in deep details about how softdevice works internally. All I can say is that the scenario you mentioned is handled very gracefully.

Children
No Data
Related