ZigBee End device connector

This module provides the whad.zigbee.connector.enddevice.EndDevice connector that allows the creation of a ZigBee end device.

This connector is able to discover networks and based on a discovered network to join it (if permitted) and act as an End Device in this network.

class whad.zigbee.connector.enddevice.EndDevice(device: WhadDevice, applications: List[ApplicationObject] = None)[source]

Zigbee End Device interface for compatible WHAD device.

discover_networks() List[ZigbeeNetwork][source]

Discover ZigBee networks.

Returns:

list of discovered ZigBee networks

Return type:

list

enable_reception()[source]

Enable reception mode on the currently selected channel (enable device mode).

get_channel() int[source]

Retrieve the currently selected channel.

Returns:

current ZigBee channel number

Return type:

int

get_channel_page() int[source]

Retrieve the current channel page

Returns:

current channel page value

Return type:

int

on_ed_sample(timestamp: int, sample: int)[source]

Process receive energy detection sample.

Parameters:
  • timestamp (int) – timestamp in microseconds

  • sample (int) – sample measured

on_pdu(packet: Packet)[source]

ZigBee received PDU handler.

Parameters:

packet (scapy.packet.Packet) – received packet (PDU)

perform_ed_scan(channel: int = 11) bool[source]

Perform an energy detection scan on the specified channel.

Parameters:

channel (int) – channel on which the detection will be performed

Returns:

True on success, False otherwise.

Return type:

bool

send(pdu: Packet | bytes, channel: int = None)[source]

Send a PDU to the associated network, if any.

Parameters:
  • pdu (bytes) – pdu to send

  • channel (int, optional) – channel on which to send the pdu

set_channel(channel: int = 11)[source]

Set ZigBee channel to use for the end device.

Parameters:

channel (int) – channel to use

set_channel_page(page: int = 0)[source]

Set ZigBee channel page for the end device

Parameters:

page (int) – channel page to use

property stack

Current ZigBee stack