[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:
Jintao Lin
2020-06-16 22:53:29 -07:00
committed by GitHub
parent 0db8dbeef3
commit e653478c50
12 changed files with 231 additions and 18 deletions
+1 -1
View File
@@ -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
+10
View File
@@ -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);
/**
* @}
*
+10
View File
@@ -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);
/**
* @}
*