• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# usb_serial_types.h
2<!--Kit: Driver Development Kit-->
3<!--Subsystem: Driver-->
4<!--Owner: @lixinsheng2-->
5<!--Designer: @w00373942-->
6<!--Tester: @dong-dongzhen-->
7<!--Adviser: @w_Machine_cc-->
8
9## Overview
10
11Provides the enumerated variables, structures, and macros used in USB SERIAL DDK APIs.
12
13**File to include**: <usb_serial/usb_serial_types.h>
14
15**Library**: libusb_serial.z.so
16
17**System capability**: SystemCapability.Driver.UsbSerial.Extension
18
19**Since**: 18
20
21**Related module**: [SerialDdk](capi-serialddk.md)
22
23## Summary
24
25### Structs
26
27| Name| typedef Keyword| Description|
28| -- | -- | -- |
29| [UsbSerial_Params](capi-serialddk-usbserial-params.md) | __attribute__((aligned(8))) UsbSerial_Params | Defines the USB serial port parameters for the USB SERIAL DDK.|
30| [UsbSerial_DeviceHandle](capi-serialddk-usbserial-devicehandle.md) | UsbSerial_DeviceHandle | Defines the data structures for the USB serial port device (opaque).|
31
32### Enums
33
34| Name| typedef Keyword| Description|
35| -- | -- | -- |
36| [UsbSerial_DdkRetCode](#usbserial_ddkretcode) | UsbSerial_DdkRetCode | Defines the return codes used by the USB SERIAL DDK.|
37| [UsbSerial_FlowControl](#usbserial_flowcontrol) | UsbSerial_FlowControl | Defines the flow control mode for the USB SERIAL DDK.|
38| [UsbSerial_Parity](#usbserial_parity) | UsbSerial_Parity | Defines the enums of the parity parameter used by the USB SERIAL DDK.|
39
40## Enum Description
41
42### UsbSerial_DdkRetCode
43
44```
45enum UsbSerial_DdkRetCode
46```
47
48**Description**
49
50Defines the return codes used by the USB SERIAL DDK.
51
52**Since**: 18
53
54| Enum| Description|
55| -- | -- |
56| USB_SERIAL_DDK_NO_PERM = 201 | No access permission.|
57| USB_SERIAL_DDK_INVALID_PARAMETER = 401 | Invalid parameter.|
58| USB_SERIAL_DDK_SUCCESS = 31600000 | Operation success.|
59| USB_SERIAL_DDK_INVALID_OPERATION = 31600001 | Invalid operation.|
60| USB_SERIAL_DDK_INIT_ERROR = 31600002 | Initialization error.|
61| USB_SERIAL_DDK_SERVICE_ERROR = 31600003 | Service error.|
62| USB_SERIAL_DDK_MEMORY_ERROR = 31600004 | Memory-related errors, such as insufficient memory, memory data replication failure, or memory application fault.|
63| USB_SERIAL_DDK_IO_ERROR = 31600005 | I/O error.|
64| USB_SERIAL_DDK_DEVICE_NOT_FOUND = 31600006 | Device not found.|
65
66### UsbSerial_FlowControl
67
68```
69enum UsbSerial_FlowControl
70```
71
72**Description**
73
74Defines the flow control mode for the USB SERIAL DDK.
75
76**Since**: 18
77
78| Enum| Description|
79| -- | -- |
80| USB_SERIAL_NO_FLOW_CONTROL = 0 | No flow control.|
81| USB_SERIAL_SOFTWARE_FLOW_CONTROL = 1 | Software flow control.|
82| USB_SERIAL_HARDWARE_FLOW_CONTROL = 2 | Hardware flow control.|
83
84### UsbSerial_Parity
85
86```
87enum UsbSerial_Parity
88```
89
90**Description**
91
92Defines the enums of the parity parameter used by the USB SERIAL DDK.
93
94**Since**: 18
95
96| Enum| Description|
97| -- | -- |
98| USB_SERIAL_PARITY_NONE = 0 | No parity.|
99| USB_SERIAL_PARITY_ODD = 1 | Odd parity.|
100| USB_SERIAL_PARITY_EVEN = 2 | Even parity.|
101