#ifndef CONTROLLER_CONTROLLER_H #define CONTROLLER_CONTROLLER_H #include #include #include #include #include typedef struct controller { uuid_t uuid; char name[CONTROLLER_NAME_LENGTH + 1]; uint16_t port; uint8_t relay_count; relay **relays; } controller; typedef enum controller_db_key { KEY_META_UUID, KEY_META_NAME, KEY_META_PORT, KEY_META_RELAY_COUNT, KEY_META_RELAYS } controller_db_key; controller* controller_create(void); controller* controller_read(MDB_env *mdb_env); int controller_save(controller *cntrlr, MDB_env *mdb_env); void controller_debug(controller *cntrlr); #endif //CONTROLLER_CONTROLLER_H