-
No it's not deterministic - Bluetooth protocol has builtin random delay for timing which is around 10 ms or so
Oh, you are right for the advertising, there is delay indeed. Decribed e.g. here https://www.argenox.com/library/bluetooth-low-energy/ble-advertising-primer/ didn't know this. Makes sense. However it is not like that for the rest, the rest has strict timing so receiver device can wake at the precise moment sender is supposed to send the packet, that is part of the 'low energy'.
But anyway even with advertising the timing for scan response packet may be better. This is with active scanning, it is second packet for advertising data.
EDIT:
Scan response is more deterministic, see https://devzone.nordicsemi.com/f/nordic-q-a/29719/beacon-scan-response-request-and-packet-timing
-
Scan response timing seems deterministic only in relation to preceding advertising packet. For that to be useful I'd need to
a) know the exact time when preceding advertising packet was sent
b) set response packet content after preceding advertising packet has been sent, so it's uptodateI don't think either of those are possible with normal APIs since advertising isn't meant to be used for sending time-sensitive data like this. (Sure both would be possible in theory with custom Bluetooth protocol stack.)
@myownself
I thought so too but in my tests that connection takes several seconds while advertisement-solution can be improved down to e.g. 50ms delay between updating advertisement, so using connection is a lot worse for some reason.
@fanoush
No it's not deterministic - Bluetooth protocol has builtin random delay for timing which is around 10 ms or so, so accuracy better than that is not possible using normal API. (But yeah it's good enough.)