我有一个IoT应用程序,要求我发送802.15.4数据包,而无需任何更高的级别协议。我们在本机C中实现了一个小的数据包规范,因此我需要的只是将有效载荷添加到数据包中并通过无线电发送(永远不会有数据包分割)。我们当前的硬件对无线电接口进行非常低的控制,并(部分)为此目的实现了802.15.4,但是我试图使用Zephyr在NRF5340DK上展示相同的功能。
查看Zephyr文档,我只看到支持通过BSD插座发送或使用卸载驱动程序绕过L2并直接与收音机交谈。如果驱动程序中已经存在,我宁愿不要实现整个L2规格。
我的应用程序是否有任何方法可以更直接控制L2数据包?
I have an IoT application that requires me to send 802.15.4 packets without any higher level protocols. We have a small packet specification implemented in native C so all I need is to add a payload to a packet and send it over the radio (there will never be packet splitting). Our current hardware takes very low level control over the radio interface and (partially) implements 802.15.4 for this purpose, but I am trying to showcase the same functionality on a nRF5340DK using Zephyr.
Looking at the the Zephyr docs I only see support for sending over a BSD Socket or using an offload driver to bypass L2 and talk directly to the radio. I'd rather not implement the whole L2 spec if it already exists in the drivers.
Is there any way for my application to have more direct control of the L2 packets?
发布评论
评论(1)
由于这个问题被问到Zephyr有所改变。版本3.2.0从IP堆栈中脱钩802.15.4,允许我想要的东西。有一个测试在
tests/net/ieee802154/l2/src/ieee802154_test.c
上显示此功能,我将其改编为 https://github.com/dberliner/zephyr_raw_802154 (该测试使IP堆栈涉及的IP堆栈所涉及的,这在这里不可避免)。Zephyr 3.2.0之前的正确答案:
这个问题的简单答案是“否”。 L2 802.15.4实现为6 lowpan,因此与IPv6绑定。北欧开发人员建议我,他们的Zigbee实施采用类似的方法,但我需要为我的目的重新发明轮子https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/zigbee/osif/zb_nrf_transceiver.c
Since this question was asked Zephyr has changed a little. Version 3.2.0 decoupled 802.15.4 from the IP stack allowing exactly what I wanted. There's a test showing this functionality on
tests/net/ieee802154/l2/src/ieee802154_test.c
and I adapted that into an example at https://github.com/dberliner/zephyr_raw_802154 (the test keeps the IP stack involved which isn't desirable here).The correct answer prior to Zephyr 3.2.0:
The simple answer to this question is "no." The L2 802.15.4 implementation is 6LoWPAN so it's tied to IPv6. A Nordic developer advised me that their Zigbee implementation takes a similar approach to what I would need but I'd need to reinvent the wheel for my purposes https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/zigbee/osif/zb_nrf_transceiver.c