Auto stash before rebase of "origin/master"
This commit is contained in:
parent
8c5f7d144a
commit
efc277d8a5
@ -51,9 +51,21 @@ class PrinterDevice {
|
||||
.align('ct')
|
||||
.size(1, 1)
|
||||
for (let i in strs) {
|
||||
printer.text(strs[i], 'big5')
|
||||
this._printer.text(strs[i], 'big5')
|
||||
}
|
||||
this._printer.cut(true, 8)
|
||||
}
|
||||
|
||||
async close() {
|
||||
if (!this._device) return
|
||||
if (this._type == 'serial') {
|
||||
let self = this
|
||||
await new Promise((resolve, reject) => {
|
||||
self._device.close(() => {
|
||||
resolve(1)
|
||||
})
|
||||
})
|
||||
}
|
||||
printer.cut(true, 8)
|
||||
}
|
||||
|
||||
get isOpen() {
|
||||
|
@ -3,6 +3,7 @@ const config = require('./config.json')
|
||||
const localEvent = require('./localEvent')
|
||||
|
||||
var tmp = []
|
||||
var idx = 0
|
||||
|
||||
const notifyDesciptor = new bleno.Descriptor({
|
||||
uuid: '8888',
|
||||
@ -27,7 +28,7 @@ class DataCharacteristic extends bleno.Characteristic {
|
||||
|
||||
if (data.length == 1 && data[0] == 0x00) {
|
||||
tmp = []
|
||||
console.log(data[0])
|
||||
idx = 0
|
||||
} else if (data.length == 1 && data[0] == 0xff) {
|
||||
console.log(Buffer.from(tmp).toString())
|
||||
localEvent.emit('print', Buffer.from(tmp).toString())
|
||||
|
Loading…
Reference in New Issue
Block a user