0

我想编写一个微尘无线电通信程序,并希望接收方向发送方确认。我知道这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
4

1 回答 1

1
  1. 不。
  2. 不。
  3. 在从 interface或调用之前,您需要调用requestAck即将发送的数据包。一定要检查返回的错误代码,因为表明通信层不支持同步确认(这取决于您使用的无线电芯片和驱动程序)。一旦数据包被发送,即内部事件(或稍后), call ,如果数据包被接收者确认,则返回true。sendAMSendSendrequestAckFAILsendDonewasAcked

更多信息: https ://github.com/tinyos/tinyos-main/blob/master/tos/interfaces/PacketAcknowledgements.nc

于 2016-09-04T17:54:11.877 回答