Skip to content

Commit a627007

Browse files
mr258876h2zero
authored andcommitted
Fix compiling errors when central is disabled.
* Fix missing member error 'm_pClient' in NimBLEServer
1 parent a6ed193 commit a627007

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/NimBLEServer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ NimBLEServer::~NimBLEServer() {
7070
delete m_pServerCallbacks;
7171
}
7272

73+
# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
7374
if (m_pClient != nullptr) {
7475
delete m_pClient;
7576
}
77+
# endif
7678
}
7779

7880
/**
@@ -399,10 +401,12 @@ int NimBLEServer::handleGapEvent(ble_gap_event* event, void* arg) {
399401
}
400402
}
401403

404+
# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
402405
if (pServer->m_pClient && pServer->m_pClient->m_connHandle == event->disconnect.conn.conn_handle) {
403406
// If this was also the client make sure it's flagged as disconnected.
404407
pServer->m_pClient->m_connHandle = BLE_HS_CONN_HANDLE_NONE;
405408
}
409+
# endif
406410

407411
if (pServer->m_svcChanged) {
408412
pServer->resetGATT();

0 commit comments

Comments
 (0)