diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 0f327bdcbf7f..706acfe5fdeb 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -889,6 +889,7 @@ Libraries for networking * A bug preventing ``AIR_QUAL`` from being enabled in shadow UI service info. * A bug that prevented an MQTT FOTA job from being started. * An invalid value for a shadow delta change to the control section is now rejected by updating the desired section to the previous value. + * Encoding of the "doReply" flag in the :c:func:`nrf_cloud_obj_location_request_create` function. * Removed: diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c index 9223a5977a2d..5ad1f9632530 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c @@ -923,15 +923,15 @@ int nrf_cloud_obj_location_request_create(struct nrf_cloud_obj *const obj, goto cleanup; } - /* By default, nRF Cloud will send the location to the device */ - if (!request_loc && - nrf_cloud_obj_num_add(obj, NRF_CLOUD_LOCATION_KEY_DOREPLY, 0, true)) { - err = -ENOMEM; + err = nrf_cloud_obj_init(&data_obj); + if (err) { goto cleanup; } - err = nrf_cloud_obj_init(&data_obj); - if (err) { + /* By default, nRF Cloud will send the location to the device */ + if (!request_loc && + nrf_cloud_obj_num_add(&data_obj, NRF_CLOUD_LOCATION_KEY_DOREPLY, 0, false)) { + err = -ENOMEM; goto cleanup; }