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

Commit 7cbdb077 authored by Myles Watson's avatar Myles Watson
Browse files

hci: Update error messages

Test: builds
Change-Id: I33544572122a166523a40dde090f276b102df247
parent 58047442
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -55,12 +55,9 @@ void btsnoop_net_open() {

  listen_thread_valid_ =
      (pthread_create(&listen_thread_, NULL, listen_fn_, NULL) == 0);
  if (!listen_thread_valid_) {
  if (!listen_thread_valid_)
    LOG_ERROR(LOG_TAG, "%s pthread_create failed: %s", __func__,
              strerror(errno));
  } else {
    LOG_DEBUG(LOG_TAG, "initialized");
  }
}

void btsnoop_net_close() {
+8 −13
Original line number Diff line number Diff line
@@ -114,19 +114,14 @@ static void parse_read_local_extended_features_response(
  uint8_t* stream = read_command_complete_header(
      response, HCI_READ_LOCAL_EXT_FEATURES,
      2 + sizeof(bt_device_features_t) /* bytes after */);
  if (stream != NULL) {
  CHECK(stream != NULL);

  STREAM_TO_UINT8(*page_number_ptr, stream);
  STREAM_TO_UINT8(*max_page_number_ptr, stream);

  CHECK(*page_number_ptr < feature_pages_count);
  STREAM_TO_ARRAY(feature_pages[*page_number_ptr].as_array, stream,
                  (int)sizeof(bt_device_features_t));
  } else {
    LOG_ERROR(LOG_TAG,
              "%s() - WARNING: READING EXTENDED FEATURES FAILED. "
              "THIS MAY INDICATE A FIRMWARE/CONTROLLER ISSUE.",
              __func__);
  }

  buffer_allocator->free(response);
}
+2 −4
Original line number Diff line number Diff line
@@ -157,13 +157,11 @@ static void reassemble_and_dispatch(UNUSED_ATTR BT_HDR* packet) {
          l2cap_length + L2CAP_HEADER_SIZE + HCI_ACL_PREAMBLE_SIZE;

      // Check for buffer overflow and that the full packet size + BT_HDR size
      // is less than
      // the max buffer size
      // is less than the max buffer size
      if (check_uint16_overflow(l2cap_length,
                                (L2CAP_HEADER_SIZE + HCI_ACL_PREAMBLE_SIZE)) ||
          ((full_length + sizeof(BT_HDR)) > BT_DEFAULT_BUFFER_SIZE)) {
        LOG_ERROR(LOG_TAG,
                  "%s L2CAP packet has invalid length (%d). Dropping it.",
        LOG_ERROR(LOG_TAG, "%s Dropping L2CAP packet with invalid length (%d).",
                  __func__, l2cap_length);
        buffer_allocator->free(packet);
        return;