harmony 鸿蒙HID DDK

2025-06-12 浏览 (1)

HID DDK

Overview

Provides HID driver development kit (DDK) functions, including those for creating a device, sending events to a device, and destroying a device.

System capability: SystemCapability.Driver.HID.Extension

Since: 11

Summary

Files

NameDescription
hid_ddk_api.hDeclares the HID DDK functions for accessing an input device from the host.
File to include: <hid/hid_ddk_api.h>
Library: libhid.z.so
hid_ddk_types.hDefines the enum variables and structs used in the HID DDK.
File to include: <hid/hid_ddk_types.h>
Library: libhid.z.so

Structs

NameDescription
struct  Hid_EmitItemDefines event information.
struct  Hid_DeviceDefines basic device information.
struct  Hid_EventTypeArrayDefines an array of event types.
struct  Hid_KeyCodeArrayDefines an array of key codes.
struct  Hid_AbsAxesArrayDefines an array of absolute coordinates.
struct  Hid_RelAxesArrayDefines an array of relative coordinates.
struct  Hid_MscEventArrayDefines an array of miscellaneous events.
struct  Hid_EventPropertiesDefines the event properties of a device.
struct  Hid_RawDevInfoDefines the raw device information.

Macros

NameDescription
HID_MAX_REPORT_BUFFER_SIZE   (16 * 1024 - 1)Defines the maximum size of the report buffer.

Types

NameDescription
typedef struct Hid_EmitItem Hid_EmitItemDefines event information.
typedef struct Hid_Device Hid_DeviceDefines basic device information.
typedef struct Hid_EventTypeArray Hid_EventTypeArrayDefines an array of event types.
typedef struct Hid_KeyCodeArray Hid_KeyCodeArrayDefines an array of key codes.
typedef struct Hid_AbsAxesArray Hid_AbsAxesArrayDefines an array of absolute coordinates.
typedef struct Hid_RelAxesArray Hid_RelAxesArrayDefines an array of relative coordinates.
typedef struct Hid_MscEventArray Hid_MscEventArrayDefines an array of miscellaneous events.
typedef struct Hid_EventProperties Hid_EventPropertiesDefines the event properties of a device.
typedef struct Hid_DeviceHandle Hid_DeviceHandleDefines the opaque USB HID device structure.
typedef struct Hid_RawDevInfo Hid_RawDevInfoDefines the raw device information.

Enums

NameDescription
Hid_DeviceProp {
HID_PROP_POINTER = 0x00, HID_PROP_DIRECT = 0x01, HID_PROP_BUTTON_PAD = 0x02, HID_PROP_SEMI_MT = 0x03, HID_PROP_TOP_BUTTON_PAD = 0x04, HID_PROP_POINTING_STICK = 0x05, HID_PROP_ACCELEROMETER = 0x06
}
Enumerates the properties of input devices.
Hid_EventType {
HID_EV_SYN = 0x00, HID_EV_KEY = 0x01, HID_EV_REL = 0x02, HID_EV_ABS = 0x03, HID_EV_MSC = 0x04
}
Enumerates the event types.
Hid_SynEvent { HID_SYN_REPORT = 0, HID_SYN_CONFIG = 1, HID_SYN_MT_REPORT = 2, HID_SYN_DROPPED = 3 }Enumerates sync events.
Hid_KeyCode {
HID_KEY_A = 30, HID_KEY_B = 48, HID_KEY_C = 46, HID_KEY_D = 32, HID_KEY_E = 18, HID_KEY_F = 33, HID_KEY_G = 34, HID_KEY_H = 35, HID_KEY_I = 23, HID_KEY_J = 36, HID_KEY_K = 37, HID_KEY_L = 38, HID_KEY_M = 50, HID_KEY_N = 49, HID_KEY_O = 24, HID_KEY_P = 25, HID_KEY_Q = 16, HID_KEY_R = 19, HID_KEY_S = 31, HID_KEY_T = 20, HID_KEY_U = 22, HID_KEY_V = 47, HID_KEY_W = 17, HID_KEY_X = 45, HID_KEY_Y = 21, HID_KEY_Z = 44, HID_KEY_ESC = 1, HID_KEY_0 = 11, HID_KEY_1 = 2, HID_KEY_2 = 3, HID_KEY_3 = 4, HID_KEY_4 = 5, HID_KEY_5 = 6, HID_KEY_6 = 7, HID_KEY_7 = 8, HID_KEY_8 = 9, HID_KEY_9 = 10, HID_KEY_GRAVE = 41, HID_KEY_MINUS = 12, HID_KEY_EQUALS = 13, HID_KEY_BACKSPACE = 14, HID_KEY_LEFT_BRACKET = 26, HID_KEY_RIGHT_BRACKET = 27, HID_KEY_ENTER = 28, HID_KEY_LEFT_SHIFT = 42, HID_KEY_BACKSLASH = 43, HID_KEY_SEMICOLON = 39, HID_KEY_APOSTROPHE = 40, HID_KEY_SPACE = 57, HID_KEY_SLASH = 53, HID_KEY_COMMA = 51, HID_KEY_PERIOD = 52, HID_KEY_RIGHT_SHIFT = 54, HID_KEY_NUMPAD_0 = 82, HID_KEY_NUMPAD_1 = 79, HID_KEY_NUMPAD_2 = 80, HID_KEY_NUMPAD_3 = 81, HID_KEY_NUMPAD_4 = 75, HID_KEY_NUMPAD_5 = 76, HID_KEY_NUMPAD_6 = 77, HID_KEY_NUMPAD_7 = 71, HID_KEY_NUMPAD_8 = 72, HID_KEY_NUMPAD_9 = 73, HID_KEY_NUMPAD_DIVIDE = 70, HID_KEY_NUMPAD_MULTIPLY = 55, HID_KEY_NUMPAD_SUBTRACT = 74, HID_KEY_NUMPAD_ADD = 78, HID_KEY_NUMPAD_DOT = 83, HID_KEY_SYSRQ = 99, HID_KEY_DELETE = 111, HID_KEY_MUTE = 113, HID_KEY_VOLUME_DOWN = 114, HID_KEY_VOLUME_UP = 115, HID_KEY_BRIGHTNESS_DOWN = 224, HID_KEY_BRIGHTNESS_UP = 225, HID_BTN_0 = 0x100, HID_BTN_1 = 0x101, HID_BTN_2 = 0x102, HID_BTN_3 = 0x103, HID_BTN_4 = 0x104, HID_BTN_5 = 0x105, HID_BTN_6 = 0x106, HID_BTN_7 = 0x107, HID_BTN_8 = 0x108, HID_BTN_9 = 0x109, HID_BTN_LEFT = 0x110, HID_BTN_RIGHT = 0x111, HID_BTN_MIDDLE = 0x112, HID_BTN_SIDE = 0x113, HID_BTN_EXTRA = 0x114, HID_BTN_FORWARD = 0x115, HID_BTN_BACKWARD = 0x116, HID_BTN_TASK = 0x117, HID_BTN_TOOL_PEN = 0x140, HID_BTN_TOOL_RUBBER = 0x141, HID_BTN_TOOL_BRUSH = 0x142, HID_BTN_TOOL_PENCIL = 0x143, HID_BTN_TOOL_AIRBRUSH = 0x144, HID_BTN_TOOL_FINGER = 0x145, HID_BTN_TOOL_MOUSE = 0x146, HID_BTN_TOOL_LENS = 0x147, HID_BTN_TOOL_QUINT_TAP = 0x148, HID_BTN_STYLUS3 = 0x149, HID_BTN_TOUCH = 0x14a, HID_BTN_STYLUS = 0x14b, HID_BTN_STYLUS2 = 0x14c, HID_BTN_TOOL_DOUBLE_TAP = 0x14d, HID_BTN_TOOL_TRIPLE_TAP = 0x14e, HID_BTN_TOOL_QUAD_TAP = 0x14f, HID_BTN_WHEEL = 0x150
}
Enumerates the key codes.
Hid_AbsAxes {
HID_ABS_X = 0x00, HID_ABS_Y = 0x01, HID_ABS_Z = 0x02, HID_ABS_RX = 0x03, HID_ABS_RY = 0x04, HID_ABS_RZ = 0x05, HID_ABS_THROTTLE = 0x06, HID_ABS_RUDDER = 0x07, HID_ABS_WHEEL = 0x08, HID_ABS_GAS = 0x09, HID_ABS_BRAKE = 0x0a, HID_ABS_HAT0X = 0x10, HID_ABS_HAT0Y = 0x11, HID_ABS_HAT1X = 0x12, HID_ABS_HAT1Y = 0x13, HID_ABS_HAT2X = 0x14, HID_ABS_HAT2Y = 0x15, HID_ABS_HAT3X = 0x16, HID_ABS_HAT3Y = 0x17, HID_ABS_PRESSURE = 0x18, HID_ABS_DISTANCE = 0x19, HID_ABS_TILT_X = 0x1a, HID_ABS_TILT_Y = 0x1b, HID_ABS_TOOL_WIDTH = 0x1c, HID_ABS_VOLUME = 0x20, HID_ABS_MISC = 0x28
}
Enumerates the absolute coordinates.
Hid_RelAxes {
HID_REL_X = 0x00, HID_REL_Y = 0x01, HID_REL_Z = 0x02, HID_REL_RX = 0x03, HID_REL_RY = 0x04, HID_REL_RZ = 0x05, HID_REL_HWHEEL = 0x06, HID_REL_DIAL = 0x07, HID_REL_WHEEL = 0x08, HID_REL_MISC = 0x09, HID_REL_RESERVED = 0x0a, HID_REL_WHEEL_HI_RES = 0x0b, HID_REL_HWHEEL_HI_RES = 0x0c
}
Enumerates the relative coordinates.
Hid_MscEvent {
HID_MSC_SERIAL = 0x00, HID_MSC_PULSE_LED = 0x01, HID_MSC_GESTURE = 0x02, HID_MSC_RAW = 0x03, HID_MSC_SCAN = 0x04, HID_MSC_TIMESTAMP = 0x05
}
Enumerates miscellaneous input events.
Hid_DdkErrCode {
HID_DDK_SUCCESS = 0, HID_DDK_NO_PERM = 201, HID_DDK_INVALID_PARAMETER = 401, HID_DDK_FAILURE = 27300001, HID_DDK_NULL_PTR = 27300002, HID_DDK_INVALID_OPERATION = 27300003, HID_DDK_TIMEOUT = 27300004, HID_DDK_INIT_ERROR = 27300005, HID_DDK_SERVICE_ERROR = 27300006, HID_DDK_MEMORY_ERROR = 27300007, HID_DDK_IO_ERROR = 27300008, HID_DDK_DEVICE_NOT_FOUND = 27300009
}
Enumerates the HID DDK error codes.
Hid_ReportType { HID_INPUT_REPORT = 0, HID_OUTPUT_REPORT = 1, HID_FEATURE_REPORT = 2 }Defines the report (data packets exchanged between the HID device and the host) type.

Functions

NameDescription
int32_t OH_Hid_CreateDevice (Hid_Device *hidDevice, Hid_EventProperties *hidEventProperties)Creates a device.
int32_t OH_Hid_EmitEvent (int32_t deviceId, const Hid_EmitItem items[], uint16_t length)Sends an event list to a device.
int32_t OH_Hid_DestroyDevice (int32_t deviceId)Destroys a device.
int32_t OH_Hid_Init (void)Initializes an HID DDK.
int32_t OH_Hid_Release (void)Releases an HID DDK.
int32_t OH_Hid_Open (uint64_t deviceId, uint8_t interfaceIndex, Hid_DeviceHandle **dev)Opens the device specified by deviceId and interfaceIndex.
int32_t OH_Hid_Close (Hid_DeviceHandle **dev)Closes an HID device.
int32_t OH_Hid_Write (Hid_DeviceHandle *dev, uint8_t *data, uint32_t length, uint32_t *bytesWritten)Writes reports to an HID device.
int32_t OH_Hid_ReadTimeout (Hid_DeviceHandle *dev, uint8_t *data, uint32_t bufSize, int timeout, uint32_t *bytesRead)Reads reports from the HID device within the specified timeout interval.
int32_t OH_Hid_Read (Hid_DeviceHandle *dev, uint8_t *data, uint32_t bufSize, uint32_t *bytesRead)Reads reports from the HID device. The blocking mode (that is, blocking remains active until data can be read) is used by default. You can call OH_Hid_SetNonBlocking to change the mode.
int32_t OH_Hid_SetNonBlocking (Hid_DeviceHandle *dev, int nonBlock)Sets the device read mode to non-blocking mode.
int32_t OH_Hid_GetRawInfo (Hid_DeviceHandle *dev, Hid_RawDevInfo *rawDevInfo)Obtains the original device information.
int32_t OH_Hid_GetRawName (Hid_DeviceHandle *dev, char *data, uint32_t bufSize)Obtains the original device name.
int32_t OH_Hid_GetPhysicalAddress (Hid_DeviceHandle *dev, char *data, uint32_t bufSize)Obtains the physical address of the HID device.
int32_t OH_Hid_GetRawUniqueId (Hid_DeviceHandle *dev, uint8_t *data, uint32_t bufSize)Obtains the original unique identifier of a device.
int32_t OH_Hid_SendReport (Hid_DeviceHandle *dev, Hid_ReportType reportType, const uint8_t *data, uint32_t length)Sends reports to the HID device.
int32_t OH_Hid_GetReport (Hid_DeviceHandle *dev, Hid_ReportType reportType, uint8_t *data, uint32_t bufSize)Obtains reports from the HID device.
int32_t OH_Hid_GetReportDescriptor (Hid_DeviceHandle *dev, uint8_t *buf, uint32_t bufSize, uint32_t *bytesRead)Obtains the report descriptor of the HID device.

Variables

NameDescription
uint16_t Hid_EmitItem::typeEnumerates the event types.
uint16_t Hid_EmitItem::codeEvent code.
uint32_t Hid_EmitItem::valueEvent value.
const char * Hid_Device::deviceNameDevice name.
uint16_t Hid_Device::vendorIdVendor ID.
uint16_t Hid_Device::productIdProduct ID.
uint16_t Hid_Device::versionVersion.
uint16_t Hid_Device::bustypeBus type.
Hid_DeviceProp * Hid_Device::propertiesDevice properties.
uint16_t Hid_Device::propLengthNumber of device properties.
Hid_EventType * Hid_EventTypeArray::hidEventTypeEvent type.
uint16_t Hid_EventTypeArray::lengthSize of the array.
Hid_KeyCode * Hid_KeyCodeArray::hidKeyCodeEnumerates the key codes.
uint16_t Hid_KeyCodeArray::lengthSize of the array.
Hid_AbsAxes * Hid_AbsAxesArray::hidAbsAxesArray of absolute coordinates.
uint16_t Hid_AbsAxesArray::lengthSize of the array.
Hid_RelAxes * Hid_RelAxesArray::hidRelAxesRelative coordinate.
uint16_t Hid_RelAxesArray::lengthSize of the array.
Hid_MscEvent * Hid_MscEventArray::hidMscEventMiscellaneous event.
uint16_t Hid_MscEventArray::lengthSize of the array.
struct Hid_EventTypeArrayHid_EventProperties::hidEventTypesArray of event types.
struct Hid_KeyCodeArrayHid_EventProperties::hidKeysArray of key codes.
struct Hid_AbsAxesArrayHid_EventProperties::hidAbsArray of absolute coordinates.
struct Hid_RelAxesArrayHid_EventProperties::hidRelBitsArray of relative coordinates.
struct Hid_MscEventArrayHid_EventProperties::hidMiscellaneousArray of miscellaneous events.
int32_t Hid_EventProperties::hidAbsMax [64]Maximum values of the absolute coordinates.
int32_t Hid_EventProperties::hidAbsMin [64]Minimum values of the absolute coordinates.
int32_t Hid_EventProperties::hidAbsFuzz [64]Fuzzy values of the absolute coordinates.
int32_t Hid_EventProperties::hidAbsFlat [64]Fixed values of the absolute coordinates.
uint32_t Hid_RawDevInfo::busTypeBus type.
uint16_t Hid_RawDevInfo::vendorProvider ID.
uint16_t Hid_RawDevInfo::productProduct ID.

Macro Description

HID_MAX_REPORT_BUFFER_SIZE

#define HID_MAX_REPORT_BUFFER_SIZE   (16 * 1024 - 1)

Description

Defines the maximum size of the report buffer.

Since: 18

Type Description

Hid_AbsAxesArray

typedef struct Hid_AbsAxesArray Hid_AbsAxesArray

Description

Defines a struct for an array of absolute coordinates.

Since: 11

Hid_Device

typedef struct Hid_Device Hid_Device

Description

Defines a struct for basic device information.

Since: 11

Hid_DeviceHandle

typedef struct Hid_DeviceHandle Hid_DeviceHandle

Description

Defines the opaque USB HID device structure.

Since: 18

Hid_EmitItem

typedef struct Hid_EmitItem Hid_EmitItem

Description

Defines a struct for event information.

Since: 11

Hid_EventProperties

typedef struct Hid_EventProperties Hid_EventProperties

Description

Defines a struct for the event properties of a device.

Since: 11

Hid_EventTypeArray

typedef struct Hid_EventTypeArray Hid_EventTypeArray

Description

Defines a struct for an array of event types.

Since: 11

Hid_KeyCodeArray

typedef struct Hid_KeyCodeArray Hid_KeyCodeArray

Description

Defines a struct for an array of key codes.

Since: 11

Hid_MscEventArray

typedef struct Hid_MscEventArray Hid_MscEventArray

Description

Defines a struct for an array of miscellaneous events.

Since: 11

Hid_RawDevInfo

typedef struct Hid_RawDevInfo Hid_RawDevInfo

Description

Defines the raw device information.

Since: 18

Hid_RelAxesArray

typedef struct Hid_RelAxesArray Hid_RelAxesArray

Description

Defines a struct for an array of relative coordinates.

Since: 11

Enum Description

Hid_AbsAxes

enum Hid_AbsAxes

Description

Enumerates the absolute coordinates.

Since: 11

ValueDescription
HID_ABS_XX axis.
HID_ABS_YY axis.
HID_ABS_ZZ axis.
HID_ABS_RXX axis of the right analog stick.
HID_ABS_RYY axis of the right analog stick.
HID_ABS_RZZ axis of the right analog stick.
HID_ABS_THROTTLEThrottle.
HID_ABS_RUDDERRudder.
HID_ABS_WHEELScroll wheel.
HID_ABS_GASGas.
HID_ABS_BRAKEBrake.
HID_ABS_HAT0XHAT0X.
HID_ABS_HAT0YHAT0Y.
HID_ABS_HAT1XHAT1X.
HID_ABS_HAT1YHAT1Y.
HID_ABS_HAT2XHAT2X.
HID_ABS_HAT2YHAT2Y.
HID_ABS_HAT3XHAT3X.
HID_ABS_HAT3YHAT3Y.
HID_ABS_PRESSUREPressure.
HID_ABS_DISTANCEDistance.
HID_ABS_TILT_XTilt of X axis.
HID_ABS_TILT_YTilt of Y axis.
HID_ABS_TOOL_WIDTHWidth of the touch tool.
HID_ABS_VOLUMEVolume.
HID_ABS_MISCOthers.

Hid_DdkErrCode

enum Hid_DdkErrCode

Description

Enumerates the HID DDK error codes.

Since: 11

ValueDescription
HID_DDK_SUCCESSOperation succeeded.
HID_DDK_NO_PERMNo permission. The value is changed from -6 to 201 since API version 16.
HID_DDK_INVALID_PARAMETERInvalid parameter. The value is changed from -2 to 401 since API version 16.
HID_DDK_FAILUREOperation failed. The value is changed from -1 to 27300001 since API version 16.
HID_DDK_NULL_PTRNull pointer. The value is changed from -4 to 27300002 since API version 16.
HID_DDK_INVALID_OPERATIONInvalid operation. The value is changed from -3 to 27300003 since API version 16.
HID_DDK_TIMEOUTTimeout. The value is changed from -5 to 27300004 since API version 16.
HID_DDK_INIT_ERRORDDK initialization error. This enum is supported since API version 16.
HID_DDK_SERVICE_ERRORService communication error. This enum is supported since API version 16.
HID_DDK_MEMORY_ERRORMemory-related errors, such as memory data copy failure and memory allocation failure. This enum is supported since API version 16.
HID_DDK_IO_ERRORI/O operation failure. This enum is supported since API version 16.
HID_DDK_DEVICE_NOT_FOUNDDevice not found. This enum is supported since API version 16.

Hid_DeviceProp

enum Hid_DeviceProp

Description

Enumerates the properties of input devices.

Since: 11

ValueDescription
HID_PROP_POINTERPointer device.
HID_PROP_DIRECTDirect input device.
HID_PROP_BUTTON_PADTouch device with bottom keys.
HID_PROP_SEMI_MTFull multi-touch device.
HID_PROP_TOP_BUTTON_PADTouch device with top soft keys.
HID_PROP_POINTING_STICKPointing stick.
HID_PROP_ACCELEROMETERAccelerometer.

Hid_EventType

enum Hid_EventType

Description

Enumerates the event types.

Since: 11

ValueDescription
HID_EV_SYNSync event.
HID_EV_KEYKey event.
HID_EV_RELRelative coordinate event.
HID_EV_ABSAbsolute coordinate event.
HID_EV_MSCMiscellaneous event.

Hid_KeyCode

enum Hid_KeyCode

Description

Enumerates the key codes.

Since: 11

ValueDescription
HID_KEY_AKey A
HID_KEY_BKey B
HID_KEY_CKey C
HID_KEY_DKey D
HID_KEY_EKey E
HID_KEY_FKey F
HID_KEY_GKey G
HID_KEY_HKey H
HID_KEY_IKey I
HID_KEY_JKey J
HID_KEY_KKey K
HID_KEY_LKey L
HID_KEY_MKey M
HID_KEY_NKey N
HID_KEY_OKey O
HID_KEY_PKey P
HID_KEY_QKey Q
HID_KEY_RKey R
HID_KEY_SKey S
HID_KEY_TKey T
HID_KEY_UKey U
HID_KEY_VKey V
HID_KEY_WKey W
HID_KEY_XKey X
HID_KEY_YKey Y
HID_KEY_ZKey Z
HID_KEY_ESCKey Esc
HID_KEY_0Key 0
HID_KEY_1Key 1
HID_KEY_2Key 2
HID_KEY_3Key 3
HID_KEY_4Key 4
HID_KEY_5Key 5
HID_KEY_6Key 6
HID_KEY_7Key 7
HID_KEY_8Key 8
HID_KEY_9Key 9
HID_KEY_GRAVEKey `
HID_KEY_MINUSKey -
HID_KEY_EQUALSKey =
HID_KEY_BACKSPACEkey Backspace
HID_KEY_LEFT_BRACKETKey [
HID_KEY_RIGHT_BRACKETKey ]
HID_KEY_ENTERKey Enter
HID_KEY_LEFT_SHIFTLeft Shift
HID_KEY_BACKSLASHKey |
HID_KEY_SEMICOLONKey ;
HID_KEY_APOSTROPHEKey '
HID_KEY_SPACEKey Space
HID_KEY_SLASHKey /
HID_KEY_COMMAKey ,
HID_KEY_PERIODKey .
HID_KEY_RIGHT_SHIFTRight Shift
HID_KEY_NUMPAD_0Numeral 0 on the numeric keypad
HID_KEY_NUMPAD_1Numeral 1 on the numeric keypad
HID_KEY_NUMPAD_2Numeral 2 on the numeric keypad
HID_KEY_NUMPAD_3Numeral 3 on the numeric keypad
HID_KEY_NUMPAD_4Numeral 4 on the numeric keypad
HID_KEY_NUMPAD_5Numeral 5 on the numeric keypad
HID_KEY_NUMPAD_6Numeral 6 on the numeric keypad
HID_KEY_NUMPAD_7Numeral 7 on the numeric keypad
HID_KEY_NUMPAD_8Numeral 8 on the numeric keypad
HID_KEY_NUMPAD_9Numeral 9 on the numeric keypad
HID_KEY_NUMPAD_DIVIDEKey / on the numeric keypad
HID_KEY_NUMPAD_MULTIPLYKey * on the numeric keypad
HID_KEY_NUMPAD_SUBTRACTKey - on the numeric keypad
HID_KEY_NUMPAD_ADDKey + on the numeric keypad
HID_KEY_NUMPAD_DOTKey . on the numeric keypad
HID_KEY_SYSRQSYSRQ key
HID_KEY_DELETEDelete key
HID_KEY_MUTEMute key
HID_KEY_VOLUME_DOWNVolume Down key
HID_KEY_VOLUME_UPVolume Down key
HID_KEY_BRIGHTNESS_DOWNBrightness Down key
HID_KEY_BRIGHTNESS_UPBrightness Up key
HID_BTN_0Button 0
HID_BTN_1Button 1
HID_BTN_2Button 2
HID_BTN_3Button 3
HID_BTN_4Button 4
HID_BTN_5Button 5
HID_BTN_6Button 6
HID_BTN_7Button 7
HID_BTN_8Button 8
HID_BTN_9Button 9
HID_BTN_LEFTLeft mouse button
HID_BTN_RIGHTRight mouse button
HID_BTN_MIDDLEMiddle mouse button
HID_BTN_SIDESide mouse button
HID_BTN_EXTRAExtra mouse button
HID_BTN_FORWARDMouse forward button
HID_BTN_BACKWARDMouse backward button
HID_BTN_TASKMouse task button
HID_BTN_TOOL_PENPen
HID_BTN_TOOL_RUBBERRubber
HID_BTN_TOOL_BRUSHBrush
HID_BTN_TOOL_PENCILPencil
HID_BTN_TOOL_AIRBRUSHAir brush
HID_BTN_TOOL_FINGERFinger
HID_BTN_TOOL_MOUSEMouse
HID_BTN_TOOL_LENSLens
HID_BTN_TOOL_QUINT_TAPFive-finger touch
HID_BTN_STYLUS3Stylus 3
HID_BTN_TOUCHTouch
HID_BTN_STYLUSStylus
HID_BTN_STYLUS2Stylus 2
HID_BTN_TOOL_DOUBLE_TAPTwo-finger touch
HID_BTN_TOOL_TRIPLE_TAPThree-finger touch
HID_BTN_TOOL_QUAD_TAPFour-finger touch
HID_BTN_WHEELScroll wheel

Hid_MscEvent

enum Hid_MscEvent

Description

Enumerates miscellaneous input events.

Since: 11

ValueDescription
HID_MSC_SERIALSerial number
HID_MSC_PULSE_LEDPulse
HID_MSC_GESTUREGesture
HID_MSC_RAWStart event
HID_MSC_SCANScan
HID_MSC_TIMESTAMPTimestamp

Hid_RelAxes

enum Hid_RelAxes

Description

Enumerates the relative coordinates.

Since: 11

ValueDescription
HID_REL_XX axis.
HID_REL_YY axis.
HID_REL_ZZ axis
HID_REL_RXX axis of the right analog stick
HID_REL_RYY axis of the right analog stick
HID_REL_RZZ axis of the right analog stick
HID_REL_HWHEELHorizontal scroll wheel
HID_REL_DIALScale
HID_REL_WHEELScroll wheel
HID_REL_MISCOthers
HID_REL_RESERVEDReserved
HID_REL_WHEEL_HI_RESHigh-resolution scroll wheel
HID_REL_HWHEEL_HI_RESHigh-resolution horizontal scroll wheel

Hid_ReportType

enum Hid_ReportType

Description

Defines the report (data packets exchanged between the HID device and the host) type.

Since: 18

ValueDescription
HID_INPUT_REPORTInput report.
HID_OUTPUT_REPORTOutput report.
HID_FEATURE_REPORTFeature report.

Hid_SynEvent

enum Hid_SynEvent

Description

Enumerates sync events.

Since: 11

ValueDescription
HID_SYN_REPORTEnd of an event.
HID_SYN_CONFIGConfiguration synchronization.
HID_SYN_MT_REPORTEnd of a multi-touch ABS data packet.
HID_SYN_DROPPEDEvent discarded.

Function Description

OH_Hid_Close()

int32_t OH_Hid_Close (Hid_DeviceHandle ** dev)

Description

Closes an HID device.

Since: 18

Parameters

NameDescription
devDevice operation handle.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_PARAMETER: Empty dev.

OH_Hid_CreateDevice()

int32_t OH_Hid_CreateDevice (Hid_Device * hidDevice, Hid_EventProperties * hidEventProperties)

Description

Creates a device.

Since: 11

Parameters

NameDescription
hidDevicePointer to the basic information about the device to create, including the device name, vendor ID, and product ID.
hidEventPropertiesPointer to the event properties related to the device to create, including the event type, key event properties, absolute coordinate event properties, and relative coordinate event properties.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • deviceID (a non-negative number) if the API call is successful.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_OPERATION: hid_ddk service connection failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. The input hidDevice is a null pointer. 2. The input hidEventProperties is a null pointer. 3. The length of properties exceeds 7 characters. 4. The length of hidEventTypes exceeds 5 characters. 5. The length of hidKeys exceeds 100 characters. 6. The length of hidAbs exceeds 26 characters. 7. The length of hidRelBits exceeds 13 characters. 8. The length of hidMiscellaneous exceeds 6 characters.

  • HID_DDK_FAILURE: Number of devices exceeding the maximum value (200).

OH_Hid_DestroyDevice()

int32_t OH_Hid_DestroyDevice (int32_t deviceId)

Description

Destroys a device.

Since: 11

Parameters

NameDescription
deviceIdDevice ID.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_OPERATION: Invalid operation. The hid_ddk service connection fails or the caller is not the device creator.

  • HID_DDK_FAILURE: Device not exist.

OH_Hid_EmitEvent()

int32_t OH_Hid_EmitEvent (int32_t deviceId, const Hid_EmitItem items[], uint16_t length)

Description

Sends an event list to a device.

Since: 11

Parameters

NameDescription
deviceIdDevice ID.
itemsList of the events to send. The event information includes the event type (Hid_EventType), code (Hid_SynEvent, Hid_KeyCode, HidBtnCode, Hid_AbsAxes, Hid_RelAxes, or Hid_MscEvent), and value (depending on the actual device input).
lengthLength of the event list (number of events to be sent at a time).

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_OPERATION: Invalid operation. The hid_ddk service connection fails or the caller is not the device creator.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. The device ID is smaller than 0. 2. The length of the input parameter exceeds 7 characters. 3. The input items is a null pointer.

  • HID_DDK_NULL_PTR: Null pointer. The input device is empty.

  • HID_DDK_FAILURE: Device not exist.

OH_Hid_GetPhysicalAddress()

int32_t OH_Hid_GetPhysicalAddress (Hid_DeviceHandle * dev, char * data, uint32_t bufSize)

Description

Obtains the physical address of the HID device.

Since: 18

Parameters

NameDescription
devDevice operation handle.
dataBuffer for storing the read data.
bufSizeSize of the buffer for storing read data. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. data is empty. 3. The value of bufSize is 0. 4. The value of bufSize exceeds HID_MAX_REPORT_BUFFER_SIZE. HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_MEMORY_ERROR: Memory data copy error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_OPERATION: Invalid operation.

OH_Hid_GetRawInfo()

int32_t OH_Hid_GetRawInfo (Hid_DeviceHandle * dev, Hid_RawDevInfo * rawDevInfo)

Description

Obtains the original device information.

Since: 18

Parameters

NameDescription
devDevice operation handle.
rawDevInfoOriginal device information, including the vendor ID, product ID, and bus type.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. rawDevInfo is empty.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_OPERATION: Invalid operation.

OH_Hid_GetRawName()

int32_t OH_Hid_GetRawName (Hid_DeviceHandle * dev, char * data, uint32_t bufSize)

Description

Obtains the original device name.

Since: 18

Parameters

NameDescription
devDevice operation handle.
dataBuffer for storing the read data.
bufSizeSize of the buffer for storing read data. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. data is empty. 3. The value of bufSize is 0. 4. The value of bufSize exceeds HID_MAX_REPORT_BUFFER_SIZE. HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_MEMORY_ERROR: Memory data copy error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_OPERATION: Invalid operation.

OH_Hid_GetRawUniqueId()

int32_t OH_Hid_GetRawUniqueId (Hid_DeviceHandle * dev, uint8_t * data, uint32_t bufSize)

Description

Obtains the original unique identifier of a device.

Since: 18

Parameters

NameDescription
devDevice operation handle.
dataBuffer for storing the read data.
bufSizeSize of the buffer for storing read data. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. data is empty. 3. The value of bufSize is 0. 4. The value of bufSize exceeds HID_MAX_REPORT_BUFFER_SIZE. HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_MEMORY_ERROR: Memory data copy error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_OPERATION: Invalid operation.

OH_Hid_GetReport()

int32_t OH_Hid_GetReport (Hid_DeviceHandle * dev, Hid_ReportType reportType, uint8_t * data, uint32_t bufSize)

Description

Obtains reports from the HID device.

Since: 18

Parameters

NameDescription
devDevice operation handle.
reportTypeReport type.
dataBuffer for storing the read data.
bufSizeSize of the buffer for storing read data. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. data is empty. 3. The value of bufSize is 0. 4. The value of bufSize exceeds HID_MAX_REPORT_BUFFER_SIZE.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_MEMORY_ERROR: Memory data copy error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_OPERATION: Invalid operation.

OH_Hid_GetReportDescriptor()

int32_t OH_Hid_GetReportDescriptor (Hid_DeviceHandle * dev, uint8_t * buf, uint32_t bufSize, uint32_t * bytesRead)

Description

Obtains the report descriptor of the HID device.

Since: 18

Parameters

NameDescription
devDevice operation handle.
bufBuffer for storing descriptors.
bufSizeSize of the buffer, in bytes. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.
bytesReadNumber of bytes to read.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. buf is empty. 3. The value of bufSize is 0. 4. The value of bufSize exceeds that of HID_MAX_REPORT_BUFFER_SIZE. 5. bytesRead is empty.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_MEMORY_ERROR: Memory data copy error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_OPERATION: Invalid operation.

OH_Hid_Init()

int32_t OH_Hid_Init (void)

Description

Initializes an HID DDK.

Since: 18

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INIT_ERROR: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

OH_Hid_Open()

int32_t OH_Hid_Open (uint64_t deviceId, uint8_t interfaceIndex, Hid_DeviceHandle ** dev)

Description

Opens the device specified by deviceId and interfaceIndex.

Since: 18

Parameters

NameDescription
deviceIdDevice ID.
interfaceIndexInterface index for the API of the HID device.
devDevice operation handle.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_MEMORY_ERROR: dev memory application error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_PARAMETER: Empty dev.

  • HID_DDK_DEVICE_NOT_FOUND: Device not found based on the specified deviceId and interfaceIndex.

OH_Hid_Read()

int32_t OH_Hid_Read (Hid_DeviceHandle * dev, uint8_t * data, uint32_t bufSize, uint32_t * bytesRead)

Description

Reads reports from the HID device. The blocking mode (that is, blocking remains active until data can be read) is used by default. You can call OH_Hid_SetNonBlocking to change the mode.

Since: 18

Parameters

NameDescription
devDevice operation handle.
dataBuffer for storing the read data.
bufSizeSize of the buffer for storing read data. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.
bytesReadNumber of bytes to read.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. data is empty. 3. The value of bufSize is 0. 4. The value of bufSize exceeds that of HID_MAX_REPORT_BUFFER_SIZE. 5. bytesRead is empty.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_MEMORY_ERROR: Memory data copy error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_TIMEOUT: Reading timed out.

OH_Hid_ReadTimeout()

int32_t OH_Hid_ReadTimeout (Hid_DeviceHandle * dev, uint8_t * data, uint32_t bufSize, int timeout, uint32_t * bytesRead)

Description

Reads reports from the HID device within the specified timeout interval.

Since: 18

Parameters

NameDescription
devDevice operation handle.
dataBuffer for storing the read data.
bufSizeSize of the buffer for storing read data. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.
timeoutTimeout interval, in ms. The value -1 indicates block waiting.
bytesReadNumber of bytes to read.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. data is empty. 3. The value of bufSize is 0. 4. The value of bufSize exceeds that of HID_MAX_REPORT_BUFFER_SIZE. 5. bytesRead is empty.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_MEMORY_ERROR: Memory data copy error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_TIMEOUT: Reading timed out.

OH_Hid_Release()

int32_t OH_Hid_Release (void)

Description

Releases an HID DDK.

Since: 18

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

OH_Hid_SendReport()

int32_t OH_Hid_SendReport (Hid_DeviceHandle * dev, Hid_ReportType reportType, const uint8_t * data, uint32_t length)

Description

Sends reports to the HID device.

Since: 18

Parameters

NameDescription
devDevice operation handle.
reportTypeReport type.
dataData to be sent.
lengthLength of the data to be sent, in bytes. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. data is empty. 3. The value of length is 0; 4. The value of length exceeds HID_MAX_REPORT_BUFFER_SIZE.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_IO_ERROR: I/O operation error.

  • HID_DDK_INVALID_OPERATION: Invalid operation.

OH_Hid_SetNonBlocking()

int32_t OH_Hid_SetNonBlocking (Hid_DeviceHandle * dev, int nonBlock)

Description

Sets the device read mode to non-blocking mode.

Since: 18

Parameters

NameDescription
devDevice operation handle.
nonBlockWhether to enable the non-blocking mode for reading data.
- 1: The non-blocking mode is enabled. When OH_Hid_Read is called, if the device has readable data, HID_DDK_SUCCESS is returned; if the device has no readable data, HID_DDK_TIMEOUT is returned.
- 0: The non-blocking mode is disabled.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. The value of nonBlock is not 1 or 0.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

OH_Hid_Write()

int32_t OH_Hid_Write (Hid_DeviceHandle * dev, uint8_t * data, uint32_t length, uint32_t * bytesWritten)

Description

Writes reports to an HID device.

Since: 18

Parameters

NameDescription
devDevice operation handle.
dataData to be written.
lengthLength of the data to be written, in bytes. The value cannot exceed HID_MAX_REPORT_BUFFER_SIZE.
bytesWrittenNumber of written bytes.

Required Permissions

ohos.permission.ACCESS_DDK_HID

Returns

  • HID_DDK_SUCCESS: Operation succeeded.

  • HID_DDK_NO_PERM: Permission verification failed.

  • HID_DDK_INVALID_PARAMETER: Parameter verification failed. Possible causes: 1. dev is empty. 2. data is empty. 3. The value of length is 0; 4. The value of length exceeds HID_MAX_REPORT_BUFFER_SIZE; 5. bytesWritten is empty.

  • HID_DDK_INIT_ERROR DDK: DDK initialization error.

  • HID_DDK_SERVICE_ERROR: DDK service communication error.

  • HID_DDK_IO_ERROR: I/O operation error.

Variable Description

bustype

uint16_t Hid_Device::bustype

Description

Bus type.

busType

uint32_t Hid_RawDevInfo::busType

Description

Bus type.

code

uint16_t Hid_EmitItem::code

Description

Event code.

deviceName

const char* Hid_Device::deviceName

Description

Device name.

hidAbs

struct Hid_AbsAxesArray Hid_EventProperties::hidAbs

Description

Array of absolute coordinates.

hidAbsAxes

Hid_AbsAxes* Hid_AbsAxesArray::hidAbsAxes

Description

Array of absolute coordinates.

hidAbsFlat

int32_t Hid_EventProperties::hidAbsFlat[64]

Description

Fixed values of the absolute coordinates.

hidAbsFuzz

int32_t Hid_EventProperties::hidAbsFuzz[64]

Description

Fuzzy values of the absolute coordinates.

hidAbsMax

int32_t Hid_EventProperties::hidAbsMax[64]

Description

Maximum values of the absolute coordinates.

hidAbsMin

int32_t Hid_EventProperties::hidAbsMin[64]

Description

Minimum values of the absolute coordinates.

hidEventType

Hid_EventType* Hid_EventTypeArray::hidEventType

Description

Event type.

hidEventTypes

struct Hid_EventTypeArray Hid_EventProperties::hidEventTypes

Description

Array of event types.

hidKeyCode

Hid_KeyCode* Hid_KeyCodeArray::hidKeyCode

Description

Enumerates the key codes.

hidKeys

struct Hid_KeyCodeArray Hid_EventProperties::hidKeys

Description

Array of key codes.

hidMiscellaneous

struct Hid_MscEventArray Hid_EventProperties::hidMiscellaneous

Description

Array of miscellaneous events.

hidMscEvent

Hid_MscEvent* Hid_MscEventArray::hidMscEvent

Description

Miscellaneous event.

hidRelAxes

Hid_RelAxes* Hid_RelAxesArray::hidRelAxes

Description

Relative coordinate.

hidRelBits

struct Hid_RelAxesArray Hid_EventProperties::hidRelBits

Description

Array of relative coordinates.

length [1/5]

uint16_t Hid_EventTypeArray::length

Description

Size of the array.

length [2/5]

uint16_t Hid_KeyCodeArray::length

Description

Size of the array.

length [3/5]

uint16_t Hid_AbsAxesArray::length

Description

Size of the array.

length [4/5]

uint16_t Hid_RelAxesArray::length

Description

Size of the array.

length [5/5]

uint16_t Hid_MscEventArray::length

Description

Size of the array.

product

uint16_t Hid_RawDevInfo::product

Description

Product ID.

productId

uint16_t Hid_Device::productId

Description

Product ID.

properties

Hid_DeviceProp* Hid_Device::properties

Description

Device properties.

propLength

uint16_t Hid_Device::propLength

Description

Number of device properties.

type

uint16_t Hid_EmitItem::type

Description

Enumerates the event types.

value

uint32_t Hid_EmitItem::value

Description

Event value.

vendor

uint16_t Hid_RawDevInfo::vendor

Description

Provider ID.

vendorId

uint16_t Hid_Device::vendorId

Description

Vendor ID.

version

uint16_t Hid_Device::version

Description

Version.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Driver Development Kit

harmony 鸿蒙Base DDK

harmony 鸿蒙DDK_Ashmem

harmony 鸿蒙Hid_AbsAxesArray

harmony 鸿蒙Hid_Device

harmony 鸿蒙Hid_EmitItem

harmony 鸿蒙Hid_EventProperties

harmony 鸿蒙Hid_EventTypeArray

harmony 鸿蒙Hid_KeyCodeArray

harmony 鸿蒙Hid_MscEventArray

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