@@ -667,6 +667,36 @@ SCENARIO("Test the decoding of command messages") {
667
667
}
668
668
}
669
669
670
+ /* ***************************************************************************/
671
+
672
+ WHEN (" Decode the OtaUpdateCmdDown message without field url" )
673
+ {
674
+ CommandDown command;
675
+
676
+ /*
677
+ DA 00010100 # tag(65792)
678
+ 84 # array(4)
679
+ 50 # bytes(16)
680
+ C73CB045F9C2434585AFFA36A307BFE7"\xC7<\xB0E\xF9\xC2CE\x85\xAF\xFA6\xA3\a\xBF\xE7"
681
+ 58 20 # bytes(32)
682
+ DF1EAC9C7BD63473FFFB117F9873703E
683
+ 4EC955931E267F26262B0949BC16DC49# "\xDF\u001E\xAC\x9C{\xD64s\xFF\xFB\u0011\u007F\x98sp>N\xC9U\x93\u001E&\u007F&&+\tI\xBC\u0016\xDCI"
684
+ 1A 65DCB821 # unsigned(1708963873)
685
+
686
+ */
687
+ uint8_t const payload[] = {0xda , 0x00 , 0x01 , 0x01 , 0x00 , 0x84 , 0x50 , 0xc7 ,
688
+ 0x3c , 0xb0 , 0x45 , 0xf9 , 0xc2 , 0x43 , 0x45 , 0x85 ,
689
+ 0xaf , 0xfa , 0x36 , 0xa3 , 0x07 , 0xbf , 0xe7 };
690
+
691
+ size_t payload_length = sizeof (payload) / sizeof (uint8_t );
692
+ CBORMessageDecoder decoder;
693
+ MessageDecoder::Status err = decoder.decode ((Message*)&command, payload, payload_length);
694
+
695
+ THEN (" The decode is successful" ) {
696
+ REQUIRE (err == MessageDecoder::Status::Error);
697
+ }
698
+ }
699
+
670
700
/* ***************************************************************************/
671
701
672
702
WHEN (" Decode the OtaBeginUp message" )
0 commit comments