Import
Methods
Net.get(name, type=NetType.BleSniffer)
capture(duration=10.0, follow=None, address_type=None, follow_by_name=None, only_advertising=False, coded=False, rssi_cut_off=None, out=None)
An attached
lager python run ends at 300 s, start-up included, so keep an attached capture under about 280 s and run longer ones detached. The pcap is first written to <out>.part and renamed to out when the capture ends. A capture that fails at the start leaves an existing out unchanged.
Returns: a dict with these keys:
Raises:
ValueError: an option has the wrong type or is out of range, or two options conflict. The sniffer is not touched.BleSnifferBusyError(fromlager.protocols.ble_sniffer): another capture holds the sniffer.BleSnifferBackendError(fromlager.exceptions): the capture failed. The sniffer is not on USB, another program holds its port, or it did not answer within 2 s. Unplug and replug a sniffer that does not answer. When it stops answering mid-capture, the packets recorded before that stay inout, and the message gives their number.
lager python, the default file is in the run’s output folder, so --download brings it back to your computer.
status()
Returns a dict with serial, port (None when the sniffer is not on USB), present and busy. It does not open the sniffer.
Example
lager python sniff.py --detach.
Notes
- The pcap link type is
NORDIC_BLE(272). Wireshark andtsharkdecode it. - See the CLI reference to flash the dongle and add the net.

