1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package main
- import (
- "encoding/hex"
- "fmt"
- "server/protocol"
- "testing"
- )
- // buf.Write([]byte{0xFE, 0x5C, 0x4B, 0x89, 0x2A, 0x00, 0x00, 0x00})
- // fmt.Println("buf", buf.Bytes())
- //
- // fmt.Println("转换", hex.EncodeToString(buf.Bytes()))
- //
- // reply, _ := hex.DecodeString(
- // "fe5c4b892a000000")
- // fmt.Println("reply", reply)
- // encodeToGBK 将输入字符串编码为 GBK 字节切片
- func Test_verify(t *testing.T) {
- //pack := protocol.InternalCodeDataPack{}
- //
- //contents := []promodel.InternalCodeContent{}
- //
- //c1 := promodel.InternalCodeContent{
- // Text: "车牌:粤AB31Y9",
- // Color: 0x01,
- // Size: 0x11,
- //}
- //c2 := promodel.InternalCodeContent{
- // Text: "金额:176.8元",
- // Color: 0x01,
- // Size: 0x11,
- //}
- //contents = append(contents, c1, c2)
- //code := pack.SendInternalCode(contents)
- //toString := hex.EncodeToString(code.Bytes())
- //fmt.Println("======", toString)
- //rotate := protocol.Rotate([]byte{0x00, 0x06, 0x00, 0x17})
- //fmt.Println("rotate", rotate)
- //远程喊话
- no := protocol.GetBytesArrNo(30, 2)
- fmt.Println("no", no)
- pack := protocol.VoiceBroadDataPack{}
- broad := pack.VoiceBroad("欢迎光临")
- fmt.Println("======", hex.EncodeToString(broad.Bytes()))
- }
|