Haraltd is a Bluetooth daemon that provides a JSON-based RPC over the native OS's Bluetooth stack. It currently only supports Bluetooth Classic, and runs on Windows and MacOS. Installation instructions are in the README.
It was created to reduce the pain points of dealing with the various Bluetooth stacks present in different operating systems, and to present a simpler API to handle Bluetooth (classic) based operations. It is intended for Bluetooth managers and possibly can be used for scripting purposes.
See bluetuith for an application that interacts with Haraltd.
The RPC specification is published here.
A table of the daemon's features is posted here, but to summarise:
-
Adapter/device management
-
Automatic/manual profile-based connection
-
Pairing with authentication
-
OBEX profiles (currently only Object Push, but more OBEX profiles will be added later)
-
Notifications for various Bluetooth events
-
JSON-based RPC over a Unix socket
This was tested only with a sum total of 3 devices (2 Android phones and 1 Bluetooth earphones), so any feedback is appreciated, especially from users who can test with other kinds of Bluetooth classic devices.
Note: No AI was used to manage the codebase or generate code.
Hi Dran,
The motivation was purely because of a lack of proper control for Bluetooth on these closed-source OSes like Windows and macOS.
This is for users who want to control Bluetooth within the terminal, seamlessly.
For Windows, I have yet to see any CLI/TUI tools that do this. There were a set of old command-line tools which I downloaded and tried a long time ago, but it didn't work properly for me, I do not know about others.
On macOS, blueutil exists, which is a very old project (but constantly updated) and one which I hold in high regard, but again, it is a CLI.
What bluetuith can do, among other things, is monitor Bluetooth states across all adapters, devices and operations (like connection, pairing, discovery, file transfers) etc. and present it neatly (I think ๐) within the terminal itself, basically trying to replicate the same experience on Linux.
Basically the point is, you don't need the Bluetooth GUIs anymore on these platforms when you can control Bluetooth right from the terminal with a few keystrokes.