Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b56f6db0 authored by Chris Manton's avatar Chris Manton
Browse files

headless: Add docs and more information

Bug: 147316415
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I44c8a3a38914581a335446f975c9626a9587e73f
parent 46e0f7bb
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
##
## bluetooth headless
##
## A device-side executable that consists of a binary executable
## driving the Android libbluetooth libraries.
##

Requirements:
    1. Android installation,
    2. Root access to adb connected Android device.

Build: Source, lunch and build as typical Android target for selected device and architecture.
    cd $ANDROID_BUILD_TOP
    . build/envsetup.sh && lunch <target>
    make bt_headless

Install: Push the binary to an executable area on target device.
    adb push out/target/product/<device..arch>/bt_headless/bt_headless /data/data/.

Prepare: Ensure the system is queisced to prevent resource conflicts from the bluetooth process.
    adb shell stop

Run: Script or directly execute the target file.
    adb shell /data/data/bt_headless --flags=INIT_logging_debug_enabled_for_all=true,INIT_gd_acl=true nop
+8 −2
Original line number Diff line number Diff line
@@ -189,8 +189,14 @@ bt_os_callouts_t bt_os_callouts{
void HeadlessStack::SetUp() {
  LOG(INFO) << __func__ << " Entry";

  int status = bluetoothInterface.init(&bt_callbacks, false, false, 0,
                                       StackInitFlags(), false);
  const bool start_restricted = false;
  const bool is_common_criteria_mode = false;
  const int config_compare_result = 0;
  const bool is_atv = false;
  int status = bluetoothInterface.init(
      &bt_callbacks, start_restricted, is_common_criteria_mode,
      config_compare_result, StackInitFlags(), is_atv);

  (status == BT_STATUS_SUCCESS)
      ? LOG(INFO) << __func__ << " Initialized bluetooth callbacks"
      : LOG(FATAL) << "Failed to initialize Bluetooth stack";