Skip to content

Commit 181544b

Browse files
mike-scottnashif
authored andcommitted
net: lwm2m: add JSON formatter for WRITE operations
Update the parsing functions for JSON used by the JSON data formatter and enable it in the LwM2M engine. Signed-off-by: Michael Scott <[email protected]>
1 parent 26599e3 commit 181544b

File tree

3 files changed

+360
-107
lines changed

3 files changed

+360
-107
lines changed

subsys/net/lib/lwm2m/lwm2m_engine.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,13 @@ static int select_reader(struct lwm2m_input_context *in, u16_t format)
12011201
in->reader = &oma_tlv_reader;
12021202
break;
12031203

1204+
#ifdef CONFIG_LWM2M_RW_JSON_SUPPORT
1205+
case LWM2M_FORMAT_OMA_JSON:
1206+
case LWM2M_FORMAT_OMA_OLD_JSON:
1207+
in->reader = &json_reader;
1208+
break;
1209+
#endif
1210+
12041211
default:
12051212
LOG_WRN("Unknown content type %u", format);
12061213
return -ENOMSG;

0 commit comments

Comments
 (0)