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

Commit b7f7369c authored by En-Shuo Hsu's avatar En-Shuo Hsu
Browse files

Log the write and read offset

To better understand what happens when there is insufficient data in the
buffer.

Bug: 301673369
Test: atest --host net_test_stack_btm --no-bazel-mode
Change-Id: I4d98700bbd6eb83a5c40d77cc683cb6afb77a124
parent 38f4f88f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -568,6 +568,8 @@ struct tBTM_MSBC_INFO {

  const uint8_t* sco_pkt_read_ptr() {
    if (encode_buf_wo - encode_buf_ro < packet_size) {
      LOG_DEBUG("Insufficient data to dequeue. buf_wo:%zu, buf_ro:%zu",
                encode_buf_wo, encode_buf_ro);
      return nullptr;
    }

@@ -726,7 +728,6 @@ size_t dequeue_packet(const uint8_t** output) {

  *output = msbc_info->sco_pkt_read_ptr();
  if (*output == nullptr) {
    LOG_DEBUG("Insufficient data to dequeue.");
    return 0;
  }

@@ -918,6 +919,8 @@ struct tBTM_LC3_INFO {

  const uint8_t* sco_pkt_read_ptr() {
    if (encode_buf_wo - encode_buf_ro < packet_size) {
      LOG_DEBUG("Insufficient data to dequeue. buf_wo:%zu, buf_ro:%zu",
                encode_buf_wo, encode_buf_ro);
      return nullptr;
    }

@@ -1062,7 +1065,6 @@ size_t dequeue_packet(const uint8_t** output) {

  *output = lc3_info->sco_pkt_read_ptr();
  if (*output == nullptr) {
    LOG_DEBUG("Insufficient data to dequeue.");
    return 0;
  }