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

Commit 27afd7ea authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "[GD-HCI] ACL handle should be AND'ed with 0xFFF instead of 0xEFF"

parents aaba08db f0128699
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -406,7 +406,8 @@ static void transmit_fragment(const uint8_t* stream, size_t length) {
      handle_with_flags >> 12 & 0b11);
  auto bc_flag =
      static_cast<bluetooth::hci::BroadcastFlag>(handle_with_flags >> 14);
  uint16_t handle = handle_with_flags & 0xEFF;
  uint16_t handle = handle_with_flags & 0xFFF;
  ASSERT_LOG(handle <= 0xEFF, "Require handle <= 0xEFF, but is 0x%X", handle);
  length -= 2;
  // skip data total length
  stream += 2;
@@ -421,7 +422,8 @@ static void transmit_fragment(const uint8_t* stream, size_t length) {
static void transmit_sco_fragment(const uint8_t* stream, size_t length) {
  uint16_t handle_with_flags;
  STREAM_TO_UINT16(handle_with_flags, stream);
  uint16_t handle = handle_with_flags & 0xEFF;
  uint16_t handle = handle_with_flags & 0xFFF;
  ASSERT_LOG(handle <= 0xEFF, "Require handle <= 0xEFF, but is 0x%X", handle);
  length -= 2;
  // skip data total length
  stream += 1;
@@ -442,7 +444,8 @@ static void transmit_iso_fragment(const uint8_t* stream, size_t length) {
      handle_with_flags >> 12 & 0b11);
  auto ts_flag =
      static_cast<bluetooth::hci::TimeStampFlag>(handle_with_flags >> 14);
  uint16_t handle = handle_with_flags & 0xEFF;
  uint16_t handle = handle_with_flags & 0xFFF;
  ASSERT_LOG(handle <= 0xEFF, "Require handle <= 0xEFF, but is 0x%X", handle);
  length -= 2;
  // skip data total length
  stream += 2;
+2 −1
Original line number Diff line number Diff line
@@ -198,7 +198,8 @@ void btm_route_sco_data(BT_HDR* p_msg) {
    return;
  }
  LOG_INFO("Received SCO packet from HCI. Dropping it since no handler so far");
  uint16_t handle = handle_with_flags & 0xeff;
  uint16_t handle = handle_with_flags & 0xFFF;
  ASSERT_LOG(handle <= 0xEFF, "Require handle <= 0xEFF, but is 0x%X", handle);
  auto* active_sco = btm_get_active_sco();
  if (active_sco != nullptr && active_sco->hci_handle == handle) {
    // TODO: For MSBC, we need to decode here