Skip to content

AthleticNet/capacitor-usb-serial-plugin-edited

 
 

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) => Promise<CallbackID>
Param Type
callback MyPluginCallback

Returns: Promise<string>


connectedDevices()

connectedDevices() => Promise<UsbSerialResponse>

Returns: Promise<UsbSerialResponse>


openSerial(...)

openSerial(options: UsbSerialOptions) => Promise<UsbSerialResponse>
Param Type
options UsbSerialOptions

Returns: Promise<UsbSerialResponse>


closeSerial()

closeSerial() => Promise<UsbSerialResponse>

Returns: Promise<UsbSerialResponse>


readSerial()

readSerial() => Promise<UsbSerialResponse>

Returns: Promise<UsbSerialResponse>


writeSerial(...)

writeSerial(data: UsbSerialWriteOptions) => Promise<UsbSerialResponse>
Param Type
data UsbSerialWriteOptions

Returns: Promise<UsbSerialResponse>


writeSerialHex(...)

writeSerialHex(data: UsbSerialWriteOptions) => Promise<UsbSerialResponse>
Param Type
data UsbSerialWriteOptions

Returns: Promise<UsbSerialResponse>


registerReadCall(...)

registerReadCall(callback: MyPluginCallback) => Promise<CallbackID>
Param Type
callback MyPluginCallback

Returns: Promise<string>


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

Type Aliases

MyPluginCallback

(data: UsbSerialResponse): void

CallbackID

string

About

Plugin usb serial with flag_immutable and flag_mutable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 43.5%
  • TypeScript 30.5%
  • SCSS 13.0%
  • JavaScript 4.3%
  • HTML 4.2%
  • Swift 2.1%
  • Other 2.4%