mirror of
https://github.com/espressif/openthread.git
synced 2026-08-16 15:47:46 +00:00
[time-sync] network-wide time synchronization service (#2618)
OpenThread network-wide time synchronization service is an experimental feature, not part of the standard Thread protocol. Feature Overview: * All the nodes in the same Thread partition sync to the same Thread network-wide time; * Microsecond level time synchronization precision; * Flexible time accuracy and time sync period configuration; * APIs for application layer use case, support both CLI and NCP version. The feature is wrapped by OPENTHREAD_CONFIG_ENABLE_TIME_SYNC, there's no change to current Thread 1.1 implementation if OPENTHREAD_CONFIG_ENABLE_TIME_SYNC is not enabled. If OPENTHREAD_CONFIG_ENABLE_TIME_SYNC is enabled, the node could: * Attach to a time sync enabled network, otherwise * Attach to a standard Thread 1.1 network, otherwise * Form a new time sync enabled network In addition, if OPENTHREAD_CONFIG_TIME_SYNC_REQUIRED is also enable, the node could only: * Attach to a time sync enabled network, otherwise * Form a new time sync enabled network Note: Currently, the feature is only supported on nRF52840 and posix platforms. And the network time is only synced among Routers and REEDs, the SEDs will be supported later as an optional feature.
This commit is contained in:
@@ -46,26 +46,34 @@ void TestMacHeader(void)
|
||||
uint8_t secCtl;
|
||||
uint8_t headerLength;
|
||||
} tests[] = {
|
||||
{Mac::Frame::kFcfDstAddrNone | Mac::Frame::kFcfSrcAddrNone, 0, 3},
|
||||
{Mac::Frame::kFcfDstAddrNone | Mac::Frame::kFcfSrcAddrShort, 0, 7},
|
||||
{Mac::Frame::kFcfDstAddrNone | Mac::Frame::kFcfSrcAddrExt, 0, 13},
|
||||
{Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrNone, 0, 7},
|
||||
{Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrNone, 0, 13},
|
||||
{Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrShort, 0, 11},
|
||||
{Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrExt, 0, 17},
|
||||
{Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrShort, 0, 17},
|
||||
{Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrExt, 0, 23},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrNone | Mac::Frame::kFcfSrcAddrNone, 0, 3},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrNone | Mac::Frame::kFcfSrcAddrShort, 0, 7},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrNone | Mac::Frame::kFcfSrcAddrExt, 0, 13},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrNone, 0, 7},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrNone, 0, 13},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrShort, 0, 11},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrExt, 0, 17},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrShort, 0, 17},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrExt, 0, 23},
|
||||
|
||||
{Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrShort | Mac::Frame::kFcfPanidCompression, 0, 9},
|
||||
{Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrExt | Mac::Frame::kFcfPanidCompression, 0, 15},
|
||||
{Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrShort | Mac::Frame::kFcfPanidCompression, 0, 15},
|
||||
{Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrExt | Mac::Frame::kFcfPanidCompression, 0, 21},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrShort |
|
||||
Mac::Frame::kFcfPanidCompression,
|
||||
0, 9},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrExt |
|
||||
Mac::Frame::kFcfPanidCompression,
|
||||
0, 15},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrShort |
|
||||
Mac::Frame::kFcfPanidCompression,
|
||||
0, 15},
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrExt | Mac::Frame::kFcfSrcAddrExt |
|
||||
Mac::Frame::kFcfPanidCompression,
|
||||
0, 21},
|
||||
|
||||
{Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrShort | Mac::Frame::kFcfPanidCompression |
|
||||
Mac::Frame::kFcfSecurityEnabled,
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrShort |
|
||||
Mac::Frame::kFcfPanidCompression | Mac::Frame::kFcfSecurityEnabled,
|
||||
Mac::Frame::kSecMic32 | Mac::Frame::kKeyIdMode1, 15},
|
||||
{Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrShort | Mac::Frame::kFcfPanidCompression |
|
||||
Mac::Frame::kFcfSecurityEnabled,
|
||||
{Mac::Frame::kFcfFrameVersion2006 | Mac::Frame::kFcfDstAddrShort | Mac::Frame::kFcfSrcAddrShort |
|
||||
Mac::Frame::kFcfPanidCompression | Mac::Frame::kFcfSecurityEnabled,
|
||||
Mac::Frame::kSecMic32 | Mac::Frame::kKeyIdMode2, 19},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user