TWebUSBSerial
Below is a list of the most important properties methods and events for the TWebUSBSerial
.
TWebUSBSerial
is using the Web Serial API This API currently is available in Chromium based
browsers from version 89.
Properties for TWebUSBSerial
Property |
Description |
AutoInitializePorts |
Automatically calls InitPorts when the application starts. |
AutoOpenSelection |
Connect to the port automatically after selecting it. |
AutoCloseSelection |
Close the current connection automatically when selecting another port. |
Filters |
A collection of options to filter the serial port selection |
Ports |
A collection of available ports that had been granted access to by the user. |
SelectedPort |
The currently selected port. |
SelectedPort |
A set of options that is used to connect to a port |
Methods for TWebUSBSerial
Method |
Description |
ClosePort(AForceClose: Boolean = False) |
Closes the connection of the selected port. This is an asynchronous method. |
HasSerial |
Returns if the browser supports the Web Serial API . |
InitPorts |
Initializes a list of ports that has already been granted access by the user previously. This is an asynchronous method. |
OpenPort |
Opens connection to the selected port. This is an asynchronous method. |
Read |
Read data from the serial port. This is an asynchronous method. |
RequestPorts |
Requests access from the user to an available serial port. This is an asynchronous method. |
Write(AData: TJSUint8Array) |
Sends a data array to the selected and connected serial port. |
Events for TWebUSBSerial
Events |
Description |
OnClosePort |
Event triggered when a port connection is closed |
OnConnected |
Event triggered when a serial device is connected to computer and it is deceted by the browser. |
OnDisconnected |
Event triggered when a serial device is removed from the computer. |
OnError |
Event triggered when there is an error. |
OnOpenPort |
Event triggered when a serial port connection is opened. |
OnPortsInitialized |
Event triggered when the list of ports is initialized. |
OnReadData |
Event triggered when data arrives from the serial port. |
OnWriteData |
Event triggered when data is written to the serial port. |