mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-27 23:12:39 +00:00
Disable BLE Client role to save space
This commit is contained in:
parent
40f897fa4a
commit
bc9a3d5093
@ -33,6 +33,7 @@ build_flags =
|
||||
-DCONFIG_BT_NIMBLE_ENABLED
|
||||
-DNIMBLE_TWO
|
||||
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||
-DCONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED
|
||||
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
|
||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||
|
||||
@ -310,10 +310,24 @@ int NimbleBluetooth::getRssi()
|
||||
if (bleServer && isConnected()) {
|
||||
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
|
||||
uint16_t handle = service->getHandle();
|
||||
#ifdef CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED
|
||||
if (handle == BLE_HS_CONN_HANDLE_NONE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t rssi = 0;
|
||||
int rc = ble_gap_conn_rssi(handle, &rssi);
|
||||
if (rc != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return rssi;
|
||||
#else
|
||||
#ifdef NIMBLE_TWO
|
||||
return NimBLEDevice::getClientByHandle(handle)->getRssi();
|
||||
#else
|
||||
return NimBLEDevice::getClientByID(handle)->getRssi();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return 0; // FIXME figure out where to source this
|
||||
|
||||
Loading…
Reference in New Issue
Block a user