0.1.15 • Published 2 years ago

usb-serial-plugin-edited v0.1.15

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


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

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.1.2

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago