From 488e85bbaa68fe98e01b66df12fe3d4578a314b7 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 15:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=AD=E9=9F=B3=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/event/event_tcp_utils.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index 8539f4ecc..a77efc17a 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -68,7 +68,6 @@ const ( hexSignQr = "1b5a000106" // "1b5a000106" 0600 : 后面二维码的字节数 hexSignQrEnd = "000a1b40" // 000a0a0a1b40 hexSignSound = "1d6b40" // 音频指令 - hexSignSoundOld = "1B594155" // 音频指令(老指令) //起始标签 -- 自定义标签utf8转码为gbk字符集 byteSignBR = "3c62723e" // 换行 @@ -510,9 +509,10 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) { //voiceData := hex.EncodeToString(voiceDataGBK) //[8]sounda14 ->5b385d736f756e64613134 - //realSound := hexPrefixStr + voiceData - //realSound := voiceData - //allLen := fmt.Sprintf("%x", (len(realSound))/2) + //hexPrefix, _ := jxutils.Utf8ToGbk([]byte(soundPrefix)) + //hexPrefixStr := hex.EncodeToString(hexPrefix) + //realSound := hexPrefixStr + sound + //allLen := fmt.Sprintf("%x", (len("fd001a0101")+len(realSound))/2) //if len(allLen) < 2 { // allLen = "0" + allLen //} @@ -520,7 +520,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, hexSignSoundOld+voice) + result = strings.ReplaceAll(result, byteSignSound, hexSignSound+voice) //} } }