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

Commit 0c64cea0 authored by Martin Brabham's avatar Martin Brabham
Browse files

OOB: Add public address to OOB data

Will need to figure out private addresses in follow-up CL

Bug: 178007935
Test: Compiles, test app.
Tag: #feature
Change-Id: I73e3ef9fbefb5443dbe719471683af3e3bcb4e1b
parent 74cb2872
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ void invoke_ssp_request_cb(RawAddress bd_addr, bt_bdname_t bd_name,
                           uint32_t cod, bt_ssp_variant_t pairing_variant,
                           uint32_t pass_key);
void invoke_oob_data_request_cb(tBT_TRANSPORT t, bool valid, Octet16 c,
                                Octet16 r);
                                Octet16 r, RawAddress raw_address);
void invoke_bond_state_changed_cb(bt_status_t status, RawAddress bd_addr,
                                  bt_bond_state_t state);
void invoke_acl_state_changed_cb(bt_status_t status, RawAddress bd_addr,
+12 −2
Original line number Diff line number Diff line
@@ -739,9 +739,19 @@ void invoke_ssp_request_cb(RawAddress bd_addr, bt_bdname_t bd_name,
}

void invoke_oob_data_request_cb(tBT_TRANSPORT t, bool valid, Octet16 c,
                                Octet16 r) {
                                Octet16 r, RawAddress raw_address) {
  LOG_INFO("%s", __func__);
  bt_oob_data_t oob_data;
  bt_oob_data_t oob_data = {};

  // Set the local address
  int j = 5;
  for (int i = 0; i < 6; i++) {
    oob_data.address[i] = raw_address.address[j];
    j--;
  }
  // Set type always public
  oob_data.address[6] = 0;

  // Each value (for C and R) is 16 octets in length
  bool c_empty = true;
  for (int i = 0; i < 16; i++) {
+2 −1
Original line number Diff line number Diff line
@@ -2283,7 +2283,8 @@ void btif_dm_generate_local_oob_data(tBT_TRANSPORT transport) {

void btif_dm_proc_loc_oob(tBT_TRANSPORT transport, bool is_valid,
                          const Octet16& c, const Octet16& r) {
  invoke_oob_data_request_cb(transport, is_valid, c, r);
  invoke_oob_data_request_cb(transport, is_valid, c, r,
                             *controller_get_interface()->get_address());
}

/*******************************************************************************