mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 11:17:46 +00:00
[posix] get time offset between host and rcp (#5089)
To support CSL on RCP mode, POSIX host needs to know current time on RCP. This commit adds function to periodically calculate the time offset between host and RCP so that host can get an estimated RCP time by adding its current time with this offset.
This commit is contained in:
@@ -53,7 +53,7 @@ extern "C" {
|
||||
* @note This number versions both OpenThread platform and user APIs.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_API_VERSION (5)
|
||||
#define OPENTHREAD_API_VERSION (6)
|
||||
|
||||
/**
|
||||
* @addtogroup api-instance
|
||||
|
||||
@@ -363,6 +363,16 @@ otError otLinkRawSetMacKey(otInstance * aInstance,
|
||||
*/
|
||||
otError otLinkRawSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter);
|
||||
|
||||
/**
|
||||
* Get current platform time (64bits width) of the radio chip.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @returns The current radio time in microseconds.
|
||||
*
|
||||
*/
|
||||
uint64_t otLinkRawGetRadioTime(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
|
||||
@@ -489,6 +489,16 @@ void otPlatRadioSetMacKey(otInstance * aInstance,
|
||||
*/
|
||||
void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter);
|
||||
|
||||
/**
|
||||
* Get the current estimated time (64bits width) of the radio chip.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @returns The current time in microseconds. UINT64_MAX when platform does not support or radio time is not ready.
|
||||
*
|
||||
*/
|
||||
uint64_t otPlatRadioGetNow(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user