mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-28 23:34:03 +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
|
-DCONFIG_BT_NIMBLE_ENABLED
|
||||||
-DNIMBLE_TWO
|
-DNIMBLE_TWO
|
||||||
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||||
|
-DCONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED
|
||||||
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||||
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
|
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
|
||||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
|
|||||||
@ -310,10 +310,24 @@ int NimbleBluetooth::getRssi()
|
|||||||
if (bleServer && isConnected()) {
|
if (bleServer && isConnected()) {
|
||||||
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
|
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
|
||||||
uint16_t handle = service->getHandle();
|
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
|
#ifdef NIMBLE_TWO
|
||||||
return NimBLEDevice::getClientByHandle(handle)->getRssi();
|
return NimBLEDevice::getClientByHandle(handle)->getRssi();
|
||||||
#else
|
#else
|
||||||
return NimBLEDevice::getClientByID(handle)->getRssi();
|
return NimBLEDevice::getClientByID(handle)->getRssi();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return 0; // FIXME figure out where to source this
|
return 0; // FIXME figure out where to source this
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user