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 <mike@foundries.io>
This commit is contained in:
Michael Scott 2019-01-25 15:56:23 -08:00 committed by Anas Nashif
commit 181544beec
3 changed files with 359 additions and 106 deletions

View file

@ -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;