#ifndef CORE_RELAY_H #define CORE_RELAY_H #include #include #include #include #include #include #include typedef struct { int id; char name[MAX_NAME_LENGTH + 1]; int number; int controller_id; int active_schedule_id; schedule_t *active_schedule; schedule_t *schedules[7]; } relay_t; int relay_save(); int relay_remove(); void relay_reload_active_schedule(relay_t *relay); cJSON* relay_to_json(); void relay_free(relay_t *relay); void relay_free_list(relay_t **relays_list); relay_t** relay_get_by_simple(const char *key, const void *value, intptr_t bind_func, int bind_func_param); relay_t* relay_get_by_id(int id); relay_t* relay_get_for_controller(int controller_id, int relay_num); relay_t** relay_get_with_schedule(int schedule_id); relay_t** relay_get_all(); relay_t** relay_get_by_controller_id(int controller_id); #endif /* CORE_RELAY_H */