Skip to content

Route hops order in create_source_route vs CreateSourceRoutePacket vs XBee User Guide #278

@bennevados

Description

@bennevados

In the documentation for ZigBeeDevice.create_source_route(..):

hops (List): List of intermediate nodes (:class:.RemoteXBeeDevice) ordered from closest to source to closest to destination node (source and destination excluded).

In the documentation for CreateSourceRoutePacket.__init__(..):

hops (List, optional, default=None): List of 16-bit addresses of intermediate hops in the source route (excluding source and destination).

In the documentation for Create Source Route - 0x21 in the XBee User Guide:

The addresses should be entered in reverse order (from destination to source) to match the order provided in Route Record Indicator - 0xA1.

As far as I can tell:

  • In ZigBeeDevice.create_source_route(..), the hops are passed in order to CreateSourceRoutePacket.__init__(..).
  • In CreateSourceRoutePacket, the hops are packed in order into a 0x21 frame.

I have tested this by creating a source route and then sending a request for a DB. When I send with a destination to source order, contrary to the documentation, the packet has a signal strength that corresponds to the last hop as expected. When I send with a source to destination order, the packet has a signal strength that corresponds to the first hop even though the DB would return the signal strength of the last hop suggesting that the request took the reversed path.

Note that in XBeeDevice.__route_record_callback(..), the list is specifically reversed, so that looks OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions