Hi, all expert.
How could I record the time when BLE Link Layer transmit a packet?
I want to use this time information to synchronize with master device.
Thanks.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi, all expert.
How could I record the time when BLE Link Layer transmit a packet?
I want to use this time information to synchronize with master device.
Thanks.
The best you can do is to register for a connection event callback using HCI_EXT_ConnEventNoticeCmd. You could then implement a timestamp when the callback is processed. Of course, this is not the exact time the packet was transmitted as you need to account for connection event post-processing time and the processing time it takes to receive the connection event callback.
See the HCI API in the appendix of the software developer's guide included with the 2.1 installer for more information on this command including an example.
Thanks for your reply.
I had try to use HCI_EXT_ConnEventNoticeCmd, but it dose not accurate.
My connection interval set to 30 ms and turnoff powerSaving.
There are some experiment data (ticks) below:
connection event1 T1 time connection event2 connection event3 T4 time
79124, 82152, 82176, 85121, 88185,
88213, 91151, 91173, 94118, 97185,
Slave record T1 time in simpleProfile_ReadAttrCB() when Master read Char2 .
Slave record T4 time in simpleProfile_WriteAttrCB() when Master write Char1.
We can know time between connection events is almost 3000 ticks(=30 ms).
But, it seems that Slave record T1 time before record connection event2 time.
It is a little weird.