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