From cb729b0785ca41cda501c4a1e8dfa67f32ca6aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Wed, 4 May 2016 19:12:58 +0200 Subject: [PATCH] oma-lwm2m: Use sv for string value, bv for boolean Like the OMA docs specify --- apps/oma-lwm2m/lwm2m-engine.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/oma-lwm2m/lwm2m-engine.c b/apps/oma-lwm2m/lwm2m-engine.c index 62f549db4..e2f6bba7c 100644 --- a/apps/oma-lwm2m/lwm2m-engine.c +++ b/apps/oma-lwm2m/lwm2m-engine.c @@ -639,10 +639,10 @@ write_rd_json_data(const lwm2m_context_t *context, value = lwm2m_object_get_resource_string(resource, context); slen = lwm2m_object_get_resource_strlen(resource, context); if(value != NULL) { - PRINTF("%s{\"n\":\"%u\",\"vs\":\"%.*s\"}", s, + PRINTF("%s{\"n\":\"%u\",\"sv\":\"%.*s\"}", s, resource->id, slen, value); len = snprintf(&buffer[rdlen], size - rdlen, - "%s{\"n\":\"%u\",\"vs\":\"%.*s\"}", s, + "%s{\"n\":\"%u\",\"sv\":\"%.*s\"}", s, resource->id, slen, value); } } else if(lwm2m_object_is_resource_int(resource)) { @@ -682,10 +682,10 @@ write_rd_json_data(const lwm2m_context_t *context, } else if(lwm2m_object_is_resource_boolean(resource)) { int value; if(lwm2m_object_get_resource_boolean(resource, context, &value)) { - PRINTF("%s{\"n\":\"%u\",\"v\":%s}", s, resource->id, + PRINTF("%s{\"n\":\"%u\",\"bv\":%s}", s, resource->id, value ? "true" : "false"); len = snprintf(&buffer[rdlen], size - rdlen, - "%s{\"n\":\"%u\",\"v\":%s}", s, resource->id, + "%s{\"n\":\"%u\",\"bv\":%s}", s, resource->id, value ? "true" : "false"); } }