TinyOs nesc数据包确认

时间:2016-09-03 12:21:19

标签: communication tinyos nesc

我想写一个mote-mote无线电通信程序,并希望接收方向发送方确认。我知道PacketAcknowledgements是推荐的,但有一些问题我不确定这个界面。

1. If I use it in the sender mote,should i also uses interface Receive in the module of the sender mote
2. Should I write extra code in the receiver mote? Should I use interface PacketAcknowledgements too?
3. command error_t requestAck(message_t *msg) and command bool wasAcked(message_t *msg) should be used when and where

1 个答案:

答案 0 :(得分:1)

  1. 没有
  2. 没有
  3. 在接口requestAcksend拨打AMSend之前,您需要在即将发送的数据包上致电Send。请务必检查requestAck返回的错误代码,因为FAIL表示通信层不支持同步确认(这取决于您使用的无线芯片和驱动程序)。一旦发送了数据包,即在事件sendDone(或更高版本)内,请调用wasAcked,如果接收方确认该数据包,则返回true。
  4. 更多信息: https://github.com/tinyos/tinyos-main/blob/master/tos/interfaces/PacketAcknowledgements.nc