Sniffer connector

This module provides a Sniffer class that derives from ESB to allow Enhanced ShockBurst frame sniffing. Sniffed frames are wrapped in a dedicated Scapy layer and therefore are represented as Scapy packets.

This Sniffer class is used by the generic wsniff utility when Enhanced ShockBurst protocol is selected, and the associated whad.esb.sniffing.SnifferConfiguration class holds all the sniffing parameters that can be set.

By default, the Enhanced ShockBurst sniffer sniffs packet on all channels by looping from channel 0 to 100 over and over and capturing frames that match the expected format.

class whad.esb.connector.sniffer.Sniffer(device: WhadDevice)[source]

Enhanced ShockBurst Sniffer interface for compatible WHAD device.

property channel: int

Channel getter.

property configuration: SnifferConfiguration

Current configuration getter.

sniff(channel: int = None, address: str = None, show_acknowledgements: bool = False, timeout: float = None) Generator[Packet, None, None][source]

Update current sniffing configuration if required and sniff packets. This function returns after timeout seconds, if specified.

Parameters:
  • channel (int) – Channel to listen, None to iterate over all possible channels

  • address (str) – Device address to target

  • show_acknowledgements (bool) – Sniff packets acknowledgements if set to True (default: False)

  • timeout (float) – Number of seconds after which sniffing will stop, uninterrupted if set to None