Parse sync response from server
This commit is contained in:
39
esp32_device/main/sync_response.h
Normal file
39
esp32_device/main/sync_response.h
Normal file
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Synchronisation response
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <cJSON.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct sync_response
|
||||
{
|
||||
size_t len;
|
||||
bool relays[];
|
||||
} sync_response;
|
||||
|
||||
/**
|
||||
* Decode synchronize response from server
|
||||
*/
|
||||
sync_response *sync_response_parse(cJSON *res);
|
||||
|
||||
/**
|
||||
* Print synchronize reponse content
|
||||
*/
|
||||
void sync_response_print(sync_response *res);
|
||||
|
||||
/**
|
||||
* Free memory allocated for synchronize response
|
||||
*/
|
||||
void sync_response_free(sync_response *res);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user