central_backend
central_frontend
custom_consumption
docs
esp32_device
.devcontainer
.vscode
docs
main
CMakeLists.txt
constants.h
crypto.c
crypto.h
dev_name.c
dev_name.h
ethernet.c
ethernet.h
http_client.c
http_client.h
jwt.c
jwt.h
main.c
ota.c
ota.h
random.c
random.h
relays.c
relays.h
secure_api.c
secure_api.h
storage.c
storage.h
sync_response.c
sync_response.h
system.c
system.h
unsecure_api.c
unsecure_api.h
.gitignore
CMakeLists.txt
README.md
build_upload_dev.sh
sdkconfig
sdkconfig.old
version.txt
python_device
.drone.yml
LICENSE
Makefile
README.md
renovate.json
46 lines
794 B
C
46 lines
794 B
C
/**
|
|
* 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;
|
|
char *available_update;
|
|
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);
|
|
|
|
/**
|
|
* Check the desired status of a relay
|
|
*/
|
|
bool sync_response_is_relay_on(sync_response *res, int relay_number);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|