coap: use COAP_FORMAT style content-format defines

Replaces all occurences of COAP_CT_.* with COAP_FORMAT_.*
This commit is contained in:
Koen Zandberg 2018-10-03 21:26:37 +02:00
parent 41c8c1e863
commit 726ebf3dad
3 changed files with 5 additions and 5 deletions

View File

@ -981,7 +981,7 @@ uint8_t gcoap_op_state(void)
int gcoap_get_resource_list(void *buf, size_t maxlen, uint8_t cf)
{
(void)cf; /* only used in the assert below. */
assert(cf == COAP_CT_LINK_FORMAT);
assert(cf == COAP_FORMAT_LINK);
/* skip the first listener, gcoap itself (we skip /.well-known/core) */
gcoap_listener_t *listener = _coap_state.listeners->next;

View File

@ -842,7 +842,7 @@ ssize_t coap_well_known_core_default_handler(coap_pkt_t *pkt, uint8_t *buf, \
coap_block2_init(pkt, &slicer);
uint8_t *payload = buf + coap_get_total_hdr_len(pkt);
uint8_t *bufpos = payload;
bufpos += coap_put_option_ct(bufpos, 0, COAP_CT_LINK_FORMAT);
bufpos += coap_put_option_ct(bufpos, 0, COAP_FORMAT_LINK);
bufpos += coap_opt_put_block2(bufpos, COAP_OPT_CONTENT_FORMAT, &slicer, 1);
*bufpos++ = 0xff;

View File

@ -264,15 +264,15 @@ static void test_gcoap__server_get_resource_list(void)
gcoap_register_listener(&listener);
gcoap_register_listener(&listener_second);
size = gcoap_get_resource_list(NULL, 0, COAP_CT_LINK_FORMAT);
size = gcoap_get_resource_list(NULL, 0, COAP_FORMAT_LINK);
TEST_ASSERT_EQUAL_INT(strlen(resource_list_str), size);
res[0] = 'A';
size = gcoap_get_resource_list(res, 0, COAP_CT_LINK_FORMAT);
size = gcoap_get_resource_list(res, 0, COAP_FORMAT_LINK);
TEST_ASSERT_EQUAL_INT(0, size);
TEST_ASSERT_EQUAL_INT((int)'A', (int)res[0]);
size = gcoap_get_resource_list(res, 127, COAP_CT_LINK_FORMAT);
size = gcoap_get_resource_list(res, 127, COAP_FORMAT_LINK);
res[size] = '\0';
TEST_ASSERT_EQUAL_INT(strlen(resource_list_str), size);
TEST_ASSERT_EQUAL_STRING(resource_list_str, (char *)res);