1 // 2 // Copyright (C) 2015 Google, Inc. 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 <string> 20 21 namespace bluetooth { 22 23 // Possible Adapter states. The values for each enumration have been copied 24 // from frameworks/base/core/java/android/bluetooth/BluetoothAdapter.java. 25 // These values need to match their android.bluetooth.BluetoothAdapter 26 // counterparts for this to be compatible with the framework, hence we 27 // redeclare them here. 28 enum AdapterState { 29 ADAPTER_STATE_DISCONNECTED = 0, 30 ADAPTER_STATE_CONNECTING = 1, 31 ADAPTER_STATE_CONNECTED = 2, 32 ADAPTER_STATE_DISCONNECTING = 3, 33 ADAPTER_STATE_OFF = 10, 34 ADAPTER_STATE_TURNING_ON = 11, 35 ADAPTER_STATE_ON = 12, 36 ADAPTER_STATE_TURNING_OFF = 13, 37 ADAPTER_STATE_INVALID = 0xFFFF 38 }; 39 40 // Returns a string for the given Adapter state |state|. 41 std::string AdapterStateToString(AdapterState state); 42 43 } // namespace bluetooth 44