51uwb.cn

标题: 求大佬讲讲关于帧过滤的问题 [打印本页]

作者: wjc666    时间: 2022-2-11 14:04
标题: 求大佬讲讲关于帧过滤的问题
这段关于帧过滤的代码 小白有点看不懂 有大佬方便讲讲吗  感谢感谢



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)
}


作者: admin    时间: 2022-2-11 22:35
http://51uwb.cn/forum.php?mod=vi ... =%D6%A1%B9%FD%C2%CB

参考这个帖子
多搜多看




欢迎光临 51uwb.cn (http://51uwb.cn/) Powered by Discuz! X3.3