51uwb.cn

 找回密码
 立即注册
查看: 618|回复: 1
打印 上一主题 下一主题

bp50中哪里是标签发给基站的数据

[复制链接]

1

主题

1

帖子

7

积分

新手上路

Rank: 1

积分
7
跳转到指定楼层
楼主
发表于 2024-3-21 16:20:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请问bp50的代码中关于基站的部分,哪一部分存的是标签发给基站的数据呢?
回复

使用道具 举报

35

主题

1053

帖子

4531

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
4531
沙发
发表于 2024-3-24 21:22:55 | 只看该作者
定位结果最终通过如下代码段发送给基站,如果是中间通信过程,请仔细阅读固件代码
  1.     //location
  2.     {
  3.         uint8 len = 0;
  4.         angle_msg[LOCATION_FLAG_IDX] = 1;

  5.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = 'm';
  6.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = 'r';

  7.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = 0x02;
  8.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = TAG_ID;//TAG ID

  9.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = (uint8)(framenum&0xFF);
  10.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = (uint8)((framenum>>8)&0xFF);

  11.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = (uint8)((distance1/10)&0xFF);
  12.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = (uint8)((distance1/10 >>8)&0xFF);

  13.         angle_msg[LOCATION_INFO_START_IDX + (len++)] =  (uint8)((distance2/10)&0xFF);
  14.         angle_msg[LOCATION_INFO_START_IDX + (len++)] =  (uint8)((distance2/10 >>8)&0xFF);

  15.         angle_msg[LOCATION_INFO_START_IDX + (len++)] =  (uint8)((distance3/10)&0xFF);
  16.         angle_msg[LOCATION_INFO_START_IDX + (len++)] =  (uint8)((distance3/10 >>8)&0xFF);

  17.         if(ANCHOR_MAX_NUM > 3)
  18.         {
  19.             angle_msg[LOCATION_INFO_START_IDX + (len++)] = (uint8)((Anthordistance[3]/10)&0xFF);
  20.             angle_msg[LOCATION_INFO_START_IDX + (len++)] = (uint8)((Anthordistance[3]/10 >>8)&0xFF);
  21.         }
  22.         else
  23.         {
  24.             angle_msg[LOCATION_INFO_START_IDX + (len++)] = (uint8)((distance1/10)&0xFF);
  25.             angle_msg[LOCATION_INFO_START_IDX + (len++)] = (uint8)((distance1/10 >>8)&0xFF);
  26.         }

  27.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = '\n';
  28.         angle_msg[LOCATION_INFO_START_IDX + (len++)] = '\r';


  29.         angle_msg[LOCATION_INFO_LEN_IDX] = len;
  30.         //MAX LEN
  31.         if(LOCATION_INFO_START_IDX + len -2 >ANGLE_MSG_MAX_LEN)
  32.         {
  33.             while(1);
  34.         }
  35.         //USART_puts((char*)angle_msg,len);
  36.     }
  37. #endif
  38.     //only anthor0 recive angle message
  39.     angle_msg[ALL_MSG_SN_IDX] = framenum;
  40.     angle_msg[ALL_MSG_TAG_IDX] = TAG_ID;

  41.     dwt_writetxdata(sizeof(angle_msg), angle_msg, 0);
  42.     dwt_writetxfctrl(sizeof(angle_msg), 0);

  43.     /* Start transmission, indicating that a response is expected so that reception is enabled automatically after the frame is sent and the delay
  44.      * set by dwt_setrxaftertxdelay() has elapsed. */
  45.     dwt_starttx(DWT_START_TX_IMMEDIATE );
  46.     while (!(dwt_read32bitreg(SYS_STATUS_ID) & SYS_STATUS_TXFRS))
  47.     { };
复制代码




回复

使用道具 举报

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

本版积分规则

bphero Inc.  

GMT+8, 2024-11-23 12:05 , Processed in 0.023947 second(s), 5 queries , File On.

Powered by Discuz! X3.3

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

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