Commit 242c0ab
Fix: onDisconnect not called when central powers off with 0x3E reason after established connection
When a BLE connection was established (BLE_GAP_EVENT_CONNECT with status 0) and then
disconnects with BLE_ERR_CONN_ESTABLISHMENT (0x3E) - which can happen when the peer
powers off within the first 6 connection events - the 2.5.0 retry logic incorrectly
suppressed onDisconnect and called onConnectFail after retries (up to 60+ seconds later).
Fix: only retry on 0x3E if the connection was never established (m_connStatus != CONNECTED).
When the connection was previously established, call onDisconnect (not onConnectFail) so
user reconnect logic fires correctly.
Agent-Logs-Url: https://github.com/h2zero/NimBLE-Arduino/sessions/ca79e82b-2ceb-4ae8-83d3-c6344ed13cea
Co-authored-by: h2zero <32826625+h2zero@users.noreply.github.com>1 parent 9273857 commit 242c0ab
2 files changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1062 | 1067 | | |
1063 | | - | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
1064 | 1073 | | |
1065 | 1074 | | |
1066 | 1075 | | |
| |||
1078 | 1087 | | |
1079 | 1088 | | |
1080 | 1089 | | |
1081 | | - | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1082 | 1095 | | |
1083 | 1096 | | |
1084 | 1097 | | |
| |||
1088 | 1101 | | |
1089 | 1102 | | |
1090 | 1103 | | |
1091 | | - | |
| 1104 | + | |
1092 | 1105 | | |
1093 | 1106 | | |
1094 | | - | |
| 1107 | + | |
1095 | 1108 | | |
1096 | 1109 | | |
1097 | 1110 | | |
| |||
0 commit comments