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

Commit 3bde12d3 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

legacy: Const-ify btif::btif_bqr am: 7b6d375e am: c1e05ca6

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1898151

Change-Id: Ibbfa8a3879485ad763fcd846235a05f7565bc48d
parents 194a0dc7 c1e05ca6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ class BqrVseSubEvt {
  //
  // @param length Total length of all parameters contained in the sub-event.
  // @param p_param_buf A pointer to the parameters contained in the sub-event.
  void ParseBqrLinkQualityEvt(uint8_t length, uint8_t* p_param_buf);
  void ParseBqrLinkQualityEvt(uint8_t length, const uint8_t* p_param_buf);
  // Write the LMP/LL message trace to the log file.
  //
  // @param fd The File Descriptor of the log file.
@@ -343,13 +343,14 @@ void ConfigureBqrCmpl(uint32_t current_evt_mask);
//   controller.
// @param p_bqr_event A pointer to the BQR VSE sub-event which is sent from the
//   Bluetooth controller.
void CategorizeBqrEvent(uint8_t length, uint8_t* p_bqr_event);
void CategorizeBqrEvent(uint8_t length, const uint8_t* p_bqr_event);

// Record a new incoming Link Quality related BQR event in quality event queue.
//
// @param length Lengths of the Link Quality related BQR event.
// @param p_link_quality_event A pointer to the Link Quality related BQR event.
void AddLinkQualityEventToQueue(uint8_t length, uint8_t* p_link_quality_event);
void AddLinkQualityEventToQueue(uint8_t length,
                                const uint8_t* p_link_quality_event);

// Dump the LMP/LL message handshaking with the remote device to a log file.
//
+4 −3
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ static std::unique_ptr<LeakyBondedQueue<BqrVseSubEvt>> kpBqrEventQueue(
    new LeakyBondedQueue<BqrVseSubEvt>(kBqrEventQueueSize));

void BqrVseSubEvt::ParseBqrLinkQualityEvt(uint8_t length,
                                          uint8_t* p_param_buf) {
                                          const uint8_t* p_param_buf) {
  if (length < kLinkQualityParamTotalLen) {
    LOG(FATAL) << __func__
               << ": Parameter total length: " << std::to_string(length)
@@ -344,7 +344,7 @@ void ConfigureBqrCmpl(uint32_t current_evt_mask) {
  }
}

void CategorizeBqrEvent(uint8_t length, uint8_t* p_bqr_event) {
void CategorizeBqrEvent(uint8_t length, const uint8_t* p_bqr_event) {
  if (length == 0) {
    LOG(WARNING) << __func__ << ": Lengths of all of the parameters are zero.";
    return;
@@ -383,7 +383,8 @@ void CategorizeBqrEvent(uint8_t length, uint8_t* p_bqr_event) {
  }
}

void AddLinkQualityEventToQueue(uint8_t length, uint8_t* p_link_quality_event) {
void AddLinkQualityEventToQueue(uint8_t length,
                                const uint8_t* p_link_quality_event) {
  std::unique_ptr<BqrVseSubEvt> p_bqr_event = std::make_unique<BqrVseSubEvt>();
  p_bqr_event->ParseBqrLinkQualityEvt(length, p_link_quality_event);

+2 −1
Original line number Diff line number Diff line
@@ -935,7 +935,8 @@ typedef struct {
typedef uint8_t tBTM_CONTRL_STATE;

// Bluetooth Quality Report - Report receiver
typedef void(tBTM_BT_QUALITY_REPORT_RECEIVER)(uint8_t len, uint8_t* p_stream);
typedef void(tBTM_BT_QUALITY_REPORT_RECEIVER)(uint8_t len,
                                              const uint8_t* p_stream);

struct tREMOTE_VERSION_INFO {
  uint8_t lmp_version{0};