classAddress:''' Bluetooth Address (see Bluetooth spec Vol 6, Part B - 1.3 DEVICE ADDRESS) NOTE: the address bytes are stored in little-endian byte order here, so
@@ -2327,33 +2349,33 @@ the type is set to PUBLIC_DEVICE_ADDRESS.
Source code in bumble/hci.py
-
defto_string(self,with_type_qualifier=True):''' String representation of the address, MSB first, with an optional type qualifier.
@@ -2449,36 +2471,39 @@ qualifier.
Source code in bumble/hci.py
-
classHCI_Command(HCI_Packet):''' See Bluetooth spec @ Vol 2, Part E - 5.4.1 HCI Command Packet '''
@@ -2823,34 +2851,34 @@ qualifier.
Source code in bumble/hci.py
-
@staticmethoddefcommand(fields=(),return_parameters_fields=()):''' Decorator used to declare and register subclasses
@@ -2907,16 +2935,16 @@ qualifier.
Source code in bumble/hci.py
-
This Android app that is compatible with the Bumble bench command line app.
+This app can be used to test the throughput and latency between two Android
+devices, or between an Android device and another device running the Bumble
+bench app.
+Only the RFComm Client, RFComm Server, L2CAP Client and L2CAP Server modes are
+supported.
You can build the app by running ./gradlew build (use gradlew.bat on Windows) from the BtBench top level directory.
+You can also build with Android Studio: open the BtBench project. You can build and/or debug from there.
+
If the build succeeds, you can find the app APKs (debug and release) at:
Using the am command, you can start the activity, and pass it arguments so that you can
+automatically start the benchmark test, and/or set the parameters.
+
+
+
+
Parameter Name
+
Parameter Type
+
Description
+
+
+
+
+
autostart
+
String
+
Benchmark to start. (rfcomm-client, rfcomm-server, l2cap-client or l2cap-server)
+
+
+
packet-count
+
Integer
+
Number of packets to send (rfcomm-client and l2cap-client only)
+
+
+
packet-size
+
Integer
+
Number of bytes per packet (rfcomm-client and l2cap-client only)
+
+
+
peer-bluetooth-address
+
Integer
+
Peer Bluetooth address to connect to (rfcomm-client and l2cap-client
+
+
+
+
+
Launching from adb with auto-start
+
In this example, we auto-start the Rfcomm Server bench action.
+
Launching from adb with auto-start and some parameters
+
In this example, we auto-start the Rfcomm Client bench action, set the packet count to 100,
+and the packet size to 1024, and connect to DA:4C:10:DE:17:02
+
The app's main activity has a "Peer Bluetooth Address" setting where you can change the address.
+
+
Bluetooth Address for L2CAP vs RFComm
+
For BLE (L2CAP mode), the address of a device typically changes regularly (it is randomized for privacy), whereas the Bluetooth Classic addresses will remain the same (RFComm mode).
+If two devices are paired and bonded, then they will each "see" a non-changing address for each other even with BLE (Resolvable Private Address)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/extras/android_remote_hci.html b/extras/android_remote_hci.html
index c6f5f51..7df9684 100644
--- a/extras/android_remote_hci.html
+++ b/extras/android_remote_hci.html
@@ -12,7 +12,7 @@
-
+
@@ -1752,6 +1752,8 @@
+
+
@@ -1867,6 +1869,13 @@
This application allows using an android phone's built-in Bluetooth controller with
+
This application allows using an android phone's built-in Bluetooth controller with
a Bumble host stack running outside the phone (typically a development laptop or desktop).
The app runs an HCI proxy between a TCP socket on the "outside" and the Bluetooth HCI HAL
-on the "inside". (See this page for a high level
+on the "inside". (See this page for a high level
description of the Android Bluetooth HCI HAL).
-The HCI packets received on the TCP socket are forwarded to the phone's controller, and the
+The HCI packets received on the TCP socket are forwarded to the phone's controller, and the
packets coming from the controller are forwarded to the TCP socket.
You can build the app by running ./gradlew build (use gradlew.bat on Windows) from the RemoteHCI top level directory.
+
You can build the app by running ./gradlew build (use gradlew.bat on Windows) from the extras/android/RemoteHCI top level directory.
You can also build with Android Studio: open the RemoteHCI project. You can build and/or debug from there.
If the build succeeds, you can find the app APKs (debug and release) at:
@@ -2219,9 +2269,24 @@ You can also build with Android Studio: open the RemoteHCI project.
In the following examples, it is assumed that shell commands are executed while in the
+app's root directory, extras/android/RemoteHCI. If you are in a different directory,
+adjust the relative paths accordingly.
When the proxy starts (tapping the "Start" button in the app's main activity), it will try to
-bind to the Bluetooth HAL. This requires disabling SELinux temporarily, and being the only HAL client.
+
When the proxy starts (tapping the "Start" button in the app's main activity, or running the proxy
+from an adb shell command line), it will try to bind to the Bluetooth HAL.
+This requires that there is no other HAL client, and requires certain privileges.
+For running as a regular app, this requires disabling SELinux temporarily.
+For running as a command-line executable, this just requires a root shell.
Binding to the Bluetooth HCI HAL requires certain SELinux permissions that can't simply be changed
on a device without rebuilding its system image. To bypass these restrictions, you will need
@@ -2243,8 +2308,8 @@ development phone).
This state will also reset to the normal SELinux enforcement when you reboot.
Since the Bluetooth HAL service can only accept one client, and that in normal conditions
-that client is the Android's bluetooth stack, it is required to first shut down the
+
Since the Bluetooth HAL service can only accept one client, and that in normal conditions
+that client is the Android's bluetooth stack, it is required to first shut down the
Android bluetooth stack process.
Checking if the Bluetooth process is running
@@ -2263,7 +2328,30 @@ Airplane Mode, then rebooting. The bluetooth process should, in theory, not rest
Just tap the app icon on the launcher, check the TCP port that is configured, and tap
@@ -2284,10 +2372,10 @@ automatically start the proxy, and/or set the port number.
The RemoteHCI app's main activity has a "TCP Port" setting where you can change the port on
-which the proxy is accepting connections. If the default value isn't suitable, you can
+which the proxy is accepting connections. If the default value isn't suitable, you can
change it there (you can also use the special value 0 to let the OS assign a port number for you).
To connect the Bumble stack to the proxy, you need to be able to reach the phone's network
+
To connect the Bumble stack to the proxy, you need to be able to reach the phone's network
stack. This can be done over the phone's WiFi connection, or, alternatively, using an adb
TCP forward (which should be faster than over WiFi).
@@ -2295,7 +2383,7 @@ TCP forward (which should be faster than over WiFi).
To connect to the proxy via an adb TCP forward, use:
$adbforwardtcp:<outside-port>tcp:<inside-port>
-Where <outside-port> is the port number for a listening socket on your laptop or
+Where <outside-port> is the port number for a listening socket on your laptop or
desktop machine, and is the TCP port selected in the app's user interface.
Those two ports may be the same, of course.
For example, with the default TCP port 9993:
@@ -2303,7 +2391,7 @@ For example, with the default TCP port 9993:
Once you've ensured that you can reach the proxy's TCP port on the phone, either directly or
-via an adb forward, you can then use it as a Bumble transport, using the transport name:
+via an adb forward, you can then use it as a Bumble transport, using the transport name:
tcp-client:<host>:<port> syntax.
Connecting a Bumble client
@@ -2350,13 +2438,13 @@ Assuming you have set up an adb forward on port 9993:
-
+
Allows using an Android phone's built-in Bluetooth controller with a Bumble
stack running on a development machine.
See Android Remote HCI for details.
An Android app that is compatible with the Bumble bench command line app.
+This app can be used to test the throughput and latency between two Android
+devices, or between an Android device and another device running the Bumble
+bench app.