harmony 鸿蒙oh_bluetooth.h

  • 2025-06-12
  • 浏览 (7)

oh_bluetooth.h

Overview

Defines the API for obtaining the Bluetooth switch state.

Library: libbluetooth_ndk.so

System capability: SystemCapability.Communication.Bluetooth.Core

Since: 13

Related module: Bluetooth

Summary

Types

Name Description
typedef enum Bluetooth_SwitchState Bluetooth_SwitchState Defines an enum for Bluetooth switch states.
typedef enum Bluetooth_ResultCode Bluetooth_ResultCode Defines an enum for the error codes returned by Bluetooth APIs.

Enums

Name Description
Bluetooth_SwitchState {
BLUETOOTH_STATE_OFF = 0,
BLUETOOTH_STATE_TURNING_ON = 1,
BLUETOOTH_STATE_ON = 2,
BLUETOOTH_STATE_TURNING_OFF = 3,
BLUETOOTH_STATE_BLE_TURNING_ON = 4,
BLUETOOTH_STATE_BLE_ON = 5,
BLUETOOTH_STATE_BLE_TURNING_OFF = 6
}
Enumerates the Bluetooth switch states.
Bluetooth_ResultCode {
BLUETOOTH_SUCCESS = 0,
BLUETOOTH_INVALID_PARAM = 401
}
Enumerates the error codes returned by Bluetooth APIs.

Functions

Name Description
Bluetooth_ResultCode OH_Bluetooth_GetBluetoothSwitchState (Bluetooth_SwitchState *state) Obtains the Bluetooth state.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Connectivity Kit (Short-Range Communication Service)

harmony 鸿蒙Bluetooth

harmony 鸿蒙Wifi

harmony 鸿蒙Bluetooth Error Codes

harmony 鸿蒙NFC Error Codes

harmony 鸿蒙SecureElement Error Codes

harmony 鸿蒙Wi-Fi Error Codes

harmony 鸿蒙@ohos.bluetooth.a2dp (Bluetooth A2DP Module) (System API)

harmony 鸿蒙@ohos.bluetooth.a2dp (Bluetooth A2DP Module)

harmony 鸿蒙@ohos.bluetooth.access (Bluetooth Access Module) (System API)

0  赞