-
Notifications
You must be signed in to change notification settings - Fork 240
Expand file tree
/
Copy pathBleConnectionStatus.cpp
More file actions
26 lines (21 loc) · 919 Bytes
/
BleConnectionStatus.cpp
File metadata and controls
26 lines (21 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "BleConnectionStatus.h"
#include "NimBLELog.h"
static const char* LOG_TAG = "BleConnectionStatus";
BleConnectionStatus::BleConnectionStatus(void)
{
}
void BleConnectionStatus::onConnect(NimBLEServer *pServer, NimBLEConnInfo& connInfo)
{
NIMBLE_LOGD(LOG_TAG, "onConnect - Connected Address: %s", std::string(connInfo.getAddress()).c_str());
pServer->updateConnParams(connInfo.getConnHandle(), 6, 7, 0, 600);
}
void BleConnectionStatus::onDisconnect(NimBLEServer* pServer, NimBLEConnInfo& connInfo, int reason)
{
NIMBLE_LOGD(LOG_TAG, "onDisconnectConnect - Disconnected Address: %s", std::string(connInfo.getAddress()).c_str());
this->connected = false;
}
void BleConnectionStatus::onAuthenticationComplete(NimBLEConnInfo& connInfo)
{
NIMBLE_LOGD(LOG_TAG, "onAuthenticationComplete - Authenticated Address: %s", std::string(connInfo.getAddress()).c_str());
this->connected = true;
}