TI中文支持网
TI专业的中文技术问题搜集分享网站

求助,关于数据发送的时序控制

我现在做串口透传,想实现如下功能:

1,zigbee发出去消息,如果收到response,继续发送下一条数据。

2,如果没有接受到response,丢掉当前数据,发送下一条。

现在第一点比较容易实现,可是如何判断第二条?如果协议栈发出去的数据没有回应会产生什么事件吗?

我先现在在应用层做了个200ms的超时,如果200ms内没有接受到response,就直接转发下一条,但是总觉得协议栈应该会产生事件通知才对。

Yue TANG:

MAC层ACK,还是应用层的ACK(AF_DATA_CONFIRM_CMD)

都有ACK 事件。参看develop guide的第八章

8.End-to-end acknowledgements

For non-broadcast messages, there are basically 2 types of message retry: end-to-end acknowledgement (APSACK) and single-hop acknowledgement (MAC ACK). MAC ACKs are always on by default and are usuallysufficient to guarantee a high degree of reliability in the network. To provide additional reliability, as well as toenable the sending device get confirmation that a packet has been delivered to its destination, APSacknowledgements may be used.

APS acknowledgement is done at the APS layer and is an acknowledgement system from the destination device tothe source device. The sending device will hold the message until the destination device sends an APS ACKmessage indicating that it received the message. This feature can be enabled/disabled for each message sent with theoptions field of the call to AF_DataRequest(). The options field is a bit map of options, so OR inAF_ACK_REQUEST to enable APS ACK for the message that you are sending. The number of times that themessage is retried (if APS ACK message isn’t received) and the timeout between retries are configuration items inf8wConfig.cfg. APSC_MAX_FRAME_RETRIES is the number of retries the APS layer will send themessage if it doesn’t receive an APS ACK before giving up. APSC_ACK_WAIT_DURATION_POLLED is the timebetween retries.

colin luan:

回复 Yue TANG:

APS层有retry跟pool参数,那MAC层的ACK有类似的参数吗?

APSC_MAX_FRAME_RETRIES 

APSC_ACK_WAIT_DURATION_POLLED

Yue TANG:

回复 colin luan:

也有。但建议使用默认的。不要修改。

比如 MAC_MAX_FRAME_RETRIES

赞(0)
未经允许不得转载:TI中文支持网 » 求助,关于数据发送的时序控制
分享到: 更多 (0)