Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Contiki 的 MAC 层执行信道感知所需的函数调用或指令集是什么?
我想测试自定义 MAC 协议,例如在 CSMA 中,需要在传输之前进行信道感应。
我已经浏览了“contiki/core/net/mac/csma.c”,看看他们是如何进行通道感应的。但我只能看到队列数据包的调度和状态检查。
他们如何在传输前检查通道是否繁忙?
你可以这样做:
if(NETSTACK_RADIO().channel_clear()) { printf("channel not busy\n"); } else { printf("channel busy\n"); }
频道检查在无线电驱动程序中实现。Contiki 具有独立于平台的无线电 API。实际的、特定于平台的驱动程序可通过NETSTACK_RADIOAPI 获得,如上所示。该检查用于 RDC(无线电占空比)层,例如 ContikiMAC。
NETSTACK_RADIO