微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI Zigbee设计交流 > 在ZIGBEE里看到了结构体强制转换,有点纳闷,求解

在ZIGBEE里看到了结构体强制转换,有点纳闷,求解

时间:10-02 整理:3721RD 点击:
afIncomingMSGPacket_t *MSGpkt;
router2App_ProcessZDOMsgs( (zdoIncomingMsg_t *)MSGpkt );

//将afIncomingMSGPacket_t转换成了zdoIncomingMsg_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 */
  afMSGCommandFormat_t cmd; /* Application Data */
} afIncomingMSGPacket_t;


typedef struct
{
  osal_event_hdr_t hdr;
  zAddrType_t      srcAddr;
  uint8            wasBroadcast;
  cId_t            clusterID;
  uint8            SecurityUse;
  uint8            TransSeq;
  uint8            asduLen;
  uint16           macDestAddr;
  uint8            *asdu;
} zdoIncomingMsg_t;

就问问这里数据是怎么对应的,

传入的应该只是地址而已,后面用到的变量还是原先结构体中对应变量

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

网站地图

Top