51uwb.cn
标题:
基站发送数据给标签
[打印本页]
作者:
Ma1011_11
时间:
2022-8-8 22:35
标题:
基站发送数据给标签
我在基站发送数据给标签的时候会把基站卡死,基站的dwm1000的Rx Tx灯都不再亮灭,标签可以接受数据。请问如何可以不卡死基站?立即发送改成延迟发送会有效果吗?附上基站发给标签的代码
作者:
Ma1011_11
时间:
2022-8-8 22:35
static void Send_Order_To_TAG(int ID,int O1,int O2)
{
msg_f_send.destAddr[0] =(ID) &0xFF;
msg_f_send.destAddr[1] = ((ID)>>8) &0xFF;
msg_f_send.seqNum = distance_seqnum;
msg_f_send.messageData[0]='O';
{
uint8 len = 0;
uint8 LOCATION_INFO_START_IDX = 1;
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = O1;//order1
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = O2;//order2
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order3
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order4
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order5
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order6
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order7
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order8
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order9
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order10
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order11
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order12
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order13
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = 0xFF;//order14
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = '\n';
msg_f_send.messageData[LOCATION_INFO_START_IDX + (len++)] = '\r';
}
dwt_writetxdata(11 + 17,(uint8 *)&msg_f_send, 0) ; // write the frame data
dwt_writetxfctrl(11 + 17, 0);
dwt_starttx(DWT_START_TX_IMMEDIATE);//DWT_START_TX_DELAYED,DWT_START_TX_IMMEDIATE
while (!(dwt_read32bitreg(SYS_STATUS_ID) & SYS_STATUS_TXFRS))
{ };
dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_TXFRS);//清除发送完成标志
}
作者:
Ma1011_11
时间:
2022-8-10 10:53
现在可以不卡了,但是如果多标签,分发的时候还是容易出现乱码,估计是串扰的问题
欢迎光临 51uwb.cn (http://51uwb.cn/)
Powered by Discuz! X3.3