update close dev
This commit is contained in:
parent
49037058b4
commit
1df34c0946
@ -74,8 +74,14 @@ function printString(str){
|
||||
printer.cut(true, 8)
|
||||
}
|
||||
|
||||
process.on('SIGINT', ()=>{
|
||||
device.close()
|
||||
process.on('SIGINT', async ()=>{
|
||||
await new Promise((resolve, reject) => {
|
||||
device.close(()=>{
|
||||
console.log('serial device close')
|
||||
resolve(null)
|
||||
})
|
||||
})
|
||||
process.exit(0)
|
||||
})
|
||||
|
||||
module.exports = DataCharacteristic
|
||||
|
Loading…
Reference in New Issue
Block a user