From 38c5f63334c0c6683c4e44dd99e993889c3630ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 26 Jul 2022 16:19:15 +0800 Subject: [PATCH] 1 --- business/jxstore/event/event_tcp_utils.go | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index 231ca0504..0ff86003f 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -54,20 +54,21 @@ const ( signSound, signSoundEnd = "", "" // 声音结束标签 // GPRS通讯说明,打印机识别二进制码 - hexSignBROrEXE = "0a" // 换行 - hexSignCenter = "1b6101" // 居中打印 - hexSignLeft = "1b6100" // 恢复居左打印 - hexSignRight = "1b6102" // 居右打印 - hexSignNormal = "1b2100" - hexSignBig = "1b2130" // 横向及纵向都放大 - hexSignHighBig = "1b2110" // 倍高 - hexSignWideBig = "1b2120" // 倍宽 - hexSignQrCenter = "1d5802" // 二维码居中 - hexSignQrLeft = "1d5800" // 二维码居左 - hexSignQrRight = "1d5804" // 二维码居右 - hexSignQr = "1b5a000106" // "1b5a000106" 0600 : 后面二维码的字节数 - hexSignQrEnd = "000a1b40" // 000a0a0a1b40 - hexSignSound = "1d6b40" // 音频指令 + hexSignBROrEXE = "0a" // 换行 + hexSignCenter = "1b6101" // 居中打印 + hexSignLeft = "1b6100" // 恢复居左打印 + hexSignRight = "1b6102" // 居右打印 + hexSignNormal = "1b2100" + hexSignBig = "1b2130" // 横向及纵向都放大 + hexSignHighBig = "1b2110" // 倍高 + hexSignWideBig = "1b2120" // 倍宽 + hexSignQrCenter = "1d5802" // 二维码居中 + hexSignQrLeft = "1d5800" // 二维码居左 + hexSignQrRight = "1d5804" // 二维码居右 + hexSignQr = "1b5a000106" // "1b5a000106" 0600 : 后面二维码的字节数 + hexSignQrEnd = "000a1b40" // 000a0a0a1b40 + hexSignSound = "1d6b40" // 音频指令(自定义语音指令) + hexSignSoundSolidification = "1B594155" // 音频指令(固化指令) //起始标签 -- 自定义标签utf8转码为gbk字符集 byteSignBR = "3c62723e" // 换行 @@ -520,7 +521,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) { //soundLenH, soundLenX := int2h8l8(int64((len(realSound) + len("0101")) / 2)) //result = strings.ReplaceAll(result, byteSignSound, hexSignSound+allLen+"fd"+soundLenH+soundLenX+"0100"+hexPrefixStr) result = strings.ReplaceAll(result, sound, "") - result = strings.ReplaceAll(result, byteSignSound, hexSignSound+"01"+voice) + result = strings.ReplaceAll(result, byteSignSound, hexSignSoundSolidification+"14") //} } }