I noticed that updating the value of a BLE characteristic with setValue(buf, len) is quite “slow”, it takes about 90ms when a device is connected and receiving the characteristics notifications. If no device is connected, the update takes < 1ms.
- Is this caused by the NRF hardware or softdevice or is it the DeviceOS which takes this time?
- Is there a ways to make this update faster?
Some relevant code snippets:
BleCharacteristic c1 = BleCharacteristic("a", BleCharacteristicProperty::NOTIFY, BleUuid(0x0001), sensorService) ... uint8_t buf; ... c1.setValue(buf, sizeof(buf)); c2.setValue(buf, sizeof(buf));
Log output (look at time difference):
0001126481 [hal.ble] TRACE: hal_ble_gatt_server_notify_characteristic_value(). 0001126598 [hal.ble] TRACE: hal_ble_gatt_server_notify_characteristic_value().
Boron 2G/3G, deviceOS 1.4.0