ZigBee Coordinator connector

This module provides the whad.zigbee.connector.coordinator.Coordinator connector that allows creating a ZigBee coordinator tied to a WHAD device.

This coordinator creates its own network and accept end devices to join it. It manages the join process and share the required encryption keys.

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

Zigbee Coordinator interface for compatible WHAD device.

enable_reception()[source]

Enable coordinator mode on current channel.

get_channel() int[source]

Retrieve current channel number.

Returns:

current channel number

Return type:

int

get_channel_page() int[source]

Retrieve the current channel page value

Returns:

current channel page value

Return type:

int

network_formation(pan_id: int = None, channel: int = None)[source]

Form ZigBee network

Parameters:
  • pan_id (int, optional) – short PAN ID (16 bits)

  • channel (int, optional) – channel number used by the network

Returns:

ZigBee network information

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

Process energy detection sample.

Parameters:
  • timestamp (int) – timestamp at which the energy detection sample has been measured

  • sample (int) – energy detection sample

on_pdu(packet)[source]

PDU handler.

perform_ed_scan(channel: int = 11)[source]

Perform an energy detection scan on channel.

Parameters:

channel (int) – channel on which energy detection scan has to be performed

send(pdu: Packet, channel: int = 11) bool[source]

Send pdu to network.

Parameters:

pdu (scapy.packet.Packet) – pdu to send

Returns:

True on success, False otherwise

Return type:

bool

set_channel(channel: int = 11)[source]

Set current channel to channel.

Parameters:

channel (int) – new channel number to use

set_channel_page(page: int = 0)[source]

Set channel page.

Parameters:

page (int) – channel page to use

property stack: Dot15d4Stack

Current ZigBee stack

start_network(channel: int = 23, ext_pan_id: int = 6941728179072996580, network_key: bytes = None) ZigbeeNetwork[source]

Start ZigBee network: initialize the extended PAN ID for APS, set channel and define a default network key.

Parameters:
  • channel (int, optional) – channel to use for this network (default: 23)

  • ext_pan_id (int, optional) – extended PAN ID (64 bits) value to use for this network

  • network_key (bytes, optional) – network encryption key to use for this network

Returns:

ZigBee network object on success, None on failure