Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix: update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 7, 2023
1 parent b72d4d1 commit d54bf17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/cloud/cloud_codec/nrf_cloud/nrf_cloud_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <date_time.h>
#include <net/nrf_cloud_codec.h>
#include <net/nrf_cloud_location.h>
#include <cloud_codec.h>

Expand Down Expand Up @@ -727,18 +728,19 @@ int cloud_codec_encode_cloud_location(
return -ENODATA;
}

err = nrf_cloud_location_request_json_get(
root_obj = cJSON_CreateObject();
err = nrf_cloud_location_request_msg_json_encode(
cloud_location->neighbor_cells_valid ? &cell_info : NULL,
#if defined(CONFIG_LOCATION_METHOD_WIFI)
cloud_location->wifi_access_points_valid ? &wifi_info : NULL,
#else
NULL,
#endif
true,
&root_obj);
root_obj);
if (err) {
LOG_ERR("nrf_cloud_location_request_json_get, error: %d", err);
return -ENOMEM;
LOG_ERR("nrf_cloud_location_request_msg_json_encode, error: %d", err);
goto exit;
}

buffer = cJSON_PrintUnformatted(root_obj);
Expand All @@ -757,7 +759,9 @@ int cloud_codec_encode_cloud_location(
output->len = strlen(buffer);

exit:
cloud_location->queued = false;
if (!err) {
cloud_location->queued = false;
}
cJSON_Delete(root_obj);
return err;
#endif /* CONFIG_NRF_CLOUD_LOCATION */
Expand Down
1 change: 1 addition & 0 deletions tests/nrf_cloud_codec_mocked_cjson/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test_runner_generate(src/nrf_cloud_codec_mocked_test.c)
cmock_handle(${ASSET_TRACKER_V2_DIR}/src/cloud/cloud_codec/json_helpers.h)
cmock_handle(${NRF_DIR}/include/date_time.h)
cmock_handle(${NRF_DIR}/include/net/nrf_cloud.h)
cmock_handle(${NRF_DIR}/include/net/nrf_cloud_codec.h)
cmock_handle(src/cJSON_to_mock.h)

# add test file
Expand Down

0 comments on commit d54bf17

Please sign in to comment.