Skip to content

Commit 29667c1

Browse files
committed
Review fixes #3
1 parent cb16a31 commit 29667c1

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

app/src/sm_at_gnss.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,11 @@ static void agnss_requestor(struct k_work *)
322322
int err;
323323
struct nrf_modem_gnss_agnss_data_frame req;
324324
struct nrf_cloud_coap_agnss_request request = {
325-
NRF_CLOUD_COAP_AGNSS_REQ_CUSTOM,
326-
&req,
325+
.type = NRF_CLOUD_COAP_AGNSS_REQ_CUSTOM,
326+
.agnss_req = &req,
327+
.net_info = NULL,
328+
.filtered = false,
329+
.mask_angle = 0,
327330
};
328331
char *agnss_rest_data_buf = calloc(1, NRF_CLOUD_AGNSS_MAX_DATA_SIZE);
329332

@@ -339,9 +342,9 @@ static void agnss_requestor(struct k_work *)
339342
}
340343

341344
struct nrf_cloud_coap_agnss_result result = {
342-
agnss_rest_data_buf,
343-
NRF_CLOUD_AGNSS_MAX_DATA_SIZE,
344-
0
345+
.buf = agnss_rest_data_buf,
346+
.buf_sz = NRF_CLOUD_AGNSS_MAX_DATA_SIZE,
347+
.agnss_sz = 0,
345348
};
346349

347350
#if defined(CONFIG_SM_NRF_CLOUD_LOCATION)
@@ -352,7 +355,11 @@ static void agnss_requestor(struct k_work *)
352355
} else {
353356
LOG_WRN("Requesting A-GNSS data without location assistance");
354357
free(net_info);
358+
net_info = NULL;
355359
}
360+
#else
361+
LOG_INF("Requesting A-GNSS data without location assistance "
362+
"since CONFIG_SM_NRF_CLOUD_LOCATION is not defined");
356363
#endif
357364
err = nrf_cloud_coap_agnss_data_get(&request, &result);
358365
#if defined(CONFIG_SM_NRF_CLOUD_LOCATION)

app/src/sm_at_nrfcloud.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ static char nrfcloud_device_id[NRF_CLOUD_CLIENT_ID_MAX_LEN];
2828

2929
bool sm_nrf_cloud_ready;
3030
bool sm_nrf_cloud_send_location;
31+
/* Parameters saved before submitting connection work. */
32+
static bool nrfcloud_connect;
33+
static bool nrfcloud_conn_send_location;
3134

3235
static void nrfcloud_conn_work_fn(struct k_work *work);
3336
K_WORK_DEFINE(nrfcloud_conn_work, nrfcloud_conn_work_fn);
@@ -78,10 +81,6 @@ K_WORK_DELAYABLE_DEFINE(ncellmeas_timeout_backup_work, ncellmeas_timeout_backup_
7881
/* Signals completion of an AT%NCELLMEAS measurement (%NCELLMEAS URC). */
7982
K_SEM_DEFINE(ncellmeas_sem_ncellmeas_evt, 0, 1);
8083

81-
/* Parameters saved before submitting connection work. */
82-
static bool nrfcloud_connect;
83-
static bool nrfcloud_conn_send_location;
84-
8584
/* nRF Cloud location request cellular data. */
8685
static struct lte_lc_cells_info *nrfcloud_cell_data;
8786

0 commit comments

Comments
 (0)