npm.io
0.0.5 • Published 3 years ago

br_usb

Licence
MIT
Version
0.0.5
Deps
0
Size
57 kB
Vulns
0
Weekly
0

usb

usb

Install

npm install usb
npx cap sync

API

echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>
Param Type
options { value: string; }

Returns: Promise<{ value: string; }>


registerUsbAttachedDetachedCallback(...)
registerUsbAttachedDetachedCallback(callback: UsbAttachedDetachedCallback) => Promise<CallbackID>
Param Type
callback UsbAttachedDetachedCallback

Returns: Promise<string>


devices()
devices() => Promise<UsbResponse<any>>

Returns: Promise<UsbResponse<any>>


open(...)
open(options: SerialOptions) => Promise<UsbResponse<any>>
Param Type
options SerialOptions

Returns: Promise<UsbResponse<any>>


close()
close() => Promise<UsbResponse<any>>

Returns: Promise<UsbResponse<any>>


read()
read() => Promise<UsbResponse<any>>

Returns: Promise<UsbResponse<any>>


write(...)
write(data: SerialWriteOptions) => Promise<UsbResponse<any>>
Param Type
data SerialWriteOptions

Returns: Promise<UsbResponse<any>>


registerReadCallback(...)
registerReadCallback(callback: ReadCallback) => Promise<CallbackID>
Param Type
callback ReadCallback

Returns: Promise<string>


Interfaces
UsbResponse
Prop Type
success boolean
error SerialError
data T
SerialError
Prop Type
message string
cause string
SerialOptions
Prop Type
deviceId number
portNum number
baudRate number
dataBits number
stopBits number
parity number
dtr boolean
rts boolean
sleepOnPause boolean
SerialWriteOptions
Prop Type
data string
Type Aliases
UsbAttachedDetachedCallback

(data: UsbResponse<any>): void

CallbackID

string

ReadCallback

(data: UsbResponse<any>): void

Keywords