0.0.9 • Published 3 years ago

usb-serial-plugin v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years 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

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago