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

Commit c7477051 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "set_report API should use HID control channel to send data" am: be3eb105

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1315057

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6fa53455d4f11bfe611379261304d509a34b6194
parents 7fcbf51c be3eb105
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -168,13 +168,7 @@ static void bta_hh_snd_write_dev(uint8_t dev_handle, uint8_t t_type,
 ******************************************************************************/
 ******************************************************************************/
void BTA_HhSetReport(uint8_t dev_handle, tBTA_HH_RPT_TYPE r_type,
void BTA_HhSetReport(uint8_t dev_handle, tBTA_HH_RPT_TYPE r_type,
                     BT_HDR* p_data) {
                     BT_HDR* p_data) {
  /* send feature report on control channel */
  bta_hh_snd_write_dev(dev_handle, HID_TRANS_SET_REPORT, r_type, 0, 0, p_data);
  if (r_type == BTA_HH_RPTT_FEATURE)
    bta_hh_snd_write_dev(dev_handle, HID_TRANS_SET_REPORT, r_type, 0, 0,
                         p_data);
  /* send output data report on interrupt channel */
  else
    bta_hh_snd_write_dev(dev_handle, HID_TRANS_DATA, r_type, 0, 0, p_data);
}
}
/*******************************************************************************
/*******************************************************************************
 *
 *
+1 −2
Original line number Original line Diff line number Diff line
@@ -126,8 +126,7 @@ static int uhid_read_event(btif_hh_device_t* p_dev) {
        btif_hh_setreport(p_dev, BTHH_FEATURE_REPORT, ev.u.output.size,
        btif_hh_setreport(p_dev, BTHH_FEATURE_REPORT, ev.u.output.size,
                          ev.u.output.data);
                          ev.u.output.data);
      else if (ev.u.output.rtype == UHID_OUTPUT_REPORT)
      else if (ev.u.output.rtype == UHID_OUTPUT_REPORT)
        btif_hh_setreport(p_dev, BTHH_OUTPUT_REPORT, ev.u.output.size,
        btif_hh_senddata(p_dev, ev.u.output.size, ev.u.output.data);
                          ev.u.output.data);
      else
      else
        APPL_TRACE_ERROR("%s: UHID_OUTPUT: Invalid report type = %d", __func__,
        APPL_TRACE_ERROR("%s: UHID_OUTPUT: Invalid report type = %d", __func__,
                         ev.u.output.rtype);
                         ev.u.output.rtype);
+2 −0
Original line number Original line Diff line number Diff line
@@ -109,6 +109,8 @@ extern void btif_hh_disconnect(RawAddress* bd_addr);
extern void btif_hh_setreport(btif_hh_device_t* p_dev,
extern void btif_hh_setreport(btif_hh_device_t* p_dev,
                              bthh_report_type_t r_type, uint16_t size,
                              bthh_report_type_t r_type, uint16_t size,
                              uint8_t* report);
                              uint8_t* report);
extern void btif_hh_senddata(btif_hh_device_t* p_dev, uint16_t size,
                             uint8_t* report);
extern void btif_hh_getreport(btif_hh_device_t* p_dev,
extern void btif_hh_getreport(btif_hh_device_t* p_dev,
                              bthh_report_type_t r_type, uint8_t reportId,
                              bthh_report_type_t r_type, uint8_t reportId,
                              uint16_t bufferSize);
                              uint16_t bufferSize);
+20 −0
Original line number Original line Diff line number Diff line
@@ -653,6 +653,26 @@ void btif_hh_setreport(btif_hh_device_t* p_dev, bthh_report_type_t r_type,
  BTA_HhSetReport(p_dev->dev_handle, r_type, p_buf);
  BTA_HhSetReport(p_dev->dev_handle, r_type, p_buf);
}
}


/*******************************************************************************
 *
 * Function         btif_btif_hh_senddata
 *
 * Description      senddata initiated from the BTIF thread context
 *
 * Returns          void
 *
 ******************************************************************************/
void btif_hh_senddata(btif_hh_device_t* p_dev, uint16_t size, uint8_t* report) {
  BT_HDR* p_buf = create_pbuf(size, report);
  if (p_buf == NULL) {
    APPL_TRACE_ERROR("%s: Error, failed to allocate RPT buffer, size = %d",
                     __func__, size);
    return;
  }
  p_buf->layer_specific = BTA_HH_RPTT_OUTPUT;
  BTA_HhSendData(p_dev->dev_handle, p_dev->bd_addr, p_buf);
}

/*******************************************************************************
/*******************************************************************************
 *
 *
 * Function         btif_hh_service_registration
 * Function         btif_hh_service_registration