微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI Zigbee设计交流 > Zstack数据包中timestamp所记录的时间

Zstack数据包中timestamp所记录的时间

时间:10-02 整理:3721RD 点击:

 各位工程师们你们好:

请教一个问题:

Zstack中收到的数据包格式为afIncomingMSGPacket_t ,数据结构如下

typedef struct
{
  osal_event_hdr_t hdr; /* OSAL Message header */
  uint16 groupId; /* Message's group ID - 0 if not set */
  uint16 clusterId; /* Message's cluster ID */
  afAddrType_t srcAddr; /* Source Address, if endpoint is STUBAPS_INTER_PAN_EP,
  it's an InterPAN message */
  uint16 macDestAddr; /* MAC header destination short address */
  uint8 endPoint; /* destination endpoint */
  uint8 wasBroadcast; /* TRUE if network destination was a broadcast address */
  uint8 LinkQuality; /* The link quality of the received data frame */
  uint8 correlation; /* The raw correlation value of the received data frame */
  int8 rssi; /* The received RF power in units dBm */
  uint8 SecurityUse; /* deprecated */
  uint32 timestamp; /* receipt timestamp from MAC */
  uint8 nwkSeqNum; /* network header frame sequence number */
  afMSGCommandFormat_t cmd; /* Application Data */
} afIncomingMSGPacket_t;

我想知道其中uint32 timestamp; /* receipt timestamp from MAC */  所记录的mac层时间具体在哪里产生并在什么情况下记录的?并且我查看了所记录的时间,其单位不是1ms 也不是1μs,那么到底是什么时间单位记录的。。

另外这个时间能否作为节点的本地时间?又该如何调整更改呢?因为我要做节点时间同步的问题。

望解答,感激不尽!

望解答,感激不尽!

烦请工程师们解答,谢谢 

hi, Jin He,

我最近也在做时间同步的项目,zstack数据包中的timestamp应该是接收到包的MAC层的时间。具体时间单位如下:

timestamp unit is based on a basic time unit called Backoff Period(BP)
a Unit Backoff Period = the transmission time of 80bits(0.32ms)

如果精度要求比较高的话,个人觉得需要使用timer2来做本地时钟。

终于有人回答了! 这个关于timestamp的介绍是在哪里看到的?  我之前一直是用timer2作为本地时钟的,因为osal系统就是用timer2计时,只不过timer2返回的是毫秒时间,我想要获取微妙级的时间,所以头疼的就在这里。不过看来timestamp的精度也不是很高,只不过我觉得它是在mac层记录时间,比在应用层记录时间更精确些吧?

hi,Derek T ,能否留给联系方式呢,我公开了邮箱,欢迎一起探讨问题啊!

嗯已发邮件。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top