Skip to content

# API Overview

blueSPY includes an extensive API, available as a C library with a Python wrapper. The API allows starting/stopping/controlling capture, and allows detailed inspection of both ongoing captures and of pre-existing capture files. The library can be run without the GUI (including on systems with no GUI support); you also have the option to spawn an instance of the GUI to look at an ongoing capture started from the API.

The basic mechanism for inspecting the contents of a capture at a low level is (described using the C functions found in `bluespy.h`, the Python wrapper has exactly the same functionality with a slightly different naming convention):

1. Use `bluespy_get_baseband(...)` to get a `bluespy_event_id` for a particular packet in the capture.

2. Use `bluespy_query_get(...)` to discover the properties of the `bluespy_event_id`, e.g. its channel, its RSSI, its payload, its sender and receiver... For a full list of the possible properties, see Queries.

To inspect the capture at a higher level, you can use the relevant API functions to get IDs for each device, connection, or audio-stream in the capture. These can similarly be queried to discover their properties, although the set of relevant queries is different.

As well as inspecting the contents of the capture, there are functions which allow you to add data to the capture. `bluespy_add_log_message(...)` can be used to insert timestamped custom log messages into the pcapng file, and `bluespy_add_link_key(...)` or `bluespy_add_IRK(...)` can be used to provide relevant keys for decryption and for identifying device addresses.

For the full details of the API, see C API or Python API