Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing support for "Route Information"(0x8D) and "Aggregate Addressing Update"(0x8E) messages #56

Open
davidfarmx opened this issue Aug 14, 2018 · 1 comment

Comments

@davidfarmx
Copy link

The "Route Information"(0x8D) and "Aggregate Addressing Update"(0x8E) messages do not have support in the library. To add them, the following files would need modification:
aft.py (in class ApiFrameType); in factory.py(in function build_frame); in common.py (missing classes); in reader.py(in class PacketListener, and method __execute_user_callbacks); devices.py (in class XbeeDevice)

And there needs to have the methods added (such as):
"add_route_info_received_callback", "del_route_info_received_callback", "add_agr_addr_update_callback", and "del_agr_addr_update_callback".

@tatianaleon
Copy link
Contributor

Hi @davidfarmx,

'Route Information Packet' frame (0x8D) is already added in master (commit e204f21)

Regarding the 'Aggregate Addressing Update' (0x8E) support is not included. To use it you can register a callback to listen for all received packets (add_packet_received_callback()) and inside filter by frame type 0x8E, then work with UnknownXBeePacket class:

def my_packet_received_callback(xbee_packet):
    if xbee_packet.get_frame_type_value() != 0x8E:
        return
    # Ignore first byte: frame type byte (0x8E)
    data = xbee_packet.get_frame_spec_data()[1:]
    # Manipulate the data in the packet
    print("Data: %s" % utils.hex_to_string(data))
    # Byte 0: Ignoring reserved byte
    # Bytes 1 - 9: 64-bit address: Address to which DH and DL are being set
    print("New address: %s" % XBee64BitAddress(data[1:9]))
    # Bytes 9 - 17: 64-bit address: Address to which DH and DL were previously set
    print("Old address: %s" % XBee64BitAddress(data[9:17]))

xbee = XBeeDevice(PORT, BAUD_RATE)
xbee.open()

xbee.add_packet_received_callback(my_packet_received_callback)

[...]

xbee.del_packet_received_callback(my_packet_received_callback)
xbee.close()

Best Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants