Skip to content

Commit

Permalink
Merge pull request RIOT-OS#10193 from bergzand/pr/coap/include_rfc842…
Browse files Browse the repository at this point in the history
…8_rfc8132

coap: Update list of defines for "PATCH and FETCH Methods" and SenML
  • Loading branch information
kb2ma authored Sep 8, 2019
2 parents 35c5869 + 7bd9e68 commit 113dd64
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
29 changes: 22 additions & 7 deletions sys/include/net/coap.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ extern "C" {
#define COAP_METHOD_POST (2)
#define COAP_METHOD_PUT (3)
#define COAP_METHOD_DELETE (4)
#define COAP_METHOD_FETCH (5)
#define COAP_METHOD_PATCH (6)
#define COAP_METHOD_IPATCH (7)
/** @} */

/**
Expand Down Expand Up @@ -104,9 +107,11 @@ extern "C" {
#define COAP_CODE_METHOD_NOT_ALLOWED ((4 << 5) | 5)
#define COAP_CODE_NOT_ACCEPTABLE ((4 << 5) | 6)
#define COAP_CODE_REQUEST_ENTITY_INCOMPLETE ((4 << 5) | 8)
#define COAP_CODE_CONFLICT ((4 << 5) | 9)
#define COAP_CODE_PRECONDITION_FAILED ((4 << 5) | 12)
#define COAP_CODE_REQUEST_ENTITY_TOO_LARGE ((4 << 5) | 13)
#define COAP_CODE_UNSUPPORTED_CONTENT_FORMAT ((4 << 5) | 15)
#define COAP_CODE_UNPROCESSABLE_ENTITY ((4 << 5) | 22)
/** @} */

/**
Expand Down Expand Up @@ -140,13 +145,23 @@ extern "C" {
* @anchor net_coap_format
* @{
*/
#define COAP_FORMAT_TEXT (0)
#define COAP_FORMAT_LINK (40)
#define COAP_FORMAT_XML (41)
#define COAP_FORMAT_OCTET (42)
#define COAP_FORMAT_EXI (47)
#define COAP_FORMAT_JSON (50)
#define COAP_FORMAT_CBOR (60)
#define COAP_FORMAT_TEXT (0)
#define COAP_FORMAT_LINK (40)
#define COAP_FORMAT_XML (41)
#define COAP_FORMAT_OCTET (42)
#define COAP_FORMAT_EXI (47)
#define COAP_FORMAT_JSON (50)
#define COAP_FORMAT_JSON_PATCH_JSON (51)
#define COAP_FORMAT_MERGE_PATCH_JSON (52)
#define COAP_FORMAT_CBOR (60)
#define COAP_FORMAT_SENML_JSON (110)
#define COAP_FORMAT_SENSML_JSON (111)
#define COAP_FORMAT_SENML_CBOR (112)
#define COAP_FORMAT_SENSML_CBOR (113)
#define COAP_FORMAT_SENML_EXI (114)
#define COAP_FORMAT_SENSML_EXI (115)
#define COAP_FORMAT_SENML_XML (310)
#define COAP_FORMAT_SENSML_XML (311)
/** @} */

/**
Expand Down
11 changes: 7 additions & 4 deletions sys/include/net/nanocoap.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ extern "C" {
* @name Nanocoap specific CoAP method flags used in coap_handlers array
* @{
*/
#define COAP_GET (0x1)
#define COAP_POST (0x2)
#define COAP_PUT (0x4)
#define COAP_DELETE (0x8)
#define COAP_GET (0x01)
#define COAP_POST (0x02)
#define COAP_PUT (0x04)
#define COAP_DELETE (0x08)
#define COAP_FETCH (0x10)
#define COAP_PATCH (0x20)
#define COAP_IPATCH (0x40)
#define COAP_MATCH_SUBTREE (0x8000) /**< Path is considered as a prefix
when matching */
/** @} */
Expand Down

0 comments on commit 113dd64

Please sign in to comment.