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

Commit 50b1dd65 authored by David Duarte's avatar David Duarte Committed by Gerrit Code Review
Browse files

Merge changes I07b66a08,I0bc21767

* changes:
  Revert "Remove unused le_test_mode from bluetooth interface"
  Revert "Remove unused dut_mode from bluetooth interface"
parents 418ef2ff 51e580bb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -778,6 +778,15 @@ static void callback_thread_event(bt_cb_thread_evt event) {
  }
}

static void dut_mode_recv_callback(uint16_t opcode, uint8_t* buf, uint8_t len) {

}

static void le_test_mode_recv_callback(bt_status_t status,
                                       uint16_t packet_count) {
  ALOGV("%s: status:%d packet_count:%d ", __func__, status, packet_count);
}

static void energy_info_recv_callback(bt_activity_energy_info* p_energy_info,
                                      bt_uid_traffic_t* uid_data) {
  std::shared_lock<std::shared_timed_mutex> lock(jniObjMutex);
@@ -827,6 +836,8 @@ static bt_callbacks_t sBluetoothCallbacks = {sizeof(sBluetoothCallbacks),
                                             le_address_associate_callback,
                                             acl_state_changed_callback,
                                             callback_thread_event,
                                             dut_mode_recv_callback,
                                             le_test_mode_recv_callback,
                                             energy_info_recv_callback,
                                             link_quality_report_callback,
                                             generate_local_oob_data_callback,
+6 −0
Original line number Diff line number Diff line
@@ -55,6 +55,12 @@ void BTA_dm_init() {
  BTM_SetConsolidationCallback(bta_dm_consolidate);
}

/** Enables bluetooth device under test mode */
void BTA_EnableTestMode(void) {
  do_in_main_thread(FROM_HERE,
                    base::Bind(base::IgnoreResult(BTM_EnableTestMode)));
}

/** This function sets the Bluetooth name of local device */
void BTA_DmSetDeviceName(const char* p_name) {
  std::vector<uint8_t> name(BD_NAME_LEN + 1);
+12 −0
Original line number Diff line number Diff line
@@ -741,6 +741,18 @@ enum {

void BTA_dm_init();

/*******************************************************************************
 *
 * Function         BTA_EnableTestMode
 *
 * Description      Enables bluetooth device under test mode
 *
 *
 * Returns          tBTA_STATUS
 *
 ******************************************************************************/
extern void BTA_EnableTestMode(void);

/*******************************************************************************
 *
 * Function         BTA_DmSetDeviceName
+27 −0
Original line number Diff line number Diff line
@@ -329,6 +329,33 @@ bt_status_t btif_dm_get_adapter_property(bt_property_t* prop);
 ******************************************************************************/
void btif_dm_get_remote_services(const RawAddress remote_addr, int transport);

/*******************************************************************************
 *
 * Function         btif_dut_mode_configure
 *
 * Description      Configure Test Mode - 'enable' to 1 puts the device in test
 *                  mode and 0 exits test mode
 *
 ******************************************************************************/
void btif_dut_mode_configure(uint8_t enable);

bool btif_is_dut_mode();

/*******************************************************************************
 *
 * Function         btif_dut_mode_send
 *
 * Description     Sends a HCI Vendor specific command to the controller
 *
 ******************************************************************************/
void btif_dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len);

void btif_ble_transmitter_test(uint8_t tx_freq, uint8_t test_data_len,
                               uint8_t packet_payload);

void btif_ble_receiver_test(uint8_t rx_freq);
void btif_ble_test_end();

/*******************************************************************************
 *
 * Function         btif_dm_read_energy_info
+1 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ void invoke_acl_state_changed_cb(bt_status_t status, RawAddress bd_addr,
                                 bt_conn_direction_t direction,
                                 uint16_t acl_handle);
void invoke_thread_evt_cb(bt_cb_thread_evt event);
void invoke_le_test_mode_cb(bt_status_t status, uint16_t count);
void invoke_energy_info_cb(bt_activity_energy_info energy_info,
                           bt_uid_traffic_t* uid_data);
void invoke_link_quality_report_cb(
Loading