Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added experimental getStatus for epson printer,
- added wait for response flag to network interface, - added example for get status with a network printer
- Loading branch information
Klemen Kastelic
committed
Sep 13, 2023
1 parent
bd1bde4
commit 0da1761
Showing
6 changed files
with
60 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const ThermalPrinter = require('../node-thermal-printer').printer; | ||
const Types = require('../node-thermal-printer').types; | ||
|
||
async function testConnection() { | ||
const printer = new ThermalPrinter({ | ||
type: Types.EPSON, | ||
interface: process.argv[2], | ||
}); | ||
|
||
printer.getStatus(); | ||
|
||
try { | ||
const status = await printer.execute({ waitForResponse: true }); | ||
console.log('Printer status:', status); | ||
} catch (e) { | ||
console.error('Print failed:', e); | ||
} | ||
} | ||
|
||
testConnection(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters