bluerestd-kden.mp4
A cross-platform Bluetooth daemon with a OpenAPI-based REST API interface to control Bluetooth Classic functions.
Currently works on Linux and Windows, with FreeBSD and MacOS support coming soon.
A demo for Windows is displayed above.
This project is funded through NGI Zero Core, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
See the feature matrix for a complete list of currently supported features.
- First, install the necessary dependencies for your OS.
- Download the binary from the Releases page, and run it.
Note for Windows: These builds are currently not signed, which means while launching this application, Microsoft SmartScreen warnings may pop up. Press "Run anyway" to run the application. Also, Windows Security (i.e. Antimalware Service Executable) may try to scan the application while it is being launched, which will delay and increase the startup time.
bluerestd provides a set of endpoints to control various Bluetooth classic functions.
Type bluerestd -h for a documentation on available commands.
Type bluerestd openapi -h for a documentation on available OpenAPI commands.
To see the OpenAPI specification of these endpoints, type:
bluerestd openapi
and optionally pipe the output via jq to see the complete list of endpoints and properties supported by the instance.
Type bluerestd launch -h for a documentation on available launch commands.
There are two ways of launching the daemon:
- Using a TCP address, or
- Using a UNIX socket
To launch it using a TCP address, type:
bluerestd launch -a <tcp-address>:<port>
Or, to use the application's default TCP address:port setting to launch the daemon, type:
bluerestd launch -t
For example, using a TCP address of "127.0.0.1:8000", the command would be:
bluerestd launch -a "127.0.0.1:8000"
To launch it using a UNIX socket, type:
bluerestd launch -s "<path/to/socket.sock>"
Or, to use the application's default UNIX socket setting to launch the daemon, type:
bluerestd launch -u
For example, using a UNIX socket of name "/tmp/bd.sock", the command would be:
bluerestd launch -a "/tmp/bd.sock"
If the TCP address is used and being listened on, an interactive API viewer
is present at the /docs endpoint. Access it in a web browser with the address
http://127.0.0.1:8000/docs if bluerestd is listening on "127.0.0.1:8000".
If the UNIX socket path is being listened on, the 'http+unix' protocol is used, and clients can connect using this protocol.
For example, to connect to the socket via 'curl', use:
curl --unix-socket /tmp/bd.sock http://localhost/<endpoint>
Bluerestd isn't really useful for Linux users since Bluez already exists, and usually should be preferred. However, this project can act as documentation on how to interact with the Bluez daemon.
- Huma - For the OpenAPI conforming REST API framework
- Scalar Docs - For the interactive API viewer
- PTerm - For console handling and pretty printing
- urfave/cli/ - Command line parser framework
