mirror of https://github.com/arendst/Tasmota.git
MI32 legacy: use disconnect reason as error code (#20676)
This commit is contained in:
parent
5e4a1d7b32
commit
0bc6f82a81
|
@ -95,11 +95,12 @@ class MI32SensorCallback : public NimBLEClientCallbacks {
|
|||
MI32.mode.connected = 1;
|
||||
pclient->updateConnParams(8,11,0,1000);
|
||||
}
|
||||
void onDisconnect(NimBLEClient* pclient) {
|
||||
void onDisconnect(NimBLEClient* pclient, int reason) {
|
||||
MI32.mode.connected = 0;
|
||||
MI32.infoMsg = MI32_DID_DISCONNECT;
|
||||
MI32.conCtx->error = MI32_CONN_DID_DISCCONNECT;
|
||||
MI32.mode.triggerBerryConnCB = 1; //mainly for unexpected or requested disconnects
|
||||
MI32.conCtx->error = reason;
|
||||
MI32.conCtx->operation = 5; //set for all disconnects that come from the remote device or connection loss
|
||||
MI32.mode.triggerBerryConnCB = 1;
|
||||
//AddLog(LOG_LEVEL_DEBUG,PSTR("disconnected"));
|
||||
}
|
||||
};
|
||||
|
@ -2738,4 +2739,4 @@ bool Xsns62(uint32_t function)
|
|||
#endif // USE_MI_ESP32
|
||||
#endif // CONFIG_IDF_TARGET_ESP32 or CONFIG_IDF_TARGET_ESP32C3
|
||||
#endif // ESP32
|
||||
#endif // USE_BLE_ESP32
|
||||
#endif // USE_BLE_ESP32
|
||||
|
|
Loading…
Reference in New Issue