# Creating and sending 0x11 packets in API mode using C (CW SDK)

**URL:** <https://forums.digi.com/t/creating-and-sending-0x11-packets-in-api-mode-using-c-cw-sdk/22143>\
**Category:** XBee - DigiMesh\
**Tags:** sdk, codewarrior, xbee-pro-s3b, xbee-pro-900hp, digimesh\
**Created:** [January 19, 2021, 9:51pm UTC](https://forums.digi.com/t/creating-and-sending-0x11-packets-in-api-mode-using-c-cw-sdk/22143 "2021-01-19T21:51:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![D2K](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@D2K](https://forums.digi.com/u/D2K)\
**Post date:** [January 19, 2021, 9:51pm UTC](https://forums.digi.com/t/creating-and-sending-0x11-packets-in-api-mode-using-c-cw-sdk/22143/1 "2021-01-19T21:51:53Z")

</div>

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  
function directly.  
\*/

int \_xbee\_endpoint\_send( const wpan\_envelope\_t FAR \*envelope, uint16\_t flags)  
{  
xbee\_dev\_t \*xbee;  
xbee\_header\_transmit\_explicit\_t header;  
int error;

```
// note that wpan_envelope_send() verifies that envelope is not NULL

xbee = (xbee_dev_t *) envelope-&gt;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].

Thanks
