This plugin can be used for reading data from other device over the usb channel
npm install usb-serial-plugin
npx cap syncusbAttachedDetached(...)connectedDevices()openSerial(...)closeSerial()readSerial()writeSerial(...)registerReadCall(...)- Interfaces
usbAttachedDetached(callback: MyPluginCallback) => any| Param | Type |
|---|---|
callback |
(data: UsbSerialResponse) => void |
Returns: any
connectedDevices() => anyReturns: any
openSerial(options: UsbSerialOptions) => any| Param | Type |
|---|---|
options |
UsbSerialOptions |
Returns: any
closeSerial() => anyReturns: any
readSerial() => anyReturns: any
writeSerial(data: UsbSerialWriteOptions) => any| Param | Type |
|---|---|
data |
UsbSerialWriteOptions |
Returns: any
registerReadCall(callback: MyPluginCallback) => any| Param | Type |
|---|---|
callback |
(data: UsbSerialResponse) => void |
Returns: any
| Prop | Type |
|---|---|
success |
boolean |
error |
UsbSerialError |
data |
any |
| Prop | Type |
|---|---|
message |
string |
cause |
string |
| Prop | Type |
|---|---|
deviceId |
number |
portNum |
number |
baudRate |
number |
dataBits |
number |
stopBits |
number |
parity |
number |
dtr |
boolean |
rts |
boolean |
sleepOnPause |
boolean |
| Prop | Type |
|---|---|
data |
string |