nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
json_helpers.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#include "cJSON.h"
8
21void json_add_obj(cJSON *parent, const char *str, cJSON *item);
22
34void json_add_obj_array(cJSON *parent, cJSON *item);
35
47int json_add_number_to_array(cJSON *parent, double number);
48
49int json_add_number(cJSON *parent, const char *str, double item);
50
51int json_add_bool(cJSON *parent, const char *str, int item);
52
53cJSON *json_object_decode(cJSON *obj, const char *str);
54
55int json_add_str(cJSON *parent, const char *str, const char *item);
56
57void json_print_obj(const char *prefix, const cJSON *obj);
cJSON * json_object_decode(cJSON *obj, const char *str)
void json_add_obj(cJSON *parent, const char *str, cJSON *item)
Associate a child object with a parent.
int json_add_number_to_array(cJSON *parent, double number)
Add number to array object.
void json_print_obj(const char *prefix, const cJSON *obj)
int json_add_number(cJSON *parent, const char *str, double item)
int json_add_bool(cJSON *parent, const char *str, int item)
void json_add_obj_array(cJSON *parent, cJSON *item)
Add item to array object.
int json_add_str(cJSON *parent, const char *str, const char *item)