1# oh_bluetooth.h 2 3 4## Overview 5 6Defines the API for obtaining the Bluetooth switch state. 7 8**Library**: libbluetooth_ndk.so 9 10**System capability**: SystemCapability.Communication.Bluetooth.Core 11 12**Since**: 13 13 14**Related module**: [Bluetooth](_bluetooth.md) 15 16 17## Summary 18 19 20### Types 21 22| Name| Description| 23| -------- | -------- | 24| typedef enum [Bluetooth_SwitchState](_bluetooth.md#bluetooth_switchstate) [Bluetooth_SwitchState](_bluetooth.md#bluetooth_switchstate) | Defines an enum for Bluetooth switch states.| 25| typedef enum [Bluetooth_ResultCode](_bluetooth.md#bluetooth_resultcode) [Bluetooth_ResultCode](_bluetooth.md#bluetooth_resultcode) | Defines an enum for the error codes returned by Bluetooth APIs.| 26 27 28### Enums 29 30| Name| Description| 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>} | Enumerates the Bluetooth switch states. | 33| [Bluetooth_ResultCode](_bluetooth.md#bluetooth_resultcode) {<br>[BLUETOOTH_SUCCESS](_bluetooth.md) = 0,<br>[BLUETOOTH_INVALID_PARAM](_bluetooth.md) = 401<br>} | Enumerates the error codes returned by Bluetooth APIs.| 34 35 36### Functions 37 38| Name| Description| 39| -------- | -------- | 40| [Bluetooth_ResultCode](_bluetooth.md#bluetooth_resultcode) [OH_Bluetooth_GetBluetoothSwitchState](_bluetooth.md#oh_bluetooth_getbluetoothswitchstate) ([Bluetooth_SwitchState](_bluetooth.md#bluetooth_switchstate) \*state) | Obtains the Bluetooth state.| 41