2010年12月23日 星期四

Tinyos 的MAC通訊

TinyOs中有一個容易令人忽略的介面,就是 PacketAcknowledgement。
主要的功能是提供設定的元件來使用者可以開關 彼此兩端的 Ack。
主要的命令有下列三個:
分別是  PacketAcknowledgement.noAck,  PacketAcknowledgement.requestAck,  PacketAcknowledgement.wasAcked.

前面兩個當然就是設定傳送時要不要有Ack回應。以一般的WSN網路設定來說,由於都有Cord來負責網路的建立和設定,自然這個Ack的傳送是必須的。所以
PacketAcknowledgement.requestAck 這個指令倒是就很重要了(設定需要Ack)。

command error_t noAck(message_t *msg) Tell a protocol that when it sends this packet, it should not use synchronous acknowledgments.
command error_t requestAck(message_t *msg) Tell a protocol that when it sends this packet, it should use synchronous acknowledgments.
command bool wasAcked(message_t *msg) Tell a caller whether or not a transmitted packet was acknowledged.

沒有留言:

張貼留言