aa
This commit is contained in:
13
main.go
13
main.go
@@ -187,18 +187,7 @@ func handleConn(c net.Conn) {
|
||||
return
|
||||
}
|
||||
fmt.Println("read data:", hex.EncodeToString(buffer[:n]))
|
||||
str := "1e"
|
||||
const1 := "0200ff50"
|
||||
orderNo := "0001" //订单序列号
|
||||
printInit := "1b40" //打印机初始化
|
||||
voice := "1b59415501" //语音响一次
|
||||
check := "ff"
|
||||
begin := "oa"
|
||||
s := "--------------------------------------"
|
||||
printData := hex.EncodeToString([]byte(s))
|
||||
lenData := int64(len(str) + len(const1) + len(orderNo) + len(printInit) + len(voice) + 1 + 2 + len(printData))
|
||||
x1, x2 := int2h8l8(lenData / 2)
|
||||
data := str + x1 + x2 + const1 + orderNo + printInit + voice + begin + printData + check
|
||||
data := "ok"
|
||||
c.Write([]byte(data))
|
||||
fmt.Println("write data: ", data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user