'Send and receive Bluetooth Low Energy (BLE) raw packets on Linux

Is there an easy way to send and receive BLE raw packets on Linux, e.g. Raspberry Pi devices? Very simply, I would like to use BLE as packet radio, i.e. exchange data packets over the air among several devices. Every device knows the MAC address of all other devices. The BLE packet format is very straightforward. I would think one should be able to put user data into the PDU (2~257 bytes) then push it through a socket to be sent out through the BLE PHY, just like how one can send raw UDP packets through a NIC. But I cannot figure out a straightforward way to achieve this after quite a bit of investigation. I suppose hcitool cmd could send packets if used correctly? But its usage is very cryptic.



Solution 1:[1]

The node client/server functions here do exactly this: exchange raw packets via BLE over a network of Pis. See section 3.7 in the documentation for NODE connections.

https://github.com/petzval/btferret

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1