1 /* 2 * Copyright 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 19 #include <cstdint> 20 #include <cstring> 21 22 /* HCI mode defenitions */ 23 typedef enum : uint8_t { 24 HCI_MODE_ACTIVE = 0x00, 25 HCI_MODE_HOLD = 0x01, 26 HCI_MODE_SNIFF = 0x02, 27 HCI_MODE_PARK = 0x03, 28 } tHCI_MODE; 29 hci_mode_text(const tHCI_MODE & mode)30inline std::string hci_mode_text(const tHCI_MODE& mode) { 31 switch (mode) { 32 case HCI_MODE_ACTIVE: 33 return std::string("active"); 34 case HCI_MODE_HOLD: 35 return std::string("hold"); 36 case HCI_MODE_SNIFF: 37 return std::string("sniff"); 38 case HCI_MODE_PARK: 39 return std::string("park"); 40 default: 41 return std::string("UNKNOWN"); 42 } 43 } 44