ble-x-nucleo-idb0xa1
ble-x-nucleo-idb0xa1 copied to clipboard
How to change the BLE send data interval ?
about 100ms about 100ms
[1 data]-interval -[2 data]-interval-[3 data] --------------
First data and second data of interval is about 100ms by BLE.
How to reduce the interval in each data sned?
@thegecko @danros
Hello, I think i may be able to help but we need more precision about your issue.
What function do you use to send data ? what is the length of the data ? Do you send data using a gatt characteristic ?
Pierre-Marie
yes , the ble pack's length 20 bytes and use the characteristic to send data.I wish reduce the interval.The interval is about 100ms.
You can request a connection update from the peripheral, by calling the updateConnectionParams
.
For example:
BLE &ble = BLE::Instance();
if (ble.getGapState().connected) {
gap_params.connectionSupervisionTimeout = 500;
gap_params.minConnectionInterval = 16;
gap_params.maxConnectionInterval = 20;
gap_params.slaveLatency = 0;
if (ble.gap().updateConnectionParams(gap_h, &gap_params) == BLE_ERROR_NONE) {
printf("Request a connection params update!\n");
}
}
Thank you @pmancele