Skip to content

Commit

Permalink
pdu.h: new methods FETCH, PATCH, iPATCH from RFC 8132
Browse files Browse the repository at this point in the history
  • Loading branch information
obgm committed Apr 7, 2017
1 parent f446afd commit ac94964
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/coap/pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
#define COAP_REQUEST_POST 2
#define COAP_REQUEST_PUT 3
#define COAP_REQUEST_DELETE 4
#define COAP_REQUEST_FETCH 5 /* RFC 8132 */
#define COAP_REQUEST_PATCH 6 /* RFC 8132 */
#define COAP_REQUEST_IPATCH 7 /* RFC 8132 */

/* CoAP option types (be sure to update check_critical when adding options */

Expand Down
3 changes: 2 additions & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ msg_type_string(unsigned short t) {
/** Returns a textual description of the method or response code. */
static const char *
msg_code_string(unsigned short c) {
static char *methods[] = { "0.00", "GET", "POST", "PUT", "DELETE", "PATCH" };
static char *methods[] = { "0.00", "GET", "POST", "PUT", "DELETE",
"FETCH", "PATCH", "iPATCH" };
static char buf[5];

if (c < sizeof(methods)/sizeof(char *)) {
Expand Down

0 comments on commit ac94964

Please sign in to comment.