标签:space 回调函数 解释 mem cat ati gid 刷新 mil
typedef struct { uint8 frameCtrl; // frame control bytes 00 uint8 seqNum; // sequence_number 01 uint8 tagID[BLINK_FRAME_SOURCE_ADDRESS]; // 02-09 64 bit address uint8 fcs[2] ; // 10-11 CRC } iso_IEEE_EUI64_blink_msg ;
Blink 数据供12byte,用于需要填写的10byte,CRC是硬件自动附加在数据上的,无需用户处理,只需要留空即可。Blink 数据中使用的地址为IEEE 64位长地址。
memcpy(inst->blinkmsg.tagID, inst->eui64, ADDR_BYTE_SIZE_L); //blink frames with IEEE EUI-64 tag ID inst->blinkmsg.frameCtrl = 0xC5 ; inst->blinkmsg.seqNum = inst->frameSN++; dwt_writetxdata(flength, (uint8 *) (&inst->blinkmsg), 0) ; // write the frame data dwt_writetxfctrl(flength, 0, 1);
上述代码摘录拼凑而成
//主循环禁止帧过滤
dwt_enableframefilter(DWT_FF_NOTYPE_EN); //disable frame filtering inst->frameFilteringEnabled = 0 ; //接收回调函数 switch(rxd->fctrl[0]) { //blink type frame case 0xC5: if(rxd->datalength == 12) { rxd_event = DWT_SIG_RX_BLINK; } else rxd_event = SIG_RX_UNKNOWN; break;
Blink 是自定义数据结构,非标准IEEE 802.15.4 MAC 数据格式,在接收这样的数据结构时需要 禁止帧过滤功能。
Frame filtering is a feature of the DW1000 IC that can parse the received data of a frame that complies with the MAC encoding defined in the IEEE 802.15.4–2011 standard, identifying the frame type and its
destination address fields, match these against the IC’s own address information, and only accept frames that pass the filtering rules.
typedef struct { uint8 frameCtrl[2]; // frame control bytes 00-01 uint8 seqNum; // sequence_number 02 uint8 panID[2]; // PAN ID 03-04 uint8 destAddr[ADDR_BYTE_SIZE_S]; // 05-06 uint8 sourceAddr[ADDR_BYTE_SIZE_S]; // 07-08 uint8 messageData[MAX_USER_PAYLOAD_STRING_SS] ; // 09-124 (application data and any user payload) uint8 fcs[2] ; // 125-126 we allow space for the CRC as it is logically part of the message. However ScenSor TX calculates and adds these bytes. } srd_msg_dsss ;
我们分析使用短地址方式,从代码结构体定义可以看出没有Source PAN Identifier 这一项。messageData 为实际传输的数据。
标签:space 回调函数 解释 mem cat ati gid 刷新 mil
原文地址:https://www.cnblogs.com/tuzhuke/p/10261192.html