|
这段关于帧过滤的代码 小白有点看不懂 有大佬方便讲讲吗 感谢感谢
void BPhero_UWB_Message_Init(void)
{
//set frame type (0-2), SEC (3), Pending (4), ACK (5), PanIDcomp(6)
msg_f_send.frameCtrl[0] = 0x1 /*frame type 0x1 == data*/ | 0x40 /*PID comp*/|0x20/* ACK request*/;
//source/dest addressing modes and frame version
//msg_f.frameCtrl[0] = 0x41;
msg_f_send.frameCtrl[1] = 0x8 /*dest extended address (16bits)*/ | 0x80 /*src extended address (16bits)*/;
msg_f_send.panID[0] = 0xF0;
msg_f_send.panID[1] = 0xF0;
msg_f_send.seqNum = 0;
msg_f_send.messageData[POLL_RNUM] = 3; //copy new range number
msg_f_send.messageData[FCODE] = RTLS_DEMO_MSG_ANCH_POLL; //message function code (specifies if message is a poll, response or other...)
psduLength = (TAG_POLL_MSG_LEN + FRAME_CRTL_AND_ADDRESS_S + FRAME_CRC);
msg_f_send.seqNum = 0; //copy sequence number and then increment
msg_f_send.sourceAddr[0] = SHORT_ADDR & 0xFF; //copy the address
msg_f_send.sourceAddr[1] =(SHORT_ADDR>>8)& 0xFF; //copy the address
msg_f_send.destAddr[0] = 0x01; //set the destination address (broadcast == 0xffff)
msg_f_send.destAddr[1] = 0x01; //set the destination address (broadcast == 0xffff)
}
|
|