Source routing: Create and obtain the route of a packet

XBee modules also allow you to create and obtain a source route in the module. A source route specifies the complete route a packet travels to get from source to destination. In this case, before sending the data (a Transmit Request or a Explicit Addressing Command Frame), you must send a a Create Source Route (0x21) with the route of the following packet.

Use source routing with many-to-one routing for best results, so you should set the Many-to-One Route Broadcast Time (AR) parameter to a value other than FF in the sender module.

The following image shows the API exchanges at the serial interface when you are sending a Create Source Route (0x21) frame.

  1. The intelligent device (host) sends a Create Source Route (0x21) to XBee A through the serial input to specify the route of the following data to XBee B.
  2. The intelligent device (host) sends a Transmit Request (0x10) or an Explicit Addressing Command Frame (0x11) to XBee A through the serial input to transmit data to XBee B.
  3. The remote XBee B receives the wireless data and sends out through the serial output a Receive Packet (0x90) or an Explicit Rx Indicator (0x91). This frame contains the data received over the air and the source address of the XBee that transmitted it, in this case XBee A.
  4. The remote XBee B transmit a route record to the sender, XBee A, with the route the transmitted data followed.
  5. The sender XBee A sends out a Route Record Indicator (0xA1) through its serial output with the 16-bit addresses of the nodes the received route record traversed.
  6. The sender XBee A sends out a Transmit Status (0x8B) through its serial output with the status of the transmission to XBee B.