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

Commit 6a4a3cc5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "legacy: Introduce stack/include/hci_mode"

parents 709091f7 f63773d6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <cstdint>
#include "stack/include/bt_types.h"
#include "stack/include/hci_error_code.h"
#include "stack/include/hci_mode.h"
#include "stack/include/hcidefs.h"
#include "types/ble_address_with_type.h"
#include "types/class_of_device.h"
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "osi/include/allocator.h"
#include "stack/include/bt_types.h"
#include "stack/include/hci_error_code.h"
#include "stack/include/hci_mode.h"
#include "stack/include/hcidefs.h"
#include "types/ble_address_with_type.h"
#include "types/hci_role.h"
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

#include "stack/include/bt_types.h"
#include "stack/include/hci_error_code.h"
#include "stack/include/hci_mode.h"
#include "stack/include/hcidefs.h"
#include "types/hci_role.h"
#include "types/raw_address.h"
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include "device/include/esco_parameters.h"
#include "internal_include/bt_target.h"
#include "stack/include/btm_status.h"
#include "stack/include/hci_mode.h"
#include "stack/include/hcidefs.h"
#include "stack/include/smp_api_types.h"
#include "types/ble_address_with_type.h"
+43 −0
Original line number Diff line number Diff line
/*
 * Copyright 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <cstdint>
#include <cstring>

/* HCI mode defenitions */
typedef enum : uint8_t {
  HCI_MODE_ACTIVE = 0x00,
  HCI_MODE_HOLD = 0x01,
  HCI_MODE_SNIFF = 0x02,
  HCI_MODE_PARK = 0x03,
} tHCI_MODE;

inline std::string hci_mode_text(const tHCI_MODE& mode) {
  switch (mode) {
    case HCI_MODE_ACTIVE:
      return std::string("active");
    case HCI_MODE_HOLD:
      return std::string("hold");
    case HCI_MODE_SNIFF:
      return std::string("sniff");
    case HCI_MODE_PARK:
      return std::string("park");
    default:
      return std::string("UNKNOWN");
  }
}
Loading