CYW20706 BLE disconnect reason

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
adam
Level 4
Level 4
5 solutions authored 25 replies posted 50 sign-ins

Hi, 

I fonud some issue in BLE disconnect callback function(ex: hello_sensor_gatts_callback), 

When I have socond device connect to CYW20706(can connect 4 devices), 

I got the first device disconnect callback message, and disconnect reason is 0x28, 

I haven't found 0x28 in disconnect reason enum, where did it come from?

adam_0-1656309797512.png

adam_1-1656309959562.pngadam_2-1656309990245.png

 

0 Likes
1 Solution
Qi_Colin
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 5 questions asked

Hi @adam :

I think this disconnect reason is HCI_ERR_INSTANT_PASSED(0x28).

HCI_ERR.jpg

I found some explanation of the ERR, you can check it below.

When data is being transmitted over BLE, data transfers can only start at sync points in time known as "connection events". At the BLE link layer there are couple special requests that can be made which are relative to these sync points. They are:

  • LL_CHANNEL_MAP_REQ - A request to change the BLE channels being transmitted on. Bluetooth chips will change the channel map based on the noise in the environment to try to limit packet drop.
  • LL_CONNECTION_UPDATE_REQ - A request to change the frequency of "connection events" (known as the "connection interval"). This is done to achieve better throughput/latency or save more power.

Each of these Link Layer requests when sent over the air contains an "Instant" to change. The "Instant" is the "connection event" in the future to apply the change.

At the Link Layer, BLE is reliable. This means each Link Layer packet must be ack'd by the other side. In a noisy RF environment, it's possible a link layer packet may require a couple retries to actually send. This means the packet could arrive many "connection events" after originally intended.

If one of the packets mentioned above is received after the "Instant" the changes were supposed to be applied, by definition the BLE chip must disconnect with reason 0x28 (Instant Passed).

Best Regards,

Colin

View solution in original post

0 Likes
1 Reply
Qi_Colin
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 5 questions asked

Hi @adam :

I think this disconnect reason is HCI_ERR_INSTANT_PASSED(0x28).

HCI_ERR.jpg

I found some explanation of the ERR, you can check it below.

When data is being transmitted over BLE, data transfers can only start at sync points in time known as "connection events". At the BLE link layer there are couple special requests that can be made which are relative to these sync points. They are:

  • LL_CHANNEL_MAP_REQ - A request to change the BLE channels being transmitted on. Bluetooth chips will change the channel map based on the noise in the environment to try to limit packet drop.
  • LL_CONNECTION_UPDATE_REQ - A request to change the frequency of "connection events" (known as the "connection interval"). This is done to achieve better throughput/latency or save more power.

Each of these Link Layer requests when sent over the air contains an "Instant" to change. The "Instant" is the "connection event" in the future to apply the change.

At the Link Layer, BLE is reliable. This means each Link Layer packet must be ack'd by the other side. In a noisy RF environment, it's possible a link layer packet may require a couple retries to actually send. This means the packet could arrive many "connection events" after originally intended.

If one of the packets mentioned above is received after the "Instant" the changes were supposed to be applied, by definition the BLE chip must disconnect with reason 0x28 (Instant Passed).

Best Regards,

Colin

0 Likes