Maybe I have drawn a complete blank here, but I am having some trouble finding better examples within the SDK example projects on how to actually create specific frames using the C SDK functions, rather than just a payload with my own strings in it, which I’ve generally been doing up until now. Specifically, I am trying to have my Coordinator send a Router node a traceroute packet using the [0x11] Transmit Explicit frame and I would then expect to hear back an 0x8D from the Router via the XBEE_HANDLE_RX event handlers. I am using 0x11 because the notes in xbee_wpan.c advise this:
User code should use wpan_envelope_send() instead of calling this
int _xbee_endpoint_send( const wpan_envelope_t FAR *envelope, uint16_t flags)
// note that wpan_envelope_send() verifies that envelope is not NULL xbee = (xbee_dev_t *) envelope->dev; // Convert envelope to the necessary frame type and call xbee_frame_send header.frame_type = (uint8_t) XBEE_FRAME_TRANSMIT_EXPLICIT;
In xbee_wpan.c, I see that header.frame_type seems to be what I need, but I am unsure of what sequence to call it due to it mentioning not to use it. Does wpan_envelope_send() automatically assign 0x11 to every outbound message? That would be confusing too since I want to set my transmit options to 0x08 [Unicast Trace Route].