device/bluetooth
abstracts
Bluetooth Classic and
Low Energy features
across multiple platforms.
Classic and Low Energy based profiles differ substantially. Platform
implementations may support only one or the other, even though several classes
have interfaces for both, e.g. BluetoothAdapter
& BluetoothDevice
.
Classic | Low Energy | |
---|---|---|
Android | no | yes |
Chrome OS | yes | yes |
Linux | yes | yes |
Mac | yes | yes |
Windows | some | nearly |
Chrome OS and Linux are supported via BlueZ, see *_bluez
files.
Mojo interfaces in public/interfaces have been started but are not ready for production use.
Initial implementation OWNERS were youngki@chromium.org, keybuk@chromium.org, armansito@chromium.org, and rpaquay@chromium.org. They no longer contribute to chromium fulltime. They were responsible for support for Chrome OS Bluetooth features and the Chrome Apps APIs:
Active development in 2015 & 2016 is focused on enabling GATT features for:
- Web Bluetooth
- Peripheral mode for Chrome OS.
Known future work is tracked in the Refactoring meta issue.
The android implementation requires crossing from C++ to Java using JNI.
Object ownership is rooted in the C++ classes, starting with the Adapter, which owns Devices, Services, etc. Java counter parts interface with the Android Bluetooth objects. E.g.
For testing, the Android objects are wrapped in:
android/java/src/org/chromium/device/bluetooth/Wrappers.java
.
and fakes implemented in:
test/android/java/src/org/chromium/device/bluetooth/Fakes.java
.
Thus:
bluetooth_adapter_android.h
owns:android/.../ChromeBluetoothAdapter.java
uses:android/.../Wrappers.java
:BluetoothAdapterWrapper
- Which under test is a
FakeBluetoothAdapter
- Which under test is a
bluetooth_device_android.h
owns:android/.../ChromeBluetoothDevice.java
uses:android/.../Wrappers.java
:BluetoothDeviceWrapper
- Which under test is a
FakeBluetoothDevice
- Which under test is a
bluetooth_gatt_service_android.h
owns:android/.../ChromeBluetoothService.java
uses:android/.../Wrappers.java
:BluetoothServiceWrapper
- Which under test is a
FakeBluetoothService
- Which under test is a
- ... and so on for characteristics and descriptors.
Fake objects are controlled by bluetooth_test_android.cc
.
See also: Class Diagram of Web Bluetooth through Bluetooth Android
See test/README.md
- Bluetooth Notifications 2016-08-26
- Web Bluetooth through Android implementation details, class diagram and call flow.