Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: lib: nrf_cloud: Fix nrf_cloud_obj_reset #11646

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ int nrf_cloud_obj_reset(struct nrf_cloud_obj *const obj)
case NRF_CLOUD_OBJ_TYPE_JSON:
{
obj->json = NULL;
break;
}
default:
return -ENOTSUP;
Expand All @@ -207,7 +208,7 @@ int nrf_cloud_obj_reset(struct nrf_cloud_obj *const obj)

obj->enc_src = NRF_CLOUD_ENC_SRC_NONE;

return -ENOTSUP;
return 0;
}

int nrf_cloud_obj_bulk_init(struct nrf_cloud_obj *const bulk)
Expand Down
9 changes: 7 additions & 2 deletions subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,13 +931,13 @@ int json_send_to_cloud(cJSON *const request)
return -ENOMEM;
}

LOG_DBG("Created request: %s", msg_string);

struct nct_dc_data msg = {
.data.ptr = msg_string,
.data.len = strlen(msg_string)
};

LOG_DBG("Created request: %s (size: %u)", (char *)msg.data.ptr, msg.data.len);

err = nct_dc_send(&msg);
if (err) {
LOG_ERR("Failed to send request, error: %d", err);
Expand Down Expand Up @@ -2321,6 +2321,9 @@ int nrf_cloud_cell_pos_req_json_encode(struct lte_lc_cells_info const *const inf
return -EINVAL;
}

LOG_DBG("Encoding lte_lc_cells_info with ncells_count: %u and gci_cells_count: %u",
inf->ncells_count, inf->gci_cells_count);

int err;
cJSON *lte_array;
cJSON *lte_obj;
Expand Down Expand Up @@ -2385,6 +2388,8 @@ int nrf_cloud_wifi_req_json_encode(struct wifi_scan_info const *const wifi,
return -EINVAL;
}

LOG_DBG("Encoding wifi_scan_info with count: %u", wifi->cnt);

cJSON *wifi_obj = NULL;
cJSON *ap_array = NULL;

Expand Down