aa
This commit is contained in:
@@ -304,14 +304,19 @@ func doPrint(printMsgChanFail chan *model.PrintMsg) (err error) {
|
|||||||
globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data))
|
globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data))
|
||||||
printMsg.Status = printMsgAlreadySend
|
printMsg.Status = printMsgAlreadySend
|
||||||
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
||||||
|
for {
|
||||||
buffer := make([]byte, 1024)
|
buffer := make([]byte, 1024)
|
||||||
n, _ := c.Read(buffer)
|
n, _ := c.Read(buffer)
|
||||||
data := hex.EncodeToString(buffer[:n])
|
data := hex.EncodeToString(buffer[:n])
|
||||||
if strings.Contains(data, printText) {
|
if strings.Contains(data, printText) {
|
||||||
globals.SugarLogger.Debugf("handleConn print callback: %v", data)
|
globals.SugarLogger.Debugf("handleConn print callback: %v", data)
|
||||||
changePrintMsg(data)
|
changePrintMsg(data)
|
||||||
|
}
|
||||||
|
if len(buffer) > 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user