diff --git a/xbee/txframe_test.go b/xbee/txframe_test.go index a4d10ea..e03d7ca 100644 --- a/xbee/txframe_test.go +++ b/xbee/txframe_test.go @@ -19,6 +19,28 @@ func TestTxFrame_Bytes(t *testing.T) { want []byte }{ // TODO: Add test cases. + { + name: "64 bit unicast", + fields: fields{ + Id: 0x52, + Destination: 0x0013A20012345678, + BCastRadius: 0, + Options: 0, + Payload: []byte{0x54, 0x78, 0x44, 0x61, 0x74, 0x61}, + }, + want: []byte{0x10, 0x52, 0x00, 0x13, 0xA2, 0x00, 0x12, 0x34, 0x56, 0x78, 0xFF, 0xFE, 0x00, 0x00, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61}, + }, + { + name: "64 bit broadcast", + fields: fields{ + Id: 0x00, + Destination: 0xFFFF, + BCastRadius: 1, + Options: 0, + Payload: []byte{0x42, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74}, + }, + want: []byte{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFE, 0x01, 0x00, 0x42, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -46,7 +68,6 @@ func TestParseTxStatusFrame(t *testing.T) { want *TxStatusFrame wantErr bool }{ - // TODO: Add test cases. { name: "wrong packet type", args: args{