mirror of
https://github.com/lemmingDev/ESP32-BLE-Gamepad.git
synced 2026-03-03 06:44:11 +01:00
When Windows bonds with a device and subscribes to notifications/indications of the device characteristics it does not re-subscribe on subsequent connections. If a notification is sent when Windows reconnects it will overwrite the stored subscription value in the NimBLE stack configuration with an invalid value which results in notifications/indications not being sent. This change will ensure that no notification or indication is sent before authentication upon reconnection, avoiding the described issue described above.
21 lines
490 B
C++
21 lines
490 B
C++
#include "BleConnectionStatus.h"
|
|
|
|
BleConnectionStatus::BleConnectionStatus(void)
|
|
{
|
|
}
|
|
|
|
void BleConnectionStatus::onConnect(NimBLEServer *pServer, NimBLEConnInfo& connInfo)
|
|
{
|
|
pServer->updateConnParams(connInfo.getConnHandle(), 6, 7, 0, 600);
|
|
}
|
|
|
|
void BleConnectionStatus::onDisconnect(NimBLEServer* pServer, NimBLEConnInfo& connInfo, int reason)
|
|
{
|
|
this->connected = false;
|
|
}
|
|
|
|
void BleConnectionStatus::onAuthenticationComplete(NimBLEConnInfo& connInfo)
|
|
{
|
|
this->connected = true;
|
|
}
|