50ButtonsEach / fliclib-linux-hci

Flic SDK for Linux
305 stars 55 forks source link

EvtButtonEvent time_diff precision #74

Closed skakri closed 6 years ago

skakri commented 6 years ago

It would be nice if time_diff could be fetched in ms not seconds.

Emill commented 6 years ago

Sure but it's not that easy due to that packets are queued and then sent over the BLE link with varying delay. Also milliseconds need a larger integer type which we don't have space for.

Emill commented 6 years ago

If you need low latency then use that option and stay connected. Time diff will only be nonzero if the event was queued up while the device was disconnected.

skakri commented 6 years ago

If you need low latency then use that option and stay connected.

Does it affect the battery life severely?

Emill commented 6 years ago

If you have a stable connection, then no. If you have an unstable connection, then yes. Is NormalLatency not good enough for you?

skakri commented 6 years ago

It's okay but not great as I need to calculate time compensation. For example – I wish to trigger action after 1500ms but I'll get a small drift on was_queued + time_diff=0. It's nothing critical but not perfect as well.