SimpleOTA client v1.0.0
Shared core of the SimpleOTA Arduino and ESP-IDF clients
Loading...
Searching...
No Matches
sota_json.h
Go to the documentation of this file.
1
17#ifndef SOTA_JSON_H
18#define SOTA_JSON_H
19
20#include <stdbool.h>
21#include <stddef.h>
22#include <stdint.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
35bool sota_json_get_string(const char *json, const char *key, char *out,
36 size_t out_cap);
37
44bool sota_json_escape(const char *src, char *out, size_t out_cap);
45
52bool sota_json_is_object(const char *s);
53
55bool sota_json_has_key(const char *json, const char *key);
56
58bool sota_json_get_bool(const char *json, const char *key, bool *out);
59
61bool sota_json_get_u32(const char *json, const char *key, uint32_t *out);
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /* SOTA_JSON_H */
bool sota_json_get_bool(const char *json, const char *key, bool *out)
Extract true/false.
bool sota_json_is_object(const char *s)
True when s is one JSON object whose brackets pair up and whose strings close, nested at most 8 deep,...
bool sota_json_get_u32(const char *json, const char *key, uint32_t *out)
Extract a non-negative integer (digits only, as the server sends).
bool sota_json_get_string(const char *json, const char *key, char *out, size_t out_cap)
Extract a string value.
bool sota_json_has_key(const char *json, const char *key)
True when the key is present, whatever its value.
bool sota_json_escape(const char *src, char *out, size_t out_cap)
Write src as the inside of a JSON string: " and \ are escaped, newline, carriage return and tab becom...