nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
json_common.h File Reference

JSON common library header. More...

#include <zephyr/kernel.h>
#include <cJSON.h>
#include "cloud_codec.h"
#include "json_protocol_names.h"

Go to the source code of this file.

Enumerations

enum  json_common_buffer_type {
  JSON_COMMON_UI , JSON_COMMON_IMPACT , JSON_COMMON_MODEM_STATIC , JSON_COMMON_MODEM_DYNAMIC ,
  JSON_COMMON_GNSS , JSON_COMMON_SENSOR , JSON_COMMON_BATTERY , JSON_COMMON_COUNT
}
 Type of data to be handled by the respective API. Used to signify what data structure that is passed in to the function. More...
 
enum  json_common_op_code { JSON_COMMON_INVALID , JSON_COMMON_ADD_DATA_TO_ARRAY , JSON_COMMON_ADD_DATA_TO_OBJECT , JSON_COMMON_GET_POINTER_TO_OBJECT }
 Operation to be carried out with the passed in data. More...
 

Functions

int json_common_modem_static_data_add (cJSON *parent, struct cloud_data_modem_static *data, enum json_common_op_code op, const char *object_label, cJSON **parent_ref)
 Encode and add static modem data to the parent object.
 
int json_common_modem_dynamic_data_add (cJSON *parent, struct cloud_data_modem_dynamic *data, enum json_common_op_code op, const char *object_label, cJSON **parent_ref)
 Encode and add dynamic modem data to the parent object.
 
int json_common_sensor_data_add (cJSON *parent, struct cloud_data_sensors *data, enum json_common_op_code op, const char *object_label, cJSON **parent_ref)
 Encode and add environmental sensor data to the parent object.
 
int json_common_gnss_data_add (cJSON *parent, struct cloud_data_gnss *data, enum json_common_op_code op, const char *object_label, cJSON **parent_ref)
 Encode and add GNSS data to the parent object.
 
int json_common_ui_data_add (cJSON *parent, struct cloud_data_ui *data, enum json_common_op_code op, const char *object_label, cJSON **parent_ref)
 Encode and add User Interface data to the parent object.
 
int json_common_impact_data_add (cJSON *parent, struct cloud_data_impact *data, enum json_common_op_code op, const char *object_label, cJSON **parent_ref)
 Encode and add Impact data to the parent object.
 
int json_common_neighbor_cells_data_add (cJSON *parent, struct cloud_data_neighbor_cells *data, enum json_common_op_code op)
 Encode and add neighbor cell data to the parent object.
 
int json_common_wifi_ap_data_add (cJSON *parent, struct cloud_data_wifi_access_points *data, enum json_common_op_code op)
 Encode and add wifi survey data to the parent object.
 
int json_common_agnss_request_data_add (cJSON *parent, struct cloud_data_agnss_request *data, enum json_common_op_code op)
 Encode and add A-GNSS request data to the parent object.
 
int json_common_pgps_request_data_add (cJSON *parent, struct cloud_data_pgps_request *data)
 Encode and add P-GPS request data to the parent object.
 
int json_common_battery_data_add (cJSON *parent, struct cloud_data_battery *data, enum json_common_op_code op, const char *object_label, cJSON **parent_ref)
 Encode and add battery data to the parent object.
 
int json_common_config_add (cJSON *parent, struct cloud_data_cfg *data, const char *object_label)
 Encode and add configuration data to the parent object.
 
void json_common_config_get (cJSON *parent, struct cloud_data_cfg *data)
 Extract configuration values from parent object.
 
int json_common_batch_data_add (cJSON *parent, enum json_common_buffer_type type, void *buf, size_t buf_count, const char *object_label)
 Encode all queued entries in the passed in buffer and add it to the parent object as an array.
 

Detailed Description

JSON common library header.