1# oh_bluetooth.h 2 3 4## 概述 5 6定义查询蓝牙开关状态的接口。 7 8**库:** libbluetooth_ndk.so 9 10**系统能力:** SystemCapability.Communication.Bluetooth.Core 11 12**起始版本:** 13 13 14**相关模块:**[Bluetooth](_bluetooth.md) 15 16 17## 汇总 18 19 20### 类型定义 21 22| 名称 | 描述 | 23| -------- | -------- | 24| typedef enum [Bluetooth_SwitchState](_bluetooth.md#bluetooth_switchstate) [Bluetooth_SwitchState](_bluetooth.md#bluetooth_switchstate) | 定义蓝牙开关状态的枚举值。 | 25| typedef enum [Bluetooth_ResultCode](_bluetooth.md#bluetooth_resultcode) [Bluetooth_ResultCode](_bluetooth.md#bluetooth_resultcode) | 定义蓝牙返回值的错误码。 | 26 27 28### 枚举 29 30| 名称 | 描述 | 31| -------- | -------- | 32| [Bluetooth_SwitchState](_bluetooth.md#bluetooth_switchstate) {<br/>[BLUETOOTH_STATE_OFF](_bluetooth.md) = 0,<br/>[BLUETOOTH_STATE_TURNING_ON](_bluetooth.md) = 1,<br/>[BLUETOOTH_STATE_ON](_bluetooth.md) = 2,<br/>[BLUETOOTH_STATE_TURNING_OFF](_bluetooth.md) = 3,<br/>[BLUETOOTH_STATE_BLE_TURNING_ON](_bluetooth.md) = 4,<br/>[BLUETOOTH_STATE_BLE_ON](_bluetooth.md) = 5,<br/>[BLUETOOTH_STATE_BLE_TURNING_OFF](_bluetooth.md) = 6<br/>} | 定义蓝牙开关状态的枚举值。 | 33| [Bluetooth_ResultCode](_bluetooth.md#bluetooth_resultcode) {<br/>[BLUETOOTH_SUCCESS](_bluetooth.md) = 0,<br/>[BLUETOOTH_INVALID_PARAM](_bluetooth.md) = 401<br/>} | 定义蓝牙返回值的错误码。 | 34 35 36### 函数 37 38| 名称 | 描述 | 39| -------- | -------- | 40| [Bluetooth_ResultCode](_bluetooth.md#bluetooth_resultcode) [OH_Bluetooth_GetBluetoothSwitchState](_bluetooth.md#oh_bluetooth_getbluetoothswitchstate) ([Bluetooth_SwitchState](_bluetooth.md#bluetooth_switchstate) \*state) | 获取蓝牙开关状态。 | 41