Auto stash before rebase of "origin/master"

This commit is contained in:
Jay 2017-08-23 21:20:22 +08:00
parent 8c5f7d144a
commit efc277d8a5
2 changed files with 16 additions and 3 deletions

View File

@ -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() {

View File

@ -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())