Skip to content

Commit

Permalink
net: lwm2m: add JSON formatter for WRITE operations
Browse files Browse the repository at this point in the history
Update the parsing functions for JSON used by the JSON data
formatter and enable it in the LwM2M engine.

Signed-off-by: Michael Scott <mike@foundries.io>
  • Loading branch information
mike-scott authored and nashif committed Feb 1, 2019
1 parent 26599e3 commit 181544b
Show file tree
Hide file tree
Showing 3 changed files with 360 additions and 107 deletions.
7 changes: 7 additions & 0 deletions subsys/net/lib/lwm2m/lwm2m_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,13 @@ static int select_reader(struct lwm2m_input_context *in, u16_t format)
in->reader = &oma_tlv_reader;
break;

#ifdef CONFIG_LWM2M_RW_JSON_SUPPORT
case LWM2M_FORMAT_OMA_JSON:
case LWM2M_FORMAT_OMA_OLD_JSON:
in->reader = &json_reader;
break;
#endif

default:
LOG_WRN("Unknown content type %u", format);
return -ENOMSG;
Expand Down

0 comments on commit 181544b

Please sign in to comment.