@@ -39,8 +39,8 @@ SCENARIO("Test the decoding of command messages") {
39
39
0x33 , 0x39 , 0x34 , 0x63 };
40
40
41
41
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
42
- // CBORMessageDecoder decoder;
43
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
42
+ CBORMessageDecoder decoder;
43
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
44
44
const char *thingIdToMatch = " e4494d55-872a-4fd2-9646-92f87949394c" ;
45
45
46
46
THEN (" The decode is successful" ) {
@@ -68,8 +68,8 @@ SCENARIO("Test the decoding of command messages") {
68
68
0x33 , 0x39 , 0x34 , 0x63 };
69
69
70
70
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
71
- // CBORMessageDecoder decoder;
72
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
71
+ CBORMessageDecoder decoder;
72
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
73
73
const char *thingIdToMatch = " e4494d55-872a-4fd2-9646-92f87949394c" ;
74
74
75
75
THEN (" The decode is successful" ) {
@@ -93,8 +93,8 @@ SCENARIO("Test the decoding of command messages") {
93
93
0xDC , 0xB8 , 0x21 };
94
94
95
95
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
96
- // CBORMessageDecoder decoder;
97
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
96
+ CBORMessageDecoder decoder;
97
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
98
98
99
99
THEN (" The decode is unsuccessful" ) {
100
100
REQUIRE (err == Decoder::Status::Error);
@@ -114,8 +114,8 @@ SCENARIO("Test the decoding of command messages") {
114
114
0xDC , 0xB8 , 0x21 };
115
115
116
116
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
117
- // CBORMessageDecoder decoder;
118
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
117
+ CBORMessageDecoder decoder;
118
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
119
119
120
120
THEN (" The decode is successful" ) {
121
121
REQUIRE (err == Decoder::Status::Error);
@@ -139,8 +139,8 @@ SCENARIO("Test the decoding of command messages") {
139
139
0xDC , 0xB8 , 0x21 , 0x1A , 0x78 , 0xAC , 0xA1 , 0x91 };
140
140
141
141
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
142
- // CBORMessageDecoder decoder;
143
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
142
+ CBORMessageDecoder decoder;
143
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
144
144
145
145
THEN (" The decode is successful" ) {
146
146
REQUIRE (err == Decoder::Status::Complete);
@@ -169,8 +169,8 @@ SCENARIO("Test the decoding of command messages") {
169
169
0x09 , 0x10 , 0x11 , 0x12 };
170
170
171
171
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
172
- // CBORMessageDecoder decoder;
173
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
172
+ CBORMessageDecoder decoder;
173
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
174
174
175
175
THEN (" The decode is successful" ) {
176
176
REQUIRE (err == Decoder::Status::Complete);
@@ -249,8 +249,8 @@ SCENARIO("Test the decoding of command messages") {
249
249
0x2b , 0x09 , 0x49 , 0xbc , 0x16 , 0xdc , 0x49 };
250
250
251
251
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
252
- // CBORMessageDecoder decoder;
253
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
252
+ CBORMessageDecoder decoder;
253
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
254
254
255
255
uint8_t otaIdToMatch[ID_SIZE] = { 0xC7 , 0x3C , 0xB0 , 0x45 , 0xF9 , 0xC2 , 0x43 , 0x45 ,
256
256
0x85 , 0xAF , 0xFA , 0x36 , 0xA3 , 0x07 , 0xBF , 0xE7 };
@@ -388,8 +388,8 @@ SCENARIO("Test the decoding of command messages") {
388
388
0x2b , 0x09 , 0x49 , 0xbc , 0x16 , 0xdc , 0x49 };
389
389
390
390
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
391
- // CBORMessageDecoder decoder;
392
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
391
+ CBORMessageDecoder decoder;
392
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
393
393
394
394
THEN (" The decode is successful" ) {
395
395
REQUIRE (err == Decoder::Status::Error);
@@ -452,8 +452,8 @@ SCENARIO("Test the decoding of command messages") {
452
452
0x2b , 0x09 , 0x49 , 0xbc , 0x16 , 0xdc , 0x49 };
453
453
454
454
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
455
- // CBORMessageDecoder decoder;
456
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
455
+ CBORMessageDecoder decoder;
456
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
457
457
458
458
THEN (" The decode is successful" ) {
459
459
REQUIRE (err == Decoder::Status::Error);
@@ -511,8 +511,8 @@ SCENARIO("Test the decoding of command messages") {
511
511
0xdc , 0x49 };
512
512
513
513
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
514
- // CBORMessageDecoder decoder;
515
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
514
+ CBORMessageDecoder decoder;
515
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
516
516
517
517
THEN (" The decode is successful" ) {
518
518
REQUIRE (err == Decoder::Status::Error);
@@ -570,8 +570,8 @@ SCENARIO("Test the decoding of command messages") {
570
570
0xB8 , 0x21 };
571
571
572
572
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
573
- // CBORMessageDecoder decoder;
574
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
573
+ CBORMessageDecoder decoder;
574
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
575
575
576
576
THEN (" The decode is successful" ) {
577
577
REQUIRE (err == Decoder::Status::Error);
@@ -596,8 +596,8 @@ SCENARIO("Test the decoding of command messages") {
596
596
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };
597
597
598
598
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
599
- // CBORMessageDecoder decoder;
600
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
599
+ CBORMessageDecoder decoder;
600
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
601
601
602
602
THEN (" The decode is unsuccessful - OtaBeginUp is not supported" ) {
603
603
REQUIRE (err == Decoder::Status::Error);
@@ -619,8 +619,8 @@ SCENARIO("Test the decoding of command messages") {
619
619
0x68 , 0x69 , 0x6e , 0x67 , 0x5f , 0x69 , 0x64 };
620
620
621
621
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
622
- // CBORMessageDecoder decoder;
623
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
622
+ CBORMessageDecoder decoder;
623
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
624
624
625
625
THEN (" The decode is unsuccessful - ThingBeginCmd is not supported" ) {
626
626
REQUIRE (err == Decoder::Status::Error);
@@ -639,8 +639,8 @@ SCENARIO("Test the decoding of command messages") {
639
639
uint8_t const payload[] = {0xda , 0x00 , 0x01 , 0x05 , 0x00 , 0x80 };
640
640
641
641
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
642
- // CBORMessageDecoder decoder;
643
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
642
+ CBORMessageDecoder decoder;
643
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
644
644
645
645
THEN (" The decode is unsuccessful - LastValuesBeginCmd is not supported" ) {
646
646
REQUIRE (err == Decoder::Status::Error);
@@ -662,8 +662,8 @@ SCENARIO("Test the decoding of command messages") {
662
662
0x2e , 0x30 , 0x2e , 0x30 };
663
663
664
664
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
665
- // CBORMessageDecoder decoder;
666
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
665
+ CBORMessageDecoder decoder;
666
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
667
667
668
668
THEN (" The decode is unsuccessful - DeviceBeginCmd is not supported" ) {
669
669
REQUIRE (err == Decoder::Status::Error);
@@ -690,8 +690,8 @@ SCENARIO("Test the decoding of command messages") {
690
690
0x20 , 0x18 , 0x64 };
691
691
692
692
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
693
- // CBORMessageDecoder decoder;
694
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
693
+ CBORMessageDecoder decoder;
694
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
695
695
696
696
THEN (" The decode is unsuccessful - OtaProgressCmdUp is not supported" ) {
697
697
REQUIRE (err == Decoder::Status::Error);
@@ -710,8 +710,8 @@ SCENARIO("Test the decoding of command messages") {
710
710
uint8_t const payload[] = {0xda , 0x00 , 0x01 , 0x08 , 0x00 , 0x80 };
711
711
712
712
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
713
- // CBORMessageDecoder decoder;
714
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
713
+ CBORMessageDecoder decoder;
714
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
715
715
716
716
THEN (" The decode is unsuccessful - TimezoneCommandUp is not supported" ) {
717
717
REQUIRE (err == Decoder::Status::Error);
@@ -735,8 +735,8 @@ SCENARIO("Test the decoding of command messages") {
735
735
0xDC , 0xB8 , 0x21 , 0x1A , 0x78 , 0xAC , 0xA1 , 0x91 };
736
736
737
737
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
738
- // CBORMessageDecoder decoder;
739
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
738
+ CBORMessageDecoder decoder;
739
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
740
740
741
741
THEN (" The decode is unsuccessful" ) {
742
742
REQUIRE (err == Decoder::Status::Error);
@@ -759,8 +759,8 @@ SCENARIO("Test the decoding of command messages") {
759
759
0xAC , 0xA1 , 0x91 };
760
760
761
761
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
762
- // CBORMessageDecoder decoder;
763
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
762
+ CBORMessageDecoder decoder;
763
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
764
764
765
765
THEN (" The decode is unsuccessful" ) {
766
766
REQUIRE (err == Decoder::Status::Error);
@@ -776,8 +776,8 @@ SCENARIO("Test the decoding of command messages") {
776
776
uint8_t const payload[] = {0xFF };
777
777
778
778
size_t payload_length = sizeof (payload) / sizeof (uint8_t );
779
- // CBORMessageDecoder decoder;
780
- Decoder::Status err = CBORMessageDecoder .decode ((Message*)&command, payload, payload_length);
779
+ CBORMessageDecoder decoder;
780
+ Decoder::Status err = decoder .decode ((Message*)&command, payload, payload_length);
781
781
782
782
THEN (" The decode is unsuccessful" ) {
783
783
REQUIRE (err == Decoder::Status::Error);
0 commit comments