0.0.9 • Published 1 year ago

usb-serial-plugin v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

usb-serial-plugin

This plugin can be used for reading data from other device over the usb channel

Install

npm install usb-serial-plugin
npx cap sync

API

usbAttachedDetached(...)

usbAttachedDetached(callback: MyPluginCallback) => Promise<CallbackID>
ParamType
callbackMyPluginCallback

Returns: Promise<string>


connectedDevices()

connectedDevices() => Promise<UsbSerialResponse>

Returns: Promise<UsbSerialResponse>


openSerial(...)

openSerial(options: UsbSerialOptions) => Promise<UsbSerialResponse>
ParamType
optionsUsbSerialOptions

Returns: Promise<UsbSerialResponse>


closeSerial()

closeSerial() => Promise<UsbSerialResponse>

Returns: Promise<UsbSerialResponse>


readSerial()

readSerial() => Promise<UsbSerialResponse>

Returns: Promise<UsbSerialResponse>


writeSerial(...)

writeSerial(data: UsbSerialWriteOptions) => Promise<UsbSerialResponse>
ParamType
dataUsbSerialWriteOptions

Returns: Promise<UsbSerialResponse>


registerReadCall(...)

registerReadCall(callback: MyPluginCallback) => Promise<CallbackID>
ParamType
callbackMyPluginCallback

Returns: Promise<string>


Interfaces

UsbSerialResponse

PropType
successboolean
errorUsbSerialError
dataany

UsbSerialError

PropType
messagestring
causestring

UsbSerialOptions

PropType
deviceIdnumber
portNumnumber
baudRatenumber
dataBitsnumber
stopBitsnumber
paritynumber
dtrboolean
rtsboolean
sleepOnPauseboolean

UsbSerialWriteOptions

PropType
datastring

Type Aliases

MyPluginCallback

(data: UsbSerialResponse): void

CallbackID

string

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

3 years ago

0.0.1

3 years ago