Here is a Bluetooth interface that can connect simultaneously to multiple Classic and LE servers, and also to a mesh network of other Pis running the same software.
There is a library of functions and a program (btferret) that implements most of the interface features such as connecting to other devices, operating as a client or server, exchanging data (including a file transfer routine) and display of information - it is a bit like a super bluetoothctl that won't drive you mad. It has a verbose print mode that displays the HCI Bluetooth traffic with details of the packets that are exchanged. Also included is the code for a simple mesh network procedure.
The documentation has a reference section with a detailed description of the HCI Bluetooth interface, the packet formats and how they are constructed, and the sequence of instructions needed to establish connections and exchange data. This information is difficult to extract in a coherent form from the Bluetooth specification documents. There is also a brief guide to writing server code for other machines.
This interface is programmed at the HCI level and bypasses higher-level bluez functions, so it does not use the Pi's Bluetooth service, which can be stopped. It will connect to Windows/Android/HC-05 devices when bluez often has problems.
3 posts • Page 1 of 1