0.1.15 • Published 1 year ago

usb-serial-plugin-edited v0.1.15

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>


writeSerialHex(...)

writeSerialHex(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.1.10

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.2

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.1

1 year ago

0.1.0

2 years ago