ohos.bluetooth.constant (Bluetooth Constant Module)

Note:

Currently in the beta phase.

The constant module provides definitions for Bluetooth-related constants.

Importing the Module

import kit.ConnectivityKit.*

enum ProfileConnectionState

public enum ProfileConnectionState <: Equatable<ProfileConnectionState> & ToString {
    | StateDisconnected
    | StateConnecting
    | StateConnected
    | StateDisconnecting
    | ...
}

Description: Connection state of a Bluetooth device's profile.

System Capability: SystemCapability.Communication.Bluetooth.Core

Since: 22

Parent Types:

  • Equatable<ProfileConnectionState>
  • ToString

StateConnected

StateConnected

Description: Indicates the profile is connected.

System Capability: SystemCapability.Communication.Bluetooth.Core

Since: 22

StateConnecting

StateConnecting

Description: Indicates the profile is connecting.

System Capability: SystemCapability.Communication.Bluetooth.Core

Since: 22

StateDisconnected

StateDisconnected

Description: Indicates the profile is disconnected.

System Capability: SystemCapability.Communication.Bluetooth.Core

Since: 22

StateDisconnecting

StateDisconnecting

Description: Indicates the profile is disconnecting.

System Capability: SystemCapability.Communication.Bluetooth.Core

Since: 22

func !=(ProfileConnectionState)

public operator func !=(other: ProfileConnectionState): Bool

Description: Checks inequality of Bluetooth device's profile connection states.

System Capability: SystemCapability.Communication.Bluetooth.Core

Since: 22

Parameters:

Name Type Mandatory Default Value Description
other ProfileConnectionState Yes - The profile connection state of the Bluetooth device.

Return Value:

Type Description
Bool Returns true if the profile connection states are different, otherwise returns false.

func ==(ProfileConnectionState)

public operator func ==(other: ProfileConnectionState): Bool

Description: Checks equality of Bluetooth device's profile connection states.

System Capability: SystemCapability.Communication.Bluetooth.Core

Since: 22

Parameters:

Name Type Mandatory Default Value Description
other ProfileConnectionState Yes - The profile connection state of the Bluetooth device.

Return Value:

Type Description
Bool Returns true if the profile connection states are identical, otherwise returns false.

func toString()

public func toString(): String

Description: Returns the string representation of the Bluetooth device's profile connection state.

System Capability: SystemCapability.Communication.Bluetooth.Core

Since: 22

Return Value:

Type Description
String The string representation of the profile connection state.