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

Commit d1932e03 authored by Martin Brabham's avatar Martin Brabham
Browse files

OOB: generateLocalOobdata()

Implement generation of LE OOB Data

- Remove GD flag to NOP for OobDataReply.
    GD Stack is only up to ACL, so Legacy SM needs to properly function.

Bug: 184377951
Tag: #feature
Test: Manual implementation from p/a/Settings
Change-Id: I6072c70f5e6707eb8f3a6126ffa1edbb5cba5aa4
parent d5912836
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2220,7 +2220,8 @@ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event,

    case BTM_SP_LOC_OOB_EVT:
#ifdef BTIF_DM_OOB_TEST
      btif_dm_proc_loc_oob((bool)(p_data->loc_oob.status == BTM_SUCCESS),
      btif_dm_proc_loc_oob(BT_TRANSPORT_BR_EDR,
                           (bool)(p_data->loc_oob.status == BTM_SUCCESS),
                           p_data->loc_oob.c, p_data->loc_oob.r);
#endif
      break;
+3 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ extern std::map<std::string, int> mock_function_count_map;
#include "bta/include/bta_api.h"
#include "include/hardware/bluetooth.h"
#include "internal_include/bte_appl.h"
#include "types/bt_transport.h"
#include "types/raw_address.h"

struct uid_set_t;
@@ -168,6 +169,7 @@ bool btif_dm_proc_rmt_oob(const RawAddress& bd_addr, Octet16* p_c,
  return false;
}

void btif_dm_proc_loc_oob(bool valid, const Octet16& c, const Octet16& r) {
void btif_dm_proc_loc_oob(tBT_TRANSPORT transport, bool is_valid,
                          const Octet16& c, const Octet16& r) {
  mock_function_count_map[__func__]++;
}
+2 −1
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ void btif_dm_set_oob_for_le_io_req(const RawAddress& bd_addr,
                                   tBTM_LE_AUTH_REQ* p_auth_req);
#ifdef BTIF_DM_OOB_TEST
void btif_dm_load_local_oob(void);
void btif_dm_proc_loc_oob(bool valid, const Octet16& c, const Octet16& r);
void btif_dm_proc_loc_oob(tBT_TRANSPORT transport, bool is_valid,
                          const Octet16& c, const Octet16& r);
bool btif_dm_proc_rmt_oob(const RawAddress& bd_addr, Octet16* p_c,
                          Octet16* p_r);
void btif_dm_generate_local_oob_data(tBT_TRANSPORT transport);
+5 −5
Original line number Diff line number Diff line
@@ -2273,17 +2273,17 @@ void btif_dm_load_local_oob(void) {
 *
 ******************************************************************************/
void btif_dm_generate_local_oob_data(tBT_TRANSPORT transport) {
  LOG_DEBUG("Transport %s", bt_transport_text(transport).c_str());
  if (transport == BT_TRANSPORT_BR_EDR) {
    BTM_ReadLocalOobData();
  } else if (transport == BT_TRANSPORT_LE) {
    // TODO(184377951): Call LE Implementation (not yet implemented?)
  } else {
    BTIF_TRACE_ERROR("Bad transport type! %d", transport);
    SMP_CrLocScOobData(base::BindOnce(&btif_dm_proc_loc_oob));
  }
}

void btif_dm_proc_loc_oob(bool valid, const Octet16& c, const Octet16& r) {
  invoke_oob_data_request_cb(BT_TRANSPORT_BR_EDR, valid, c, r);
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);
}

/*******************************************************************************
+0 −7
Original line number Diff line number Diff line
@@ -355,13 +355,6 @@ typedef struct {
  uint8_t le_appearance[2]; /* For the appearance of the device */
} bt_oob_data_t;

/** Bundle that can contain 1 or both of P192 and P256 */
// typedef struct {
//  uint8_t address[7];       /* Bluetooth Device Address (6) plus Address Type
//  (1) */ bt_oob_data_t p192_data;  /* P192 Data or NULL */ bt_oob_data_t
//  p256_data;  /* P256 Data or NULL */
//} bt_oob_data_bundle_t;

/** Bluetooth Device Type */
typedef enum {
  BT_DEVICE_DEVTYPE_BREDR = 0x1,
Loading