This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending 802.15.4 command frames

I'm using the nRF52840 to interface with an existing 802.15.4 network.  For reasons decided long before I became involved, the messages exchanged are MAC command frames, not MAC data frames.  While the Wireless UART example in the SDK demonstrates how to send data frames, there doesn't seem to be an example of how to send a command frame, nor can I find any mention of the MAC_COMMAND outside of the mac_common.h or mac_security.h header files.

How do I send MAC command frames?

  • Hi.

    At the moment we don't have any examples for sending MAC command frames.

    But I will try to help you.

    First, you have to select one of the MAC services in the 802.15.4 specification.

    In the 2006 specification this is found under chapter 7.1

    In the 2015 specification this is found under chapter 8.2

    When you have selected a service you should find the service in the header files provided with the library, for example if i look for this:

    I would like to use the MLME-ASSOCIATE.request service, then i find the header file for this service called mac_mlme_associate.h in the folder components\802_15_4\api\MAC by searching for MLME-ASSOCIATE in the SDK.

    You should then use that header file according to the specification.

    I hope this helps you.

    Just ask if you want more information :-)

    Best regards,

    Andreas

  • Hi Andreas,

    Thanks for the help - you got me a little bit further.

    The specific command frames I'm trying to send are data requests, so I was able to get those working with the MLME-POLL.request primitive in mac_mlme_poll.h.  However,  I also need to add a command payload.  Is this possible?  I've attached a wireshark screenhot of the message I need to mimic that shows the FCF and payload.

  • Hi again.

    Glad to hear that you got that working.

    I'm not sure that the 802.15.4-2006 specification which the radio driver attached to SDK 15.3 is built upon allows you to add application payload to the MAC command frames.

    The 802.15.4 driver from GitHub is more flexible, as this has some parts from the 802.15.4-2015 specification implemented. You can use that driver to create a MAC comand frame with the help of your Wireshark snippet or the specification.

    Here is an example that transmits a data frame: ttps://github.com/NordicSemiconductor/nRF-IEEE-802.15.4-radio-driver/wiki/Sample-application

    Note that you have to compile this driver yourself and include what you need of source files.

    Here is an example of a build system, note that this is not made or maintained by Nordic.

     Hope this helps you :-)

    Best regards,

    Andreas

Related