From 726ebf3dad0aca89612a98dab75e51f3bd74113c Mon Sep 17 00:00:00 2001
From: Koen Zandberg <koen@bergzand.net>
Date: Wed, 3 Oct 2018 21:26:37 +0200
Subject: [PATCH] coap: use COAP_FORMAT style content-format defines

Replaces all occurences of COAP_CT_.* with COAP_FORMAT_.*
---
 sys/net/application_layer/gcoap/gcoap.c       | 2 +-
 sys/net/application_layer/nanocoap/nanocoap.c | 2 +-
 tests/unittests/tests-gcoap/tests-gcoap.c     | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/net/application_layer/gcoap/gcoap.c b/sys/net/application_layer/gcoap/gcoap.c
index d39202a580..28db00805c 100644
--- a/sys/net/application_layer/gcoap/gcoap.c
+++ b/sys/net/application_layer/gcoap/gcoap.c
@@ -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;
diff --git a/sys/net/application_layer/nanocoap/nanocoap.c b/sys/net/application_layer/nanocoap/nanocoap.c
index 0c9ebb25ee..528a655a80 100644
--- a/sys/net/application_layer/nanocoap/nanocoap.c
+++ b/sys/net/application_layer/nanocoap/nanocoap.c
@@ -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;
diff --git a/tests/unittests/tests-gcoap/tests-gcoap.c b/tests/unittests/tests-gcoap/tests-gcoap.c
index e519aaf87a..fd20ae4b99 100644
--- a/tests/unittests/tests-gcoap/tests-gcoap.c
+++ b/tests/unittests/tests-gcoap/tests-gcoap.c
@@ -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);
-- 
GitLab