Skip to content

Commit

Permalink
chore: make atclient support multiple json providers
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierChanth committed Dec 5, 2024
1 parent 75f81a9 commit c3d25a8
Show file tree
Hide file tree
Showing 7 changed files with 1,445 additions and 1,437 deletions.
1 change: 0 additions & 1 deletion packages/atclient/include/atclient/atnotification.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ void atclient_atnotification_init(atclient_atnotification *notification);
void atclient_atnotification_free(atclient_atnotification *notification);

int atclient_atnotification_from_json_str(atclient_atnotification *notification, const char *json_str);
int atclient_atnotification_from_cjson_node(atclient_atnotification *notification, const cJSON *root);

// Check if a field is initialized
bool atclient_atnotification_is_id_initialized(const atclient_atnotification *notification);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#ifndef ATCLIENT_CJSON_H
#define ATCLIENT_CJSON_H
#ifndef ATCLIENT_JSON_H
#define ATCLIENT_JSON_H
#ifdef __cplusplus
extern "C" {
#endif

#define ATCLIENT_JSON_PROVIDER_CJSON 1
#define ATCLIENT_JSON_PROVIDER ATCLIENT_JSON_PROVIDER_CJSON

#if defined(CONFIG_IDF_TARGET_ESP32)
#include <cjson.h> // IWYU pragma: export
#else
Expand Down
10 changes: 0 additions & 10 deletions packages/atclient/include/atclient/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,6 @@ int atclient_atkey_metadata_clone(atclient_atkey_metadata *dst, const atclient_a
*/
int atclient_atkey_metadata_from_json_str(atclient_atkey_metadata *metadata, const char *metadata_str);

/**
* @brief Populates the metadata struct from a cJSON pointer. This function is good for debugging.
*
* @param metadata the metadata struct to populate
* @param json the json object to populate from
* @return int 0 on success
*/

int atclient_atkey_metadata_from_cjson_node(atclient_atkey_metadata *metadata, const cJSON *json);

/**
* @brief Reads metadata struct and converts it to a json formatted string. This function should mostly be used for
* debugging only. See atclient_atkey_metadata_to_protocolstr for a more useful function when working with atProtocol
Expand Down
Loading

0 comments on commit c3d25a8

Please sign in to comment.