Hi Matthias,
Background:
I am wrapping up my project using le_data_channel_server & client as starting points. I am attempting to send messages with a payload of 19 unsigned chars from an iOS app once every 30ms over L2CAP connection for safety/real-time control purposes. I planned to use a timer running in a pthread and implemented with calls to btstack_run_loop_get_time_ms() to ensure that there is never more than 40ms between each message received while in this critical state. The message contents change depending on button press, state, etc. However, I am noticing 6-10s delays between when the iOS sends a new message and when the pi/server recognizes/responds to the message (either by a printf indicating new message, printf(packet) displaying contents of the message that is recognized as new, or by the existence of the appropriate response message sent from pi over L2CAP as seen on sniffer/iOS side/packet logger).
Questions:
1) Is this message rate too high or timing constraint too stringent in theory for the le_data_channel_server/pi?
(If it is possible than I am going to assume it is the code I have added that is slowing things down)
2) Is there a way I can make note of a message being received in software/interrupt without waiting for the program to get to the "L2CAP_DATA_PACKET" case?
3) Do timestamps for received packets exist and, if so, how might I access them?
4) In general, do you have any recommendations on how I could speed up the program so that it satisfies timing requirements?
Thank you for your time,
Alec