This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Sniffer API Capability

Hello,

Are there any documentation on the python API for the sniffer? e.g. Definition of parameters? For device list from scan, the output may look like:

BLE device """" ([49, 31, 240, 111, 40, 239, True])
BLE device """" ([112, 86, 129, 237, 169, 69, False])
BLE device """" ([28, 224, 102, 255, 187, 167, True])
BLE device """" ([87, 187, 111, 173, 137, 251, True])
BLE device """" ([114, 107, 71, 136, 213, 125, True])

And for a connection, the packet output could look like:

inConnection False
currentConnectRequest None
packetsInLastConnection None
nPackets 0
[UART packet, type: 6, PC: 2898, UART packet, type: 6, PC: 2899, UART packet, type: 6, PC: 2900, UART packet, type: 6, PC: 2901]

inConnection False
currentConnectRequest None
packetsInLastConnection None
nPackets 0
[UART packet, type: 6, PC: 3010, UART packet, type: 6, PC: 3011, UART packet, type: 6, PC: 3012, UART packet, type: 6, PC: 3013, UART packet, type: 6, PC: 3014, UART packet, type: 6, PC: 3015, UART packet, type: 6, PC: 3016, UART packet, type: 6, PC: 3017, UART packet, type: 6, PC: 3018, UART packet, type: 6, PC: 3019, UART packet, type: 6, PC: 3020, UART packet, type: 6, PC: 3021, UART packet, type: 6, PC: 3022, UART packet, type: 6, PC: 3023, UART packet, type: 6, PC: 3024, UART packet, type: 6, PC: 3025, UART packet, type: 6, PC: 3026, UART packet, type: 6, PC: 3027, UART packet, type: 6, PC: 3028, UART packet, type: 6, PC: 3029, UART packet, type: 6, PC: 3030, UART packet, type: 6, PC: 3031, UART packet, type: 6, PC: 3032, UART packet, type: 6, PC: 3033, UART packet, type: 6, PC: 3034, UART packet, type: 6, PC: 3035, UART packet, type: 6, PC: 3036, UART packet, type: 6, PC: 3037, UART packet, type: 6, PC: 3038, UART packet, type: 6, PC: 3039, UART packet, type: 6, PC: 3040, UART packet, type: 6, PC: 3041, UART packet, type: 6, PC: 3042, UART packet, type: 6, PC: 3043, UART packet, type: 6, PC: 3044, UART packet, type: 6, PC: 3045, UART packet, type: 6, PC: 3046, UART packet, type:

It is great to have an API in python, though it seems primitive compare to the wireshark plugin, are there ways to exam the packets and devices in more detail through the API?  In general are we the developers encouraged to use the API or the wireshark which at a first glance seems to have more comprehensive implementation.  Thanks much.

Parents
  • The nRF sniffer for Bluetooth LE wireshark external capture (nrf_sniffer_ble.py)
    uses the Python API to send all data to Wireshark through the external capture (extcap) interface.
    So anything wireshark is able to do, you should be able to do with the Python API.
    However using wireshark would of course be much easier, since all of the analysis is implemented there.

    We don't unfortunately have much of documentation for the python API. I suggest to use nrf_sniffer_ble.py as your best example on how to use the python API.
    Further description on how the packet could be analysed you could have a look here:
    https://github.com/wireshark/wireshark/blob/master-3.2/epan/dissectors/packet-nordic_ble.c#L13-L131
    Also in the release zip under the doc folder there is sniffer_uart_protocol.xlsx describing this protocol format in full.

    Any feedback, suggestion for improvements, or actual changes to the python code would be very welcome.

Reply
  • The nRF sniffer for Bluetooth LE wireshark external capture (nrf_sniffer_ble.py)
    uses the Python API to send all data to Wireshark through the external capture (extcap) interface.
    So anything wireshark is able to do, you should be able to do with the Python API.
    However using wireshark would of course be much easier, since all of the analysis is implemented there.

    We don't unfortunately have much of documentation for the python API. I suggest to use nrf_sniffer_ble.py as your best example on how to use the python API.
    Further description on how the packet could be analysed you could have a look here:
    https://github.com/wireshark/wireshark/blob/master-3.2/epan/dissectors/packet-nordic_ble.c#L13-L131
    Also in the release zip under the doc folder there is sniffer_uart_protocol.xlsx describing this protocol format in full.

    Any feedback, suggestion for improvements, or actual changes to the python code would be very welcome.

Children
Related