51uwb.cn

 找回密码
 立即注册
查看: 5445|回复: 4

DWM1000测量消息的含义中的疑问

[复制链接]

5

主题

24

帖子

72

积分

注册会员

Rank: 2

积分
72
发表于 2019-4-30 09:02:37 | 显示全部楼层 |阅读模式
/* Frames used in the ranging process. See NOTE 2 below. */
static uint8 rx_poll_msg[] =  {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0x21, 0, 0};
static uint8 tx_resp_msg[] =  {0x41, 0x88, 0, 0x0, 0xDE, 'V', 'E', 'W', 'A', 0x10, 0x02, 0, 0, 0, 0};
static uint8 rx_final_msg[] = {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0x23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static uint8 distance_msg[] = {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0xAA, 0, 0,0, 0, 0};
static uint8 tx_poll_msg[] =  {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0x21, 0, 0};
static uint8 rx_resp_msg[] =  {0x41, 0x88, 0, 0x0, 0xDE, 'V', 'E', 'W', 'A', 0x10, 0x02, 0, 0, 0, 0};
static uint8 tx_final_msg[] = {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0x23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static uint8 angle_msg[] =    {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0xFE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static uint8 Semaphore_Release[] =    {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0xE0, 0, 0, 0};
static uint8 Tag_Statistics[] =                      {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0xE1, 0, 0, 0};
static uint8 Master_Release_Semaphore[] =            {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0xE2, 0, 0, 0};
static uint8 Tag_Statistics_response[] =             {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0xE3, 0, 0, 0};
static uint8 Master_Release_Semaphore_comfirm[] =    {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0xE4, 0, 0, 0};

以上是定位源码中定义的一些消息

下面是源码中的一些解释
* 2. The messages here are similar to those used in the DecaRanging ARM application (shipped with EVK1000 kit). They comply with the IEEE
*    802.15.4 standard MAC data frame encoding and they are following the ISO/IEC:24730-62:2013 standard. The messages used are:
*     - a poll message sent by the initiator to trigger the ranging exchange.
*     - a response message sent by the responder allowing the initiator to go on with the process
*     - a final message sent by the initiator to complete the exchange and provide all information needed by the responder to compute the
*       time-of-flight (distance) estimate.
*    The first 10 bytes of those frame are common and are composed of the following fields:
*     - byte 0/1: frame control (0x8841 to indicate a data frame using 16-bit addressing).
*     - byte 2: sequence number, incremented for each new frame.
*     - byte 3/4: PAN ID (0xDECA).
*     - byte 5/6: destination address, see NOTE 3 below.
*     - byte 7/8: source address, see NOTE 3 below.
*     - byte 9: function code (specific values to indicate which message it is in the ranging process).
*    The remaining bytes are specific to each message as follows:
*    Poll message:
*     - no more data
*    Response message:
*     - byte 10: activity code (0x02 to tell the initiator to go on with the ranging exchange).
*     - byte 11/12: activity parameter, not used for activity code 0x02.
*    Final message:
*     - byte 10 -> 13: poll message transmission timestamp.
*     - byte 14 -> 17: response message reception timestamp.
*     - byte 18 -> 21: final message transmission timestamp.
*    All messages end with a 2-byte checksum automatically set by DW1000.
第0/1字节是模块的地址,这个是不能变的
第2个字节 上面的解释是序列号,每一帧增加,但是我看源码中把他做为基站的地址或者标签的地址。
第三个字节是PANID,这个不明白0xDECA是什么?源码也是没有按照这个发送,好像也是占用第三个字节存放什么信息
5,6,7,8的这个字符是自定义的吗?只要源地址,目的地址配对即可是吗?
最重要的是第9字节,上面解释是功能码,这个功能码也是自定义的吧
我看手册上的功能码和源码的也不一样
QQ截图20190430082341.jpg
最后就是  static uint8 rx_poll_msg[] =  {0x41, 0x88, 0, 0x0, 0xDE, 'W', 'A', 'V', 'E', 0x21, 0, 0}; 这个消息里最后2个字节是什么含义?

回复

使用道具 举报

73

主题

249

帖子

6725

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
6725
发表于 2019-4-30 09:53:23 | 显示全部楼层
rx_poll_msg 这些信息都是约定的,收发约定好,两者一致即可。

与你后面发的没有直接关系,你发的都是官方的标准

我们代码中不是严格按照它的代码标准格式定义信息的
回复

使用道具 举报

0

主题

9

帖子

9

积分

新手上路

Rank: 1

积分
9
发表于 2020-3-9 16:11:05 | 显示全部楼层
上面定义的那些是标准的MAC层数据格式
回复

使用道具 举报

0

主题

9

帖子

9

积分

新手上路

Rank: 1

积分
9
发表于 2020-3-9 16:12:14 | 显示全部楼层
看下IEEE802.15.4MAC层介绍就明白了
回复

使用道具 举报

1

主题

6

帖子

10

积分

新手上路

Rank: 1

积分
10
发表于 2020-6-5 10:23:24 | 显示全部楼层
tuzhuke 发表于 2019-4-30 09:53
rx_poll_msg 这些信息都是约定的,收发约定好,两者一致即可。

与你后面发的没有直接关系,你发的都是官 ...

锚与标签一对一的时候正常通信,两个锚和一个标签的时候也是收发一致就可以吗,我看例程里是通过判断接收的数据部分与rx_resp_msg数组的前ALL_MSG_SN_IDX个字节(8bits)。
我在实现两个锚和一个标签时,利用例程修改后,希望使标签只与其中一个锚通信,但从串口上看都无法正常显示距离。
/***标签**/
static uint8 tx_poll_msg[] = { 0x41,  0x88, 0, 0xFF, 0xFF, 'S', '1', 'M', 'T', 0xE0, 0, 0};//标签发送的消息
static uint8 rx_resp_msg[] ={0x41, 0x88, 0, 0xCA, 0xDE, 'M', 'T', 'S', '1', 0xE1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};//锚发送消息
/**锚1**/
static uint8 rx_poll_msg[] = {0x41,  0x88, 0, 0xFF, 0xFF, 'S', '1', 'M', 'T', 0xE0, 0, 0};//标签发送的消息
static uint8 tx_resp_msg[] = {0x41, 0x88, 0, 0xCA, 0xDE, 'M', 'T', 'S', '1', 0xE1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};//锚发送的消息
/**锚2**/
static uint8 rx_poll_msg[] = {0x41,  0x88, 0, 0xFF, 0xFF, 'S', '2', 'M', 'T', 0xE0, 0, 0};//标签发送的消息
static uint8 tx_resp_msg[] = {0x41, 0x88, 0, 0xCA, 0xDE, 'M', 'T', 'S', '2', 0xE1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};//锚发送的消息
我对接发的消息还存在疑惑,可以麻烦解答下吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

bphero Inc.  

GMT+8, 2024-3-28 19:57 , Processed in 0.015652 second(s), 6 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

快速回复 返回顶部 返回列表