Skip to content

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

Notifications You must be signed in to change notification settings

asad-96/capacitor-plugin-usb-serial

Repository files navigation

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) => any
Param Type
callback (data: UsbSerialResponse) => void

Returns: any


connectedDevices()

connectedDevices() => any

Returns: any


openSerial(...)

openSerial(options: UsbSerialOptions) => any
Param Type
options UsbSerialOptions

Returns: any


closeSerial()

closeSerial() => any

Returns: any


readSerial()

readSerial() => any

Returns: any


writeSerial(...)

writeSerial(data: UsbSerialWriteOptions) => any
Param Type
data UsbSerialWriteOptions

Returns: any


registerReadCall(...)

registerReadCall(callback: MyPluginCallback) => any
Param Type
callback (data: UsbSerialResponse) => void

Returns: any


Interfaces

UsbSerialResponse

Prop Type
success boolean
error UsbSerialError
data any

UsbSerialError

Prop Type
message string
cause string

UsbSerialOptions

Prop Type
deviceId number
portNum number
baudRate number
dataBits number
stopBits number
parity number
dtr boolean
rts boolean
sleepOnPause boolean

UsbSerialWriteOptions

Prop Type
data string

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published