Epson bluetooth printer
npm install epson-bluetooth-printerEpson bluetooth printer
``bash`
npm install epson-bluetooth-printer
npx cap sync
* findBondedPrinters()
* scanForPrinters()
* connectAndPrint(...)
* resetBluetoothDiscovery()
* isDeviceConnected(...)
* disconnectDevice(...)
* getBluetoothState()
* testConnection(...)
* Interfaces
`typescript`
findBondedPrinters() => Promise<{ printers: BluetoothDevice[]; }>
Trova tutte le stampanti Epson accoppiate
Returns: Promise<{ printers: BluetoothDevice[]; }>
--------------------
`typescript`
scanForPrinters() => Promise<{ printers: BluetoothDevice[]; }>
Trova dispositivi Bluetooth tramite discovery
Returns: Promise<{ printers: BluetoothDevice[]; }>
--------------------
`typescript`
connectAndPrint(options: { address: string; data: string; }) => Promise
Connetti e stampa in un'unica operazione
| Param | Type |
| ------------- | ----------------------------------------------- |
| options | { address: string; data: string; } |
--------------------
`typescript`
resetBluetoothDiscovery() => Promise
Reset discovery Bluetooth
--------------------
`typescript`
isDeviceConnected(options: { address: string; }) => Promise<{ connected: boolean; }>
Verifica se un dispositivo è connesso
| Param | Type |
| ------------- | --------------------------------- |
| options | { address: string; } |
Returns: Promise<{ connected: boolean; }>
--------------------
`typescript`
disconnectDevice(options: { address: string; }) => Promise
Disconnetti dispositivo specifico
| Param | Type |
| ------------- | --------------------------------- |
| options | { address: string; } |
--------------------
`typescript`
getBluetoothState() => Promise<{ enabled: boolean; canEnable: boolean; }>
Verifica stato Bluetooth
Returns: Promise<{ enabled: boolean; canEnable: boolean; }>
--------------------
`typescript`
testConnection(options: { address: string; }) => Promise<{ success: boolean; }>
Test connessione (invia comando di test)
| Param | Type |
| ------------- | --------------------------------- |
| options | { address: string; } |
Returns: Promise<{ success: boolean; }>
--------------------
#### BluetoothDevice
| Prop | Type |
| ----------------- | --------------------------- |
| address | string |
| name | string \| null |
| bondState | number |
| deviceClass | number |
| rssi` | number |