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?
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