Other Parts Discussed in Thread: BLE-STACK, SYSCONFIG
Tool/software:
Hello
I am writing a program for working with BLE based on the multirole example. I have some of the following actions:
1. Connect to the device using a known MAC address
2. Find the desired service by a known UUID and subscribe to a notification inside it.
3. Send data with confirmation to another characteristic in this service.
Repeat action 3 many times.
The problem is that when calling the GATT_WriteCharValue (or GATT_WriteLongCharValue) function, it often returns 0x16 (blePending: A response is pending with this server). I temporarily solved this problem by making a loop in which I check the result of the check and repeat until I get a successful execution. This may require up to 800 iterations.
The question is how to properly handle such events, because the loop seems to me to be an ineffective solution. Perhaps it is necessary to somehow check the readiness of a new sending? Or to maintain some kind of pause before connecting? Maybe the latency parameter affects this?