Primary Receiver (PRX) connector

This module provides a :whad.esb.connector.prx.PRX connector that implements Nordic Semiconductor’s Primary Receiver role.

The primary receiver (PRX) role consists in receiving packets from other devices and sending acknowledgements if required to the sending device. When a device is in PRX mode, it is only capable of receiving ESB packets on a specific channel, including ESB pings.

The whad.esb.connector.prx.PRX class relies on a custom protocol stack to handle acknowledgements and pings automatically.

class whad.esb.connector.prx.PRX(device)[source]

Enhanced ShockBurst Primary Receiver Role (PRX) implementation for compatible WHAD device.

property address: str

Return current address

Returns:

ESB address

Return type:

str

property channel: int

Return current channel.

Returns:

current channel number

Return type:

int

on_pdu(packet: Packet)[source]

ESB packet reception callback

Parameters:

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

prepare_acknowledgment(ack: bytes)[source]

Prepare and send acknowledgement packet

Parameters:

ack (bytes) – Acknowledgement packet to prepare

property stack: ESBStack

Return current ESB stack instance.

Returns:

Current ESB stack instance

Return type:

whad.esb.stack.ESBStack

start()[source]

Start PRX mode.

stop()[source]

Stop PRX mode.

stream() Generator[Packet, None, None][source]

Stream received ESB packets