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

BLE API: Connection Sequence, I don't understand this.

The App ~ BLE Stack is the device, Central is smartphone.

is correct?

image description

I don't understand this sequence.

Do not adv_data_set and the adv_start before the scan?

And if the connection from the smartphone and sends an event message to the APP from BLE stack.

Why disconnects from the App? Isn't it to disconnect from Central (smartphone)?

I'm not sure how to view the sequence.

Parents
  • The central is scanning irrespective of what is happening on your peripheral side, it has no dependencies as it might be looking for other peripherals nearby. After your peripheral device has done adv_data_set and adv_start, it will start to send adv packets into air and that is when the scanner will know that your device exists and will send you a connect request (depending on what type of advertisement packet you have sent).

    You have to read about message sequence charts to understand this flow. The direction of the arrow is telling you how this event flows.

    you asked "why disconnect from the APP?" The chart is not telling you why APP has triggered a disconnect, it is only telling you that disconnect is triggered from APP (for some reason) and disconnect request from APP is sent lower to BLE stack, which will send this request to central (phone) by air and the stack will inform APP then it is done informing central about the disconnect.

  • GunMin , If this answer has helped you can you please accept it by clicking ✓ mark to the left of this answer. Thank you.

Reply Children
No Data
Related