This plugin can be used for reading data from other device over the usb channel
npm install usb-serial-plugin
npx cap sync
usbAttachedDetached(...)
connectedDevices()
openSerial(...)
closeSerial()
readSerial()
writeSerial(...)
registerReadCall(...)
- Interfaces
usbAttachedDetached(callback: MyPluginCallback) => any
Param | Type |
---|---|
callback |
(data: UsbSerialResponse) => void |
Returns: any
connectedDevices() => any
Returns: any
openSerial(options: UsbSerialOptions) => any
Param | Type |
---|---|
options |
UsbSerialOptions |
Returns: any
closeSerial() => any
Returns: any
readSerial() => any
Returns: 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 |