Sending and receving data with a minimal latency with BLE
Posted: Tue Jun 12, 2018 9:32 am
Hi everybody,
I am currently working on a project in which i want to control a device from an app ( for example, control the gain of a sound, by moving a slider ) with BLE. To do this, the app and the device has both their own characteristic, and they will send a command/answer by writing on these characteristic. This is how it works :
The application cannot send another command until it has not received the answer of the previous command. If you move the slider in the app, the next command to set the gain will be send only when the previous answer is received by the app,that is why i want the delay between sending and receiving an answer to be very short, almost instantaneous to be smooth while moving the slider.
Each command are approximatly 100 bytes, and a respond is ~50 bytes. The problem is, that with this lenghth of data, i have some latency, varying from 400ms to 1s sometimes to send a command to the device and receiving the answer. So i tried, to reduce my data length to < 20 bytes ( which is the size the data doesn't have to be truncated, right ? ) and the latency drops to 20ms to 40ms which is good. But i have to reduce in consequence all my commands and responses.
First of all, is this latency between sending, and receiving long data via BLE is normal ? ( due to BLE specifications i guess ). Is there any way i can reduce this latency with long commands/answer ?
Thank you
I am currently working on a project in which i want to control a device from an app ( for example, control the gain of a sound, by moving a slider ) with BLE. To do this, the app and the device has both their own characteristic, and they will send a command/answer by writing on these characteristic. This is how it works :
The application cannot send another command until it has not received the answer of the previous command. If you move the slider in the app, the next command to set the gain will be send only when the previous answer is received by the app,that is why i want the delay between sending and receiving an answer to be very short, almost instantaneous to be smooth while moving the slider.
Each command are approximatly 100 bytes, and a respond is ~50 bytes. The problem is, that with this lenghth of data, i have some latency, varying from 400ms to 1s sometimes to send a command to the device and receiving the answer. So i tried, to reduce my data length to < 20 bytes ( which is the size the data doesn't have to be truncated, right ? ) and the latency drops to 20ms to 40ms which is good. But i have to reduce in consequence all my commands and responses.
First of all, is this latency between sending, and receiving long data via BLE is normal ? ( due to BLE specifications i guess ). Is there any way i can reduce this latency with long commands/answer ?
Thank you