在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;
就问问这里数据是怎么对应的,
传入的应该只是地址而已,后面用到的变量还是原先结构体中对应变量
