add: mongoose for connections and mqtt
This commit is contained in:
parent
f5f9be803c
commit
1d1ae61310
14 changed files with 22620 additions and 233 deletions
include
|
@ -14,4 +14,6 @@
|
|||
void
|
||||
database_setup(MDB_env **mdb_env, config_t *config);
|
||||
|
||||
extern MDB_env *global_mdb_env;
|
||||
|
||||
#endif /* CONTROLLER_DATABASE_H */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef CONTROLLER_HANDLERS_H
|
||||
#define CONTROLLER_HANDLERS_H
|
||||
|
||||
#include <poll.h>
|
||||
#include <mongoose.h>
|
||||
|
||||
#include <models/controller.h>
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
|||
* @param controller Controller to use for answering command
|
||||
*/
|
||||
void
|
||||
handler_command(int fd, controller_t *controller);
|
||||
handler_command(struct mg_connection *c, int ev, void *ev_data);
|
||||
|
||||
/**
|
||||
* @brief Handle the discovery processing
|
||||
|
@ -21,12 +21,12 @@ handler_command(int fd, controller_t *controller);
|
|||
* @param controller Controller to use for answering discovery
|
||||
*/
|
||||
void
|
||||
handler_discovery(int fd, controller_t *controller);
|
||||
handler_discovery(struct mg_connection *c, int ev, void *ev_data);
|
||||
|
||||
void
|
||||
handler_loop(controller_t *this_controller);
|
||||
handler_mqtt(struct mg_connection *c, int ev, void *ev_data);
|
||||
|
||||
void
|
||||
handler_poll(struct pollfd *fds, controller_t *controller, MDB_env *mdb_env);
|
||||
handler_loop(struct mg_connection *c_mqtt);
|
||||
|
||||
#endif /* CONTROLLER_HANDLERS_H */
|
||||
|
|
|
@ -107,4 +107,6 @@ controller_free(controller_t *controller);
|
|||
void
|
||||
controller_debug(controller_t *controller);
|
||||
|
||||
extern controller_t *global_controller;
|
||||
|
||||
#endif //CONTROLLER_CONTROLLER_H
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
typedef struct
|
||||
{
|
||||
uint8_t number;
|
||||
int is_on;
|
||||
char name[MAX_NAME_LENGTH + 1];
|
||||
schedule_t *schedules[7];
|
||||
} relay_t;
|
||||
|
|
6277
include/mongoose.h
Normal file
6277
include/mongoose.h
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue