The work item for re-synchronization should be rescheduled immediately
after the periodicity is changed.
Calculation of the periodicity incl. jitter is moved to a dedicated
function so that it can be re-used.
Signed-off-by: Martin Jäger <martin@libre.solar>
Only the first resync transmission was sent out immediately because
the work item was rescheduled to the usual periodicity in the work
handler immediately after sending out the first transmission.
Signed-off-by: Martin Jäger <martin@libre.solar>
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.
Rename it to random.h and get consistently with other
subsystems.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This service allows to synchronize the clock with the application
server.
Synchronization requests are initiated by the device in a regular
interval, configurable via Kconfig.
The implementation only supports TS003-2.0.0, as the previous revision
TS003-1.0.0 requested to temporarily disable ADR and and set nb_trans
to 1. This causes issues on the server side and is not recommended
anymore.
Signed-off-by: Martin Jäger <martin@libre.solar>