10#include <zephyr/kernel.h>
16#include <zephyr/net/net_ip.h>
18#if defined(CONFIG_LOCATION)
22#include <nrf_modem_gnss.h>
24#if defined(CONFIG_LWM2M)
25#include <zephyr/net/lwm2m.h>
44#define CLOUD_GNSS_HEADING_ACC_LIMIT (float)60.0
159 char appv[CONFIG_ASSET_TRACKER_V2_APP_VERSION_MAX_LEN];
188 char ip[INET6_ADDRSTRLEN];
190 char apn[CONFIG_CLOUD_CODEC_APN_LEN_MAX];
228#if defined(CONFIG_LOCATION_METHOD_WIFI)
231 struct wifi_scan_result
ap_info[CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT];
246#if defined(CONFIG_LOCATION_METHOD_WIFI)
268 struct nrf_modem_gnss_agnss_data_frame
request;
508 size_t gnss_buf_count,
509 size_t sensor_buf_count,
510 size_t modem_stat_buf_count,
511 size_t modem_dyn_buf_count,
513 size_t impact_buf_count,
514 size_t bat_buf_count);
519 int *head_sensor_buf,
520 size_t buffer_count);
525 size_t buffer_count);
530 int *head_impact_buf,
531 size_t buffer_count);
536 size_t buffer_count);
541 size_t buffer_count);
547 size_t buffer_count);
static const struct event_proxy_config cfg
Definition event_proxy_def.h:28
int cloud_codec_init(struct cloud_data_cfg *cfg, cloud_codec_evt_handler_t event_handler)
Initialize cloud codec.
int cloud_codec_encode_cloud_location(struct cloud_codec_data *output, struct cloud_data_cloud_location *cloud_location)
Encode cloud codec cloud location data.
int cloud_codec_decode_config(const char *input, size_t input_len, struct cloud_data_cfg *cfg)
Decode received configuration.
cloud_codec_event_type
Definition cloud_codec.h:285
@ CLOUD_CODEC_EVT_CONFIG_UPDATE
Definition cloud_codec.h:287
int cloud_codec_encode_data(struct cloud_codec_data *output, struct cloud_data_gnss *gnss_buf, struct cloud_data_sensors *sensor_buf, struct cloud_data_modem_static *modem_stat_buf, struct cloud_data_modem_dynamic *modem_dyn_buf, struct cloud_data_ui *ui_buf, struct cloud_data_impact *impact_buf, struct cloud_data_battery *bat_buf)
Encode cloud buffer data.
int cloud_codec_encode_batch_data(struct cloud_codec_data *output, struct cloud_data_gnss *gnss_buf, struct cloud_data_sensors *sensor_buf, struct cloud_data_modem_static *modem_stat_buf, struct cloud_data_modem_dynamic *modem_dyn_buf, struct cloud_data_ui *ui_buf, struct cloud_data_impact *impact_buf, struct cloud_data_battery *bat_buf, size_t gnss_buf_count, size_t sensor_buf_count, size_t modem_stat_buf_count, size_t modem_dyn_buf_count, size_t ui_buf_count, size_t impact_buf_count, size_t bat_buf_count)
Encode a batch of cloud buffer data.
int cloud_codec_encode_ui_data(struct cloud_codec_data *output, struct cloud_data_ui *ui_buf)
Encode UI data.
void cloud_codec_populate_gnss_buffer(struct cloud_data_gnss *gnss_buffer, struct cloud_data_gnss *new_gnss_data, int *head_gnss_buf, size_t buffer_count)
void cloud_codec_populate_bat_buffer(struct cloud_data_battery *bat_buffer, struct cloud_data_battery *new_bat_data, int *head_bat_buf, size_t buffer_count)
void cloud_codec_populate_ui_buffer(struct cloud_data_ui *ui_buffer, struct cloud_data_ui *new_ui_data, int *head_ui_buf, size_t buffer_count)
int cloud_codec_encode_pgps_request(struct cloud_codec_data *output, struct cloud_data_pgps_request *pgps_request)
Encode cloud codec P-GPS request.
int cloud_codec_encode_config(struct cloud_codec_data *output, struct cloud_data_cfg *cfg)
Encode current configuration.
int cloud_codec_encode_impact_data(struct cloud_codec_data *output, struct cloud_data_impact *impact_buf)
Encode impact data.
void cloud_codec_populate_impact_buffer(struct cloud_data_impact *impact_buf, struct cloud_data_impact *new_impact_data, int *head_impact_buf, size_t buffer_count)
void cloud_codec_populate_modem_dynamic_buffer(struct cloud_data_modem_dynamic *modem_buffer, struct cloud_data_modem_dynamic *new_modem_data, int *head_modem_buf, size_t buffer_count)
void(* cloud_codec_evt_handler_t)(const struct cloud_codec_evt *evt)
Event handler prototype.
Definition cloud_codec.h:302
int cloud_codec_decode_cloud_location(const char *input, size_t input_len, struct location_data *location)
Decode received cloud location data.
void cloud_codec_populate_sensor_buffer(struct cloud_data_sensors *sensor_buffer, struct cloud_data_sensors *new_sensor_data, int *head_sensor_buf, size_t buffer_count)
int cloud_codec_encode_agnss_request(struct cloud_codec_data *output, struct cloud_data_agnss_request *agnss_request)
Encode cloud codec A-GNSS request.
lte_lc_lte_mode
Definition lte_lc.h:89
Public APIs for the Location library.
char * buf
Definition cloud_codec.h:208
uint8_t valid_object_paths
Definition cloud_codec.h:214
struct lwm2m_obj_path paths[CONFIG_CLOUD_CODEC_LWM2M_PATH_LIST_ENTRIES_MAX]
Definition cloud_codec.h:212
size_t len
Definition cloud_codec.h:210
Definition cloud_codec.h:206
struct cloud_data_cfg config_update
Definition cloud_codec.h:294
enum cloud_codec_event_type type
Definition cloud_codec.h:292
Definition cloud_codec.h:290
bool queued
Definition cloud_codec.h:270
struct nrf_modem_gnss_agnss_data_frame request
Definition cloud_codec.h:268
uint32_t area
Definition cloud_codec.h:266
int mcc
Definition cloud_codec.h:260
int mnc
Definition cloud_codec.h:262
uint32_t cell
Definition cloud_codec.h:264
Definition cloud_codec.h:258
uint16_t bat
Definition cloud_codec.h:49
bool queued
Definition cloud_codec.h:53
int64_t bat_ts
Definition cloud_codec.h:51
Structure containing battery data published to cloud.
Definition cloud_codec.h:47
int movement_resolution
Definition cloud_codec.h:111
int location_timeout
Definition cloud_codec.h:107
double accelerometer_inactivity_timeout
Definition cloud_codec.h:121
bool active_mode
Definition cloud_codec.h:105
double accelerometer_activity_threshold
Definition cloud_codec.h:117
double accelerometer_inactivity_threshold
Definition cloud_codec.h:119
int active_wait_timeout
Definition cloud_codec.h:109
struct cloud_data_no_data no_data
Definition cloud_codec.h:123
int movement_timeout
Definition cloud_codec.h:115
Definition cloud_codec.h:103
bool neighbor_cells_valid
Definition cloud_codec.h:243
bool queued
Definition cloud_codec.h:255
struct cloud_data_wifi_access_points wifi_access_points
Definition cloud_codec.h:250
bool wifi_access_points_valid
Definition cloud_codec.h:248
struct cloud_data_neighbor_cells neighbor_cells
Definition cloud_codec.h:245
int64_t ts
Definition cloud_codec.h:253
Definition cloud_codec.h:241
double lon
Definition cloud_codec.h:60
float alt_acc
Definition cloud_codec.h:66
float alt
Definition cloud_codec.h:64
float hdg
Definition cloud_codec.h:72
float hdg_acc
Definition cloud_codec.h:74
float spd
Definition cloud_codec.h:68
double lat
Definition cloud_codec.h:58
float acc
Definition cloud_codec.h:62
float spd_acc
Definition cloud_codec.h:70
Definition cloud_codec.h:56
bool queued
Definition cloud_codec.h:86
struct cloud_data_gnss_pvt pvt
Definition cloud_codec.h:83
int64_t gnss_ts
Definition cloud_codec.h:80
Structure containing GNSS data published to cloud.
Definition cloud_codec.h:78
bool queued
Definition cloud_codec.h:133
double magnitude
Definition cloud_codec.h:131
int64_t ts
Definition cloud_codec.h:129
Definition cloud_codec.h:127
uint32_t cell
Definition cloud_codec.h:184
int16_t rsrp
Definition cloud_codec.h:186
char mccmnc[7]
Definition cloud_codec.h:192
uint8_t band
Definition cloud_codec.h:174
int64_t ts
Definition cloud_codec.h:172
uint16_t area
Definition cloud_codec.h:182
uint16_t mcc
Definition cloud_codec.h:178
enum lte_lc_lte_mode nw_mode
Definition cloud_codec.h:176
char apn[CONFIG_CLOUD_CODEC_APN_LEN_MAX]
Definition cloud_codec.h:190
uint16_t mnc
Definition cloud_codec.h:180
bool queued
Definition cloud_codec.h:194
char ip[INET6_ADDRSTRLEN]
Definition cloud_codec.h:188
Definition cloud_codec.h:170
bool queued
Definition cloud_codec.h:167
char appv[CONFIG_ASSET_TRACKER_V2_APP_VERSION_MAX_LEN]
Definition cloud_codec.h:159
char fw[40]
Definition cloud_codec.h:163
char iccid[23]
Definition cloud_codec.h:157
char brdv[30]
Definition cloud_codec.h:161
int64_t ts
Definition cloud_codec.h:155
char imei[16]
Definition cloud_codec.h:165
Definition cloud_codec.h:153
bool queued
Definition cloud_codec.h:225
int64_t ts
Definition cloud_codec.h:223
struct lte_lc_cells_info cell_data
Definition cloud_codec.h:219
struct lte_lc_ncell neighbor_cells[CONFIG_LTE_NEIGHBOR_CELLS_MAX]
Definition cloud_codec.h:221
Definition cloud_codec.h:217
bool gnss
Definition cloud_codec.h:94
bool wifi
Definition cloud_codec.h:100
bool neighbor_cell
Definition cloud_codec.h:97
Definition cloud_codec.h:92
uint16_t interval
Definition cloud_codec.h:276
uint16_t count
Definition cloud_codec.h:274
bool queued
Definition cloud_codec.h:282
uint16_t day
Definition cloud_codec.h:278
uint32_t time
Definition cloud_codec.h:280
Definition cloud_codec.h:272
double temperature
Definition cloud_codec.h:140
double pressure
Definition cloud_codec.h:144
bool queued
Definition cloud_codec.h:150
int bsec_air_quality
Definition cloud_codec.h:148
int64_t env_ts
Definition cloud_codec.h:138
double humidity
Definition cloud_codec.h:142
Definition cloud_codec.h:136
bool queued
Definition cloud_codec.h:203
int64_t btn_ts
Definition cloud_codec.h:201
int btn
Definition cloud_codec.h:199
Definition cloud_codec.h:197
bool queued
Definition cloud_codec.h:237
struct wifi_scan_result ap_info[CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT]
Definition cloud_codec.h:231
int64_t ts
Definition cloud_codec.h:235
uint16_t cnt
Definition cloud_codec.h:233
Definition cloud_codec.h:229
Definition location.h:249
Definition lwm2m_dummy.h:10