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 #ifdef __cplusplus 20 #include <cstdint> 21 #include <string> 22 #else 23 #include <stdint.h> 24 #endif 25 26 /* Device Types 27 */ 28 enum { 29 BT_DEVICE_TYPE_UNKNOWN = 0, 30 BT_DEVICE_TYPE_BREDR = (1 << 0), 31 BT_DEVICE_TYPE_BLE = (1 << 1), 32 BT_DEVICE_TYPE_DUMO = BT_DEVICE_TYPE_BREDR | BT_DEVICE_TYPE_BLE, 33 }; 34 typedef uint8_t tBT_DEVICE_TYPE; 35 36 #ifdef __cplusplus DeviceTypeText(tBT_DEVICE_TYPE type)37inline std::string DeviceTypeText(tBT_DEVICE_TYPE type) { 38 switch (type) { 39 case BT_DEVICE_TYPE_BREDR: 40 return std::string("BR_EDR"); 41 case BT_DEVICE_TYPE_BLE: 42 return std::string("BLE"); 43 case BT_DEVICE_TYPE_DUMO: 44 return std::string("DUAL"); 45 default: 46 return std::string("Unknown"); 47 } 48 } 49 #endif // __cplusplus 50