capacitor-plugin-usb-printer
v0.0.11
Published
This plugin can be used for reading data from other device over the usb channel
Downloads
2
Readme
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(...)
connectedDevices()
openSerial(...)
closeSerial()
readSerial()
writeSerial(...)
registerReadCall(...)
- Interfaces
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 |