Lines Matching +full:0 +full:x45

65 #define peer_addr { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, \
66 0, 0, 0, 0, 0, 0, 0, 0x2 } } }
74 #define COAP_MAX_AGE 0xffffff
81 uint8_t result_pdu[] = { 0x40, 0x01, 0x0, 0x0 }; in ZTEST()
83 uint8_t *data = data_buf[0]; in ZTEST()
87 COAP_VERSION_1, COAP_TYPE_CON, 0, NULL, in ZTEST()
88 COAP_METHOD_GET, 0); in ZTEST()
90 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
95 zassert_equal(cpkt.opt_len, 0, "Invalid options length"); in ZTEST()
102 uint8_t result_pdu[] = { 0x55, 0xA5, 0x12, 0x34, 't', 'o', 'k', 'e', in ZTEST()
103 'n', 0xC0, 0xFF, 'p', 'a', 'y', 'l', in ZTEST()
104 'o', 'a', 'd', 0x00 }; in ZTEST()
108 uint8_t *data = data_buf[0]; in ZTEST()
117 0x1234); in ZTEST()
118 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
122 zassert_equal(r, 0, "Could not append option"); in ZTEST()
125 zassert_equal(r, 0, "Failed to set the payload marker"); in ZTEST()
128 zassert_equal(r, 0, "Failed to set the payload"); in ZTEST()
148 uint8_t pdu[] = { 0x40, 0x01, 0, 0 }; in ZTEST()
150 uint8_t *data = data_buf[0]; in ZTEST()
159 r = coap_packet_parse(&cpkt, data, sizeof(pdu), NULL, 0); in ZTEST()
160 zassert_equal(r, 0, "Could not parse packet"); in ZTEST()
166 zassert_equal(cpkt.opt_len, 0, "Invalid options length"); in ZTEST()
178 zassert_equal(id, 0U, "Packet id doesn't match reference"); in ZTEST()
184 uint8_t pdu[] = { 0x40, 0x01, 0, 0, 0x40}; in ZTEST()
186 uint8_t *data = data_buf[0]; in ZTEST()
195 r = coap_packet_parse(&cpkt, data, sizeof(pdu), NULL, 0); in ZTEST()
196 zassert_equal(r, 0, "Could not parse packet"); in ZTEST()
214 zassert_equal(id, 0U, "Packet id doesn't match reference"); in ZTEST()
219 uint8_t pdu[] = { 0x55, 0xA5, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', in ZTEST()
220 0x00, 0xc1, 0x00, 0xff, 'p', 'a', 'y', 'l', 'o', in ZTEST()
221 'a', 'd', 0x00 }; in ZTEST()
226 uint8_t *data = data_buf[0]; in ZTEST()
238 r = coap_packet_parse(&cpkt, data, sizeof(pdu), NULL, 0); in ZTEST()
239 zassert_equal(r, 0, "Could not parse packet"); in ZTEST()
263 zassert_equal(id, 0x1234, "Packet id doesn't match reference"); in ZTEST()
275 zassert_equal(options[0].len, 1U, in ZTEST()
277 zassert_equal(((uint8_t *)options[0].value)[0], in ZTEST()
284 zassert_equal(count, 0, in ZTEST()
290 uint8_t opt[] = { 0x55, 0xA5, 0x12 }; in ZTEST()
293 uint8_t *data = data_buf[0]; in ZTEST()
296 r = coap_packet_parse(&cpkt, NULL, sizeof(opt), NULL, 0); in ZTEST()
299 r = coap_packet_parse(&cpkt, data, 0, NULL, 0); in ZTEST()
303 r = coap_packet_parse(&cpkt, data, sizeof(opt), NULL, 0); in ZTEST()
309 uint8_t opt[] = { 0x55, 0x24, 0x49, 0x55, 0xff, 0x66, 0x77, 0x99}; in ZTEST()
312 uint8_t *data = data_buf[0]; in ZTEST()
316 r = coap_packet_parse(&cpkt, data, sizeof(opt), NULL, 0); in ZTEST()
322 uint8_t opt[] = { 0x55, 0xA5, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', in ZTEST()
323 0xD0 }; in ZTEST()
325 uint8_t *data = data_buf[0]; in ZTEST()
330 r = coap_packet_parse(&cpkt, data, sizeof(opt), NULL, 0); in ZTEST()
336 uint8_t opt[] = { 0x55, 0xA5, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', in ZTEST()
337 0xC1 }; in ZTEST()
339 uint8_t *data = data_buf[0]; in ZTEST()
344 r = coap_packet_parse(&cpkt, data, sizeof(opt), NULL, 0); in ZTEST()
350 uint8_t opt[] = { 0x55, 0xA5, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', in ZTEST()
351 0xE0, 0x01 }; in ZTEST()
353 uint8_t *data = data_buf[0]; in ZTEST()
358 r = coap_packet_parse(&cpkt, data, sizeof(opt), NULL, 0); in ZTEST()
364 uint8_t opt[] = { 0x55, 0xA5, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', in ZTEST()
365 0xEE, 0x01, 0x02, 0x01}; in ZTEST()
367 uint8_t *data = data_buf[0]; in ZTEST()
372 r = coap_packet_parse(&cpkt, data, sizeof(opt), NULL, 0); in ZTEST()
379 uint8_t pdu[] = { 0x40, 0x01, 0, 0, 0x40, 0xFF}; in ZTEST()
381 uint8_t *data = data_buf[0]; in ZTEST()
386 r = coap_packet_parse(&cpkt, data, sizeof(pdu), NULL, 0); in ZTEST()
387 zassert_not_equal(r, 0, "Should've failed to parse a packet"); in ZTEST()
392 uint8_t pdu[] = { 0x45, 0xA5, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', in ZTEST()
393 0x00, 0xc1, 0x00, 0xff, 'p', 'a', 'y', 'l', 'o', in ZTEST()
394 'a', 'd', 0x00 }; in ZTEST()
395 uint8_t ack_pdu[] = { 0x65, 0x80, 0x12, 0x34, 't', 'o', 'k', 'e', 'n' }; in ZTEST()
398 uint8_t *data = data_buf[0]; in ZTEST()
404 r = coap_packet_parse(&cpkt, data, sizeof(pdu), NULL, 0); in ZTEST()
405 zassert_equal(r, 0, "Could not parse packet"); in ZTEST()
409 zassert_equal(r, 0, "Could not initialize ACK packet"); in ZTEST()
419 uint8_t pdu[] = { 0x45, 0xA5, 0xDE, 0xAD, 't', 'o', 'k', 'e', 'n', in ZTEST()
420 0x00, 0xc1, 0x00, 0xff, 'p', 'a', 'y', 'l', 'o', in ZTEST()
421 'a', 'd', 0x00 }; in ZTEST()
422 uint8_t ack_pdu[] = { 0x60, 0x00, 0xDE, 0xAD }; in ZTEST()
425 uint8_t *data = data_buf[0]; in ZTEST()
431 r = coap_packet_parse(&cpkt, data, sizeof(pdu), NULL, 0); in ZTEST()
432 zassert_equal(r, 0, "Could not parse packet"); in ZTEST()
436 zassert_equal(r, 0, "Could not initialize ACK packet"); in ZTEST()
494 uint8_t payload[32] = { 0 }; in prepare_block1_request()
495 uint8_t *data = data_buf[0]; in prepare_block1_request()
502 if (req_ctx->total_size == 0) { in prepare_block1_request()
514 zassert_equal(r, 0, "Unable to initialize request"); in prepare_block1_request()
517 zassert_equal(r, 0, "Unable to append block1 option"); in prepare_block1_request()
521 zassert_equal(r, 0, "Unable to append size1 option"); in prepare_block1_request()
525 zassert_equal(r, 0, "Unable to append payload marker"); in prepare_block1_request()
533 zassert_equal(r, 0, "Unable to append payload"); in prepare_block1_request()
548 if (rsp_ctx->total_size == 0) { in prepare_block1_response()
554 zassert_equal(r, 0, "Failed to read block option"); in prepare_block1_response()
562 zassert_equal(r, 0, "Unable to initialize request"); in prepare_block1_response()
565 zassert_equal(r, 0, "Unable to append block1 option"); in prepare_block1_response()
615 i = 0U; in ZTEST()
617 memset(&req_ctx, 0, sizeof(req_ctx)); in ZTEST()
618 memset(&rsp_ctx, 0, sizeof(rsp_ctx)); in ZTEST()
638 uint8_t *data = data_buf[0]; in prepare_block2_request()
642 if (req_ctx->total_size == 0) { in prepare_block2_request()
653 zassert_equal(r, 0, "Unable to initialize request"); in prepare_block2_request()
656 zassert_equal(r, 0, "Unable to append block2 option"); in prepare_block2_request()
674 if (rsp_ctx->total_size == 0) { in prepare_block2_response()
688 zassert_equal(r, 0, "Unable to initialize request"); in prepare_block2_response()
691 zassert_equal(r, 0, "Unable to append block2 option"); in prepare_block2_response()
695 zassert_equal(r, 0, "Unable to append size2 option"); in prepare_block2_response()
699 zassert_equal(r, 0, "Unable to append payload marker"); in prepare_block2_response()
707 zassert_equal(r, 0, "Unable to append payload"); in prepare_block2_response()
757 i = 0U; in ZTEST()
759 memset(&req_ctx, 0, sizeof(req_ctx)); in ZTEST()
760 memset(&rsp_ctx, 0, sizeof(rsp_ctx)); in ZTEST()
779 uint8_t *data = data_buf[0]; in ZTEST()
787 COAP_TYPE_CON, 0, coap_next_token(), in ZTEST()
789 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
796 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
805 COAP_VERSION_1, COAP_TYPE_ACK, 0, NULL, in ZTEST()
807 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
885 zassert_equal(r, 0, "Unable to initialize packet"); in server_resource_1_get()
889 zassert_equal(r, 0, "Failed to append observe option"); in server_resource_1_get()
892 zassert_equal(r, 0, "Failed to set the payload marker"); in server_resource_1_get()
896 zassert_equal(r, 0, "Unable to append payload"); in server_resource_1_get()
900 return 0; in server_resource_1_get()
906 0x45, 0x01, 0x12, 0x34, in ZTEST()
908 0x60, /* enable observe option */ in ZTEST()
909 0x51, 's', 0x01, '1', /* path */ in ZTEST()
912 0x45, 0x01, 0x12, 0x34, in ZTEST()
914 0x60, /* enable observe option */ in ZTEST()
915 0x51, 's', 0x01, '3', /* path */ in ZTEST()
919 uint8_t *data = data_buf[0]; in ZTEST()
927 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
932 zassert_equal(r, 0, "Could not handle packet"); in ZTEST()
935 r = coap_resource_notify(&server_resources[0]); in ZTEST()
936 zassert_equal(r, 0, "Could not notify resource"); in ZTEST()
942 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
957 return 0; in resource_reply_cb()
968 uint8_t *data = data_buf[0]; in ZTEST()
971 int observe = 0; in ZTEST()
978 zassert_equal(r, 0, "Unable to initialize request"); in ZTEST()
982 zassert_equal(r, 0, "Unable to add option to request int"); in ZTEST()
987 zassert_equal(r, 0, "Unable to add option to request"); in ZTEST()
998 zassert_equal(r, 0, "Could not parse req packet"); in ZTEST()
1003 zassert_equal(r, 0, "Could not handle packet"); in ZTEST()
1006 rsp_data = server_resources[0].user_data; in ZTEST()
1011 zassert_equal(r, 0, "Could not parse rsp packet"); in ZTEST()
1022 uint8_t *data = data_buf[0]; in ZTEST()
1029 COAP_TYPE_CON, 0, NULL, 0xFF, coap_next_id()); in ZTEST()
1031 zassert_equal(r, 0, "Unable to init req"); in ZTEST()
1036 zassert_equal(r, 0, "Unable to append option"); in ZTEST()
1040 zassert_equal(r, 0, "Could not parse req packet"); in ZTEST()
1049 uint8_t result[] = {0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0xC0, 0xB1, 0x19, in ZTEST()
1050 0xC5, 'p', 'r', 'o', 'x', 'y', 0x44, 'c', 'o', 'a', 'p'}; in ZTEST()
1053 uint8_t *data = data_buf[0]; in ZTEST()
1057 strlen(token), token, COAP_METHOD_POST, 0x1234); in ZTEST()
1058 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
1062 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1064 static const uint8_t expected_options_0 = 0xc0; /* content format */ in ZTEST()
1071 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1073 0xc0, /* content format */ in ZTEST()
1074 0xd5, 0x0a, 'p', 'r', 'o', 'x', 'y' /* proxy url */ in ZTEST()
1082 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1084 0xc0, /* content format */ in ZTEST()
1085 0xd5, 0x0a, 'p', 'r', 'o', 'x', 'y', /* proxy url */ in ZTEST()
1086 0x44, 'c', 'o', 'a', 'p' /* proxy scheme */ in ZTEST()
1091 const uint8_t block_option = 0b11001; in ZTEST()
1094 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1096 0xc0, /* content format */ in ZTEST()
1097 0xb1, 0x19, /* block2 */ in ZTEST()
1098 0xc5, 'p', 'r', 'o', 'x', 'y', /* proxy url */ in ZTEST()
1099 0x44, 'c', 'o', 'a', 'p' /* proxy scheme */ in ZTEST()
1142 } while (0)
1150 uint8_t *data = data_buf[0]; in ZTEST()
1152 memset(data_buf[0], 0, ARRAY_SIZE(data_buf[0])); in ZTEST()
1157 strlen(token), token, COAP_METHOD_POST, 0x1234); in ZTEST()
1158 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
1162 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1163 static const uint8_t expected_0[] = {0x45, 0x02, 0x12, 0x34, 't', 'o', in ZTEST()
1164 'k', 'e', 'n', 0xd1, 0x0f, 0x80}; in ZTEST()
1170 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1173 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', in ZTEST()
1174 0xb4, 'p', 'a', 't', 'h', 0xd1, 0x04, 0x80, in ZTEST()
1180 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1183 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0xb4, in ZTEST()
1184 'p', 'a', 't', 'h', 0x11, 0x32, 0xd1, 0x03, 0x80, in ZTEST()
1192 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1195 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x38, 'h', 'o', 's', 't', in ZTEST()
1196 'n', 'a', 'm', 'e', 0x84, 'p', 'a', 't', 'h', 0x11, 0x32, 0xd1, 0x03, 0x80, in ZTEST()
1202 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1205 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x38, 'h', in ZTEST()
1206 'o', 's', 't', 'n', 'a', 'm', 'e', 'B', 0x16, 0x06, 'D', in ZTEST()
1207 'p', 'a', 't', 'h', 0x11, 0x32, 0xd1, 0x03, 0x80, in ZTEST()
1215 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1220 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1223 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x38, 'h', 'o', in ZTEST()
1224 's', 't', 'n', 'a', 'm', 'e', 'B', 0x16, 0x06, 'D', 'p', 'a', in ZTEST()
1225 't', 'h', 0x11, 0x32, 0x36, 'q', 'u', 'e', 'r', 'y', 0x30, 0x06, in ZTEST()
1226 'q', 'u', 'e', 'r', 'y', 0x31, 0xd1, 0x00, 0x80, in ZTEST()
1232 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1235 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x38, 'h', 'o', in ZTEST()
1236 's', 't', 'n', 'a', 'm', 'e', 'B', 0x16, 0x06, 'D', 'p', 'a', in ZTEST()
1237 't', 'h', 0x11, 0x32, 0x36, 'q', 'u', 'e', 'r', 'y', 0x30, 0x06, in ZTEST()
1238 'q', 'u', 'e', 'r', 'y', 0x31, 0x21, 0x3c, 0xb1, 0x80, in ZTEST()
1243 r = coap_append_option_int(&cpkt, COAP_OPTION_OBSERVE, 0); in ZTEST()
1244 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1247 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x38, 'h', 'o', in ZTEST()
1248 's', 't', 'n', 'a', 'm', 'e', 0x30, 0x12, 0x16, 0x06, 'D', 'p', in ZTEST()
1249 'a', 't', 'h', 0x11, 0x32, 0x36, 'q', 'u', 'e', 'r', 'y', 0x30, in ZTEST()
1250 0x06, 'q', 'u', 'e', 'r', 'y', 0x31, 0x21, 0x3c, 0xb1, 0x80, in ZTEST()
1256 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1259 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x38, 'h', 'o', 's', in ZTEST()
1260 't', 'n', 'a', 'm', 'e', 0x30, 0x12, 0x16, 0x06, 'D', 'p', 'a', 't', in ZTEST()
1261 'h', 0x11, 0x32, 0x21, 0x03, 0x16, 'q', 'u', 'e', 'r', 'y', 0x30, 0x06, in ZTEST()
1262 'q', 'u', 'e', 'r', 'y', 0x31, 0x21, 0x3c, 0xb1, 0x80, in ZTEST()
1268 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1271 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x38, 'h', 'o', 's', in ZTEST()
1272 't', 'n', 'a', 'm', 'e', 0x30, 0x12, 0x16, 0x06, 'D', 'p', 'a', 't', in ZTEST()
1273 'h', 0x11, 0x32, 0x21, 0x03, 0x16, 'q', 'u', 'e', 'r', 'y', 0x30, 0x06, in ZTEST()
1274 'q', 'u', 'e', 'r', 'y', 0x31, 0x21, 0x3c, 0xb1, 0x80, 0xd1, 0x13, 0x40, in ZTEST()
1296 } while (0)
1306 memset(data_buf[0], 0, ARRAY_SIZE(data_buf[0])); in init_basic_test_msg()
1311 strlen(token), token, COAP_METHOD_POST, 0x1234); in init_basic_test_msg()
1312 zassert_equal(r, 0, "Could not initialize packet"); in init_basic_test_msg()
1316 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1319 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1322 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1325 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1328 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1331 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1334 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1337 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1339 r = coap_append_option_int(cpkt, COAP_OPTION_OBSERVE, 0); in init_basic_test_msg()
1340 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1343 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1346 zassert_equal(r, 0, "Could not append option"); in init_basic_test_msg()
1349 0x45, 0x02, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x38, 'h', 'o', 's', in init_basic_test_msg()
1350 't', 'n', 'a', 'm', 'e', 0x30, 0x12, 0x16, 0x06, 'D', 'p', 'a', 't', in init_basic_test_msg()
1351 'h', 0x11, 0x32, 0x21, 0x03, 0x16, 'q', 'u', 'e', 'r', 'y', 0x30, 0x06, in init_basic_test_msg()
1352 'q', 'u', 'e', 'r', 'y', 0x31, 0x21, 0x3c, 0xb1, 0x80, 0xd1, 0x13, 0x40, in init_basic_test_msg()
1358 zassert_equal(r, 0, "Could not append payload marker"); in init_basic_test_msg()
1360 static const uint8_t test_payload[] = {0xde, 0xad, 0xbe, 0xef}; in init_basic_test_msg()
1363 zassert_equal(r, 0, "Could not append test payload"); in init_basic_test_msg()
1375 uint8_t *data = data_buf[0]; in ZTEST()
1380 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1383 0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x60, 0x12, 0x16, in ZTEST()
1384 0x06, 0x44, 0x70, 0x61, 0x74, 0x68, 0x11, 0x32, 0x21, 0x03, 0x16, 0x71, in ZTEST()
1385 0x75, 0x65, 0x72, 0x79, 0x30, 0x06, 0x71, 0x75, 0x65, 0x72, 0x79, 0x31, in ZTEST()
1386 0x21, 0x3c, 0xb1, 0x80, 0xd1, 0x13, 0x40, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1395 uint8_t *data = data_buf[0]; in ZTEST()
1400 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1403 0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x38, 0x68, 0x6f, 0x73, 0x74, in ZTEST()
1404 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x16, 0x06, 0x44, 0x70, 0x61, 0x74, 0x68, 0x11, 0x32, in ZTEST()
1405 0x21, 0x03, 0x16, 0x71, 0x75, 0x65, 0x72, 0x79, 0x30, 0x06, 0x71, 0x75, 0x65, 0x72, in ZTEST()
1406 0x79, 0x31, 0x21, 0x3c, 0xb1, 0x80, 0xd1, 0x13, 0x40, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1415 uint8_t *data = data_buf[0]; in ZTEST()
1420 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1423 0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x38, 0x68, 0x6f, 0x73, 0x74, in ZTEST()
1424 0x6e, 0x61, 0x6d, 0x65, 0x30, 0x12, 0x16, 0x06, 0x44, 0x70, 0x61, 0x74, 0x68, 0x11, in ZTEST()
1425 0x32, 0x21, 0x03, 0x16, 0x71, 0x75, 0x65, 0x72, 0x79, 0x30, 0x06, 0x71, 0x75, 0x65, in ZTEST()
1426 0x72, 0x79, 0x31, 0x21, 0x3c, 0xb1, 0x80, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1431 zassert_equal(r, 0, "Could not add option at end"); in ZTEST()
1434 0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x38, 0x68, 0x6f, in ZTEST()
1435 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x30, 0x12, 0x16, 0x06, 0x44, 0x70, in ZTEST()
1436 0x61, 0x74, 0x68, 0x11, 0x32, 0x21, 0x03, 0x16, 0x71, 0x75, 0x65, 0x72, in ZTEST()
1437 0x79, 0x30, 0x06, 0x71, 0x75, 0x65, 0x72, 0x79, 0x31, 0x21, 0x3c, 0xb1, in ZTEST()
1438 0x80, 0xd1, 0x13, 0x41, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1446 uint8_t *data = data_buf[0]; in ZTEST()
1451 memset(data_buf[0], 0, ARRAY_SIZE(data_buf[0])); in ZTEST()
1456 strlen(token), token, COAP_METHOD_POST, 0x1234); in ZTEST()
1457 zassert_equal(r1, 0, "Could not initialize packet"); in ZTEST()
1460 zassert_equal(r1, 0, "Could not append option"); in ZTEST()
1463 zassert_equal(r1, 0, "Could not append payload marker"); in ZTEST()
1465 static const uint8_t test_payload[] = {0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1468 zassert_equal(r1, 0, "Could not append test payload"); in ZTEST()
1470 static const uint8_t expected_0[] = {0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, in ZTEST()
1471 0x65, 0x6e, 0xb4, 0x70, 0x61, 0x74, 0x68, in ZTEST()
1472 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1478 zassert_equal(r1, 0, "Could not remove option"); in ZTEST()
1480 static const uint8_t expected_1[] = {0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, in ZTEST()
1481 0x65, 0x6e, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1483 ASSERT_OPTIONS_AND_PAYLOAD(cpkt, 0, expected_1, 14, 0); in ZTEST()
1490 uint8_t *data = data_buf[0]; in ZTEST()
1495 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1498 0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x38, 0x68, 0x6f, 0x73, in ZTEST()
1499 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x30, 0x12, 0x16, 0x06, 0x44, 0x70, 0x61, 0x74, in ZTEST()
1500 0x68, 0x11, 0x32, 0x21, 0x03, 0x16, 0x71, 0x75, 0x65, 0x72, 0x79, 0x31, 0x21, in ZTEST()
1501 0x3c, 0xb1, 0x80, 0xd1, 0x13, 0x40, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1510 uint8_t *data = data_buf[0]; in ZTEST()
1515 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1518 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1521 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1524 0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x38, 0x68, 0x6f, 0x73, in ZTEST()
1525 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x84, 0x70, 0x61, 0x74, 0x68, 0x11, 0x32, 0x21, in ZTEST()
1526 0x03, 0x16, 0x71, 0x75, 0x65, 0x72, 0x79, 0x30, 0x06, 0x71, 0x75, 0x65, 0x72, in ZTEST()
1527 0x79, 0x31, 0x21, 0x3c, 0xb1, 0x80, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1532 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1535 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1538 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1541 0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0xb4, 0x70, 0x61, 0x74, in ZTEST()
1542 0x68, 0x31, 0x03, 0x16, 0x71, 0x75, 0x65, 0x72, 0x79, 0x30, 0x06, 0x71, 0x75, in ZTEST()
1543 0x65, 0x72, 0x79, 0x31, 0x21, 0x3c, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1548 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1551 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1554 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1556 static const uint8_t expected_2[] = {0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, 0x65, in ZTEST()
1557 0x6e, 0xd1, 0x01, 0x03, 0x16, 0x71, 0x75, 0x65, in ZTEST()
1558 0x72, 0x79, 0x31, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1563 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1566 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1568 static const uint8_t expected_3[] = {0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, 0x6b, in ZTEST()
1569 0x65, 0x6e, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1571 ASSERT_OPTIONS_AND_PAYLOAD(cpkt, 0, expected_3, 14, 0); in ZTEST()
1575 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1577 ASSERT_OPTIONS_AND_PAYLOAD(cpkt, 0, expected_3, 14, 0); in ZTEST()
1584 uint8_t *data = data_buf[0]; in ZTEST()
1587 memset(data_buf[0], 0, ARRAY_SIZE(data_buf[0])); in ZTEST()
1590 strlen(token), token, COAP_METHOD_POST, 0x1234); in ZTEST()
1591 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
1594 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1597 zassert_equal(r, 0, "Could not append option"); in ZTEST()
1600 zassert_equal(r, 0, "Could not append payload marker"); in ZTEST()
1602 static const uint8_t test_payload[] = {0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1606 static const uint8_t expected_original_msg[] = {0x45, 0x02, 0x12, 0x34, 0x74, 0x6f, in ZTEST()
1607 0x6b, 0x65, 0x6e, 0xc1, 0x3c, 0x51, in ZTEST()
1608 0x2a, 0xff, 0xde, 0xad, 0xbe, 0xef}; in ZTEST()
1614 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1620 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1626 zassert_equal(r, 0, "Could not remove option"); in ZTEST()
1636 uint8_t *data = data_buf[0]; in assert_coap_packet_set_path_query_options()
1637 struct coap_option options[16] = {0}; in assert_coap_packet_set_path_query_options()
1640 memset(data_buf[0], 0, ARRAY_SIZE(data_buf[0])); in assert_coap_packet_set_path_query_options()
1645 COAP_METHOD_GET, 0x1234); in assert_coap_packet_set_path_query_options()
1646 zassert_equal(res, 0, "Could not initialize packet"); in assert_coap_packet_set_path_query_options()
1649 zassert_equal(res, 0, "Could not set path/query, path: %s", path); in assert_coap_packet_set_path_query_options()
1652 if (res <= 0) { in assert_coap_packet_set_path_query_options()
1654 zassert_true(((expected == NULL) && (expected_len == 0U)), in assert_coap_packet_set_path_query_options()
1658 for (unsigned int i = 0U; i < expected_len; ++i) { in assert_coap_packet_set_path_query_options()
1659 /* validate expected options, the rest shall be 0 */ in assert_coap_packet_set_path_query_options()
1671 zassert_true((options[i].len == 0U), in assert_coap_packet_set_path_query_options()
1681 assert_coap_packet_set_path_query_options(" ", NULL, 0U, COAP_OPTION_URI_PATH); in ZTEST()
1682 assert_coap_packet_set_path_query_options("", NULL, 0U, COAP_OPTION_URI_PATH); in ZTEST()
1683 assert_coap_packet_set_path_query_options("/", NULL, 0U, COAP_OPTION_URI_PATH); in ZTEST()
1684 assert_coap_packet_set_path_query_options("?", NULL, 0U, COAP_OPTION_URI_QUERY); in ZTEST()
1696 assert_coap_packet_set_path_query_options("a", NULL, 0, COAP_OPTION_URI_QUERY); in ZTEST()
1747 uint8_t *data = data_buf[0]; in ZTEST()
1770 COAP_TYPE_CON, 0, coap_next_token(), in ZTEST()
1772 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
1784 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
1793 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
1804 0x45, 0x01, 0x12, 0x34, 't', 'o', 'k', 'e', 'n', 0x60, /* enable observe option */ in ZTEST()
1805 0x51, 's', 0x01, '2', /* path */ in ZTEST()
1810 uint8_t *data = data_buf[0]; in ZTEST()
1820 zassert_equal(r, 0, "Could not initialize packet"); in ZTEST()
1824 zassert_equal(r, 0, "Could not handle packet"); in ZTEST()
1831 for (int i = 0; i < 15; i++) { in ZTEST()