... | ... | @@ -162,6 +162,7 @@ Scanning for nearby peers is a key component of the Bluetooth Low Energy protoco |
|
|
Bluetooth Low Energy offers two different ways of actually connecting and sharing data between devices, the previously mentioned GATT service can be used to broadcast resources that centrals can connect, and read and write to. BLE also offers L2CAP, or "logical link control and adaptation protocol". L2CAP offers a "connection oriented channel" approach that is much closer to traditional socket programming than the GATT protocol. This makes programming larger data transfers with L2CAP much easier, however API support for L2CAP on android devices is worse compared to GATT, so our general thinking is to attempt to create links between devices using L2CAP, but fall back to using GATT in case devices in the handshake do not support L2CAP.
|
|
|
|
|
|
##### GATT
|
|
|
|
|
|
Like most other BLE functionalities, BLESSED allows us to easily connect to a given `BluetoothPeripheral` object by using the `centralManager.connectPeripheral()` method. For the full implementation of peer connections on the `blessed` branch: <https://code.briarproject.org/briar/public-mesh-testbed/-/blob/blessed-gatt/app/src/main/java/org/briarproject/publicmesh/bt/BtServiceImpl.java#L320>
|
|
|
|
|
|
##### L2CAP
|
... | ... | @@ -255,6 +256,27 @@ TODO find code snippets from blechat impl |
|
|
|
|
|
While the library has methods built to enable auto-peering, our attempt to enable auto-peering with this framework proved unsuccessful.
|
|
|
|
|
|
### Bluetooth Mesh
|
|
|
|
|
|
Bluetooth Mesh is a relatively new Bluetooth standard that supports multi-hop communication among a set of devices, encrypted with a shared network key. Mesh devices can optionally act as relays, or as "friends" for power-constrained devices, storing messages on their behalf for later collection.
|
|
|
|
|
|
* https://www.bluetooth.com/wp-content/uploads/2019/03/Mesh-Technology-Overview.pdf
|
|
|
* https://www.bluetooth.com/bluetooth-resources/controlling-bluetooth-mesh-networks-with-android-applications/
|
|
|
|
|
|
The mesh stack shares some lower layers with the Bluetooth LE stack in smartphones, but it also has some higher layers that aren't implemented in smartphones. So when a phone interacts with a mesh, it does so via a device called a proxy that implements both stacks. As far as we were able to tell, a mesh can't be formed from just smartphones.
|
|
|
|
|
|
There are several projects that implement the higher layers of the mesh stack in software, on Linux at least:
|
|
|
|
|
|
* https://github.com/AndrewGi/BluetoothMeshRust
|
|
|
* https://blog.drogue.io/bluetooth-mesh/
|
|
|
* https://github.com/mfiumara/ble-mesh
|
|
|
|
|
|
The existence of these projects suggests that the higher mesh layers can be implemented in software if the platform allows access to the lower layers that are common to the mesh and non-mesh stacks. So it may be possible that in future, Android or iOS might either allow that kind of low-level access, or more likely provide their own software implementation of the higher layers of the mesh stack.
|
|
|
|
|
|
However, given the use cases that are described in the Bluetooth Mesh docs (eg smart lightbulbs), it's not clear if it would provide much value to typical smartphone users if the phone was able to act as a full mesh node, rather than being used for provisioning and control of mesh nodes via a proxy, as is currently the case. So there isn't an obvious reason for Google/Apple to add a mesh stack to a smartphone OS in future, even if it's technically possible.
|
|
|
|
|
|
In short, Bluetooth Mesh doesn't appear to be usable for creating smartphone-based mesh networks at present, and seems unlikely to become usable for that purpose in future.
|
|
|
|
|
|
## Wi-Fi
|
|
|
|
|
|
### Network Service Discovery (NSD)
|
... | ... | |