12345678910111213141516171819202122232425262728293031323334 |
- package protocol
- import (
- "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)
- func Test_verify(t *testing.T) {
- //login := AuthDataPack{}.AuthLogin()
- ////fe5c4b89 2a000000 62 00000000 17000000 31 23 32303234 30393237 3035 3137 3230 3031 23 303630 23ffff
- ////fe5c4b89 2a000000 62 00000000 17000000 31 23 32303234 30393239 3037 3137 3237 3535 23 303630 23ffff
- //
- //fmt.Println("loginBuf", login.Bytes())
- //toString := hex.EncodeToString(login.Bytes())
- //fmt.Println("toString", toString)
- //reply, _ := hex.DecodeString(toString)
- //fmt.Println("reply", reply)
- //reply, _ := hex.DecodeString("fe5c4b8913000000520000000000000000ffff")
- //conn := tcp.DeviceConn["0800075608016688"]
- //if conn == nil {
- // fmt.Println("Connection is nil")
- // return
- //}
- //conn.Write(reply)
- }
|