net: lwm2m: makes CBOR as one of the default...

...content formats

In case that SenML CBOR or SenML JSON are both disabled there is need to
use plain CBOR as backup.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
This commit is contained in:
Veijo Pesonen 2022-04-19 12:20:00 +03:00 committed by Carles Cufí
commit cfcc891d3d

View file

@ -4453,8 +4453,11 @@ static int lwm2m_engine_default_content_format(uint16_t *accept_format)
if (IS_ENABLED(CONFIG_LWM2M_RW_SENML_JSON_SUPPORT)) {
LOG_DBG("No accept option given. Assume SenML Json.");
*accept_format = LWM2M_FORMAT_APP_SEML_JSON;
} else if (IS_ENABLED(CONFIG_LWM2M_RW_CBOR_SUPPORT)) {
LOG_DBG("No accept option given. Assume CBOR.");
*accept_format = LWM2M_FORMAT_APP_CBOR;
} else {
LOG_ERR("SenML CBOR or JSON is not supported");
LOG_ERR("CBOR, SenML CBOR or SenML JSON is not supported");
return -ENOTSUP;
}
} else if (IS_ENABLED(CONFIG_LWM2M_RW_OMA_TLV_SUPPORT)) {