# Functions
AddListener adds a listenener for the provided command.
Close closes the connection to any opened virtual COM port.
Open connects to the specified virtual COM port The parameter 'device' holds the name of the device to connect to, i.e.
Transfer sends a message to the usb device and returns the answer
Params: msg - The messge to be transmitted (payload can be nil for zero TX payload (request-only style commands)) Returns: answer message, error.
# Constants
CmdIrq - interrupt callback, only from device to host, used for tests.
CmdRx - Rx callback, for async messages from peripheral -> central.
CmdTest - test command, do not use, used for tests.
DefaultTimeout is the default Transfer-timeout in milliseconds waiting for an answer message befor returning an error.
MaxPayloadLen - maximum length of message Payload (64 byte packet - 4 bytes header - 2 bytes crc).
# Variables
ErrCmdMismatch is returned when the command ID of a received answer doesn't match the request.
ErrParam is returned when a passed parameter is invalid.
ErrSerial is returned when there is a problem with the serial port.
ErrSize usually is returned when the passed data has the wrong size (too large or too small).
ErrTimeout is returned when waiting for an answer timed out.
TimeoutMillis is the timeout in milliseconds used when waiting for an answer in Transfer().
# Type aliases
CommandID - ID of the USB commands.