openharmony 鸿蒙 js-apis-bluetooth-constant

2025-06-12 浏览 (1)

@ohos.bluetooth.constant (Bluetooth constant Module)

The constant module provides definitions of the constants used in Bluetooth.

NOTE

The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import { constant } from '@kit.ConnectivityKit';

ProfileId

Enumerates profiles.

System capability: SystemCapability.Communication.Bluetooth.Core

NameValueDescription
PROFILE_A2DP_SOURCE1Advanced Audio Distribution Profile (A2DP).
PROFILE_HANDSFREE_AUDIO_GATEWAY4Hands-Free Profile (HFP).
PROFILE_HID_HOST6Human Interface Device (HID) profile.
PROFILE_PAN_NETWORK7Bluetooth personal area network (PAN) profile.

ProfileConnectionState

Enumerates the profile connection states.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Communication.Bluetooth.Core

NameValueDescription
STATE_DISCONNECTED0Disconnected.
STATE_CONNECTING1Connecting.
STATE_CONNECTED2Connected.
STATE_DISCONNECTING3Disconnecting.

MajorClass

Enumerates the major classes of Bluetooth devices.

System capability: SystemCapability.Communication.Bluetooth.Core

NameValueDescription
MAJOR_MISC0x0000Miscellaneous device.
MAJOR_COMPUTER0x0100Computer.
MAJOR_PHONE0x0200Mobile phone.
MAJOR_NETWORKING0x0300Network device.
MAJOR_AUDIO_VIDEO0x0400Audio or video device.
MAJOR_PERIPHERAL0x0500Peripheral device.
MAJOR_IMAGING0x0600Imaging device.
MAJOR_WEARABLE0x0700Wearable device.
MAJOR_TOY0x0800Toy.
MAJOR_HEALTH0x0900Health device.
MAJOR_UNCATEGORIZED0x1F00Unclassified device.

MajorMinorClass

Enumerates the major and minor classes of Bluetooth devices.

System capability: SystemCapability.Communication.Bluetooth.Core

NameValueDescription
COMPUTER_UNCATEGORIZED0x0100Unclassified computer.
COMPUTER_DESKTOP0x0104Desktop computer.
COMPUTER_SERVER0x0108Server.
COMPUTER_LAPTOP0x010CLaptop.
COMPUTER_HANDHELD_PC_PDA0x0110Hand-held computer.
COMPUTER_PALM_SIZE_PC_PDA0x0114Palmtop computer.
COMPUTER_WEARABLE0x0118Wearable computer.
COMPUTER_TABLET0x011CTablet.
PHONE_UNCATEGORIZED0x0200Unclassified mobile phone.
PHONE_CELLULAR0x0204Portable phone.
PHONE_CORDLESS0x0208Cordless phone.
PHONE_SMART0x020CSmartphone.
PHONE_MODEM_OR_GATEWAY0x0210Modem or gateway phone.
PHONE_ISDN0x0214ISDN phone.
NETWORK_FULLY_AVAILABLE0x0300Device with network fully available.
NETWORK_1_TO_17_UTILIZED0x0320Device used on network 1 to 17.
NETWORK_17_TO_33_UTILIZED0x0340Device used on network 17 to 33.
NETWORK_33_TO_50_UTILIZED0x0360Device used on network 33 to 50.
NETWORK_60_TO_67_UTILIZED0x0380Device used on network 60 to 67.
NETWORK_67_TO_83_UTILIZED0x03A0Device used on network 67 to 83.
NETWORK_83_TO_99_UTILIZED0x03C0Device used on network 83 to 99.
NETWORK_NO_SERVICE0x03E0Device without network service
AUDIO_VIDEO_UNCATEGORIZED0x0400Unclassified audio or video device.
AUDIO_VIDEO_WEARABLE_HEADSET0x0404Wearable audio or video headset.
AUDIO_VIDEO_HANDSFREE0x0408Hands-free audio or video device.
AUDIO_VIDEO_MICROPHONE0x0410Audio or video microphone.
AUDIO_VIDEO_LOUDSPEAKER0x0414Audio or video loudspeaker.
AUDIO_VIDEO_HEADPHONES0x0418Audio or video headphones.
AUDIO_VIDEO_PORTABLE_AUDIO0x041CPortable audio or video device.
AUDIO_VIDEO_CAR_AUDIO0x0420In-vehicle audio or video device.
AUDIO_VIDEO_SET_TOP_BOX0x0424Audio or video STB device.
AUDIO_VIDEO_HIFI_AUDIO0x0428High-fidelity speaker device.
AUDIO_VIDEO_VCR0x042CVideo cassette recording (VCR) device.
AUDIO_VIDEO_VIDEO_CAMERA0x0430Camera.
AUDIO_VIDEO_CAMCORDER0x0434Camcorder
AUDIO_VIDEO_VIDEO_MONITOR0x0438Audio or video monitor.
AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER0x043CVideo display or loudspeaker.
AUDIO_VIDEO_VIDEO_CONFERENCING0x0440Video conferencing device.
AUDIO_VIDEO_VIDEO_GAMING_TOY0x0448Audio or video gaming toy.
PERIPHERAL_NON_KEYBOARD_NON_POINTING0x0500Non-keyboard or non-pointing peripheral device.
PERIPHERAL_KEYBOARD0x0540Keyboard device.
PERIPHERAL_POINTING_DEVICE0x0580Pointing peripheral device.
PERIPHERAL_KEYBOARD_POINTING0x05C0Keyboard pointing device.
PERIPHERAL_UNCATEGORIZED0x0500Unclassified peripheral device.
PERIPHERAL_JOYSTICK0x0504Peripheral joystick.
PERIPHERAL_GAMEPAD0x0508Peripheral game pad
PERIPHERAL_REMOTE_CONTROL0x05C0Peripheral remote control device
PERIPHERAL_SENSING_DEVICE0x0510Peripheral sensing device.
PERIPHERAL_DIGITIZER_TABLET0x0514Peripheral digitizer tablet.
PERIPHERAL_CARD_READER0x0518Peripheral card reader.
PERIPHERAL_DIGITAL_PEN0x051CPeripheral digital pen.
PERIPHERAL_SCANNER_RFID0x0520Peripheral RFID scanner.
PERIPHERAL_GESTURAL_INPUT0x0522Gesture input device.
IMAGING_UNCATEGORIZED0x0600Unclassified imaging device.
IMAGING_DISPLAY0x0610Imaging display device.
IMAGING_CAMERA0x0620Imaging camera device.
IMAGING_SCANNER0x0640Imaging scanner.
IMAGING_PRINTER0x0680Imaging printer.
WEARABLE_UNCATEGORIZED0x0700Unclassified wearable device.
WEARABLE_WRIST_WATCH0x0704Smart watch.
WEARABLE_PAGER0x0708Wearable pager.
WEARABLE_JACKET0x070CSmart jacket.
WEARABLE_HELMET0x0710Wearable helmet.
WEARABLE_GLASSES0x0714Wearable glasses.
TOY_UNCATEGORIZED0x0800Unclassified toy.
TOY_ROBOT0x0804Toy robot.
TOY_VEHICLE0x0808Toy vehicle.
TOY_DOLL_ACTION_FIGURE0x080CHumanoid toy doll.
TOY_CONTROLLER0x0810Toy controller.
TOY_GAME0x0814Toy gaming device.
HEALTH_UNCATEGORIZED0x0900Unclassified health devices.
HEALTH_BLOOD_PRESSURE0x0904Blood pressure device.
HEALTH_THERMOMETER0x0908Thermometer
HEALTH_WEIGHING0x090CBody scale.
HEALTH_GLUCOSE0x0910Blood glucose monitor.
HEALTH_PULSE_OXIMETER0x0914Pulse oximeter.
HEALTH_PULSE_RATE0x0918Heart rate monitor.
HEALTH_DATA_DISPLAY0x091CHealth data display.
HEALTH_STEP_COUNTER0x0920Step counter.
HEALTH_BODY_COMPOSITION_ANALYZER0x0924Body composition analyzer.
HEALTH_PEAK_FLOW_MONITOR0x0928Hygrometer.
HEALTH_MEDICATION_MONITOR0x092CMedication monitor.
HEALTH_KNEE_PROSTHESIS0x0930Prosthetic knee.
HEALTH_ANKLE_PROSTHESIS0x0934Prosthetic ankle.
HEALTH_GENERIC_HEALTH_MANAGER0x0938Generic health management device.
HEALTH_PERSONAL_MOBILITY_DEVICE0x093CPersonal mobility device.

ProfileUuids12+

Enumerates the profile UUIDs.

System capability: SystemCapability.Communication.Bluetooth.Core

NameValueDescription
PROFILE_UUID_HFP_AG'0000111F-0000-1000-8000-00805F9B34FB'UUID of the HFPAG profile.
PROFILE_UUID_HFP_HF'0000111E-0000-1000-8000-00805F9B34FB'UUID of the HFPHF profile.
PROFILE_UUID_HSP_AG'00001112-0000-1000-8000-00805F9B34FB'UUID of the HSPAG profile.
PROFILE_UUID_HSP_HS'00001108-0000-1000-8000-00805F9B34FB'UUID of the HSPHS profile.
PROFILE_UUID_A2DP_SRC'0000110A-0000-1000-8000-00805F9B34FB'UUID of the A2DPSRC profile.
PROFILE_UUID_A2DP_SINK'0000110B-0000-1000-8000-00805F9B34FB'UUID of the A2DPSINK profile.
PROFILE_UUID_AVRCP_CT'0000110E-0000-1000-8000-00805F9B34FB'UUID of the AVRCPCT profile.
PROFILE_UUID_AVRCP_TG'0000110C-0000-1000-8000-00805F9B34FB'UUID of the AVRCPTG profile.
PROFILE_UUID_HID'00001124-0000-1000-8000-00805F9B34FB'UUID of the HID profile.
PROFILE_UUID_HOGP'00001812-0000-1000-8000-00805F9B34FB'UUID of the HOGP profile.

你可能感兴趣的鸿蒙文章

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)

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/qAp8FT