00001 #ifndef ENGINE_H_
00002 #define ENGINE_H_
00003
00004 #include <openssl/BIO.h>
00005 #include <engine_xmpp.h>
00006 #include <engine_gps.h>
00007
00008
00009 typedef enum {
00010 CMD_STATE_UNKNOWN,
00011 CMD_STATE_OFF,
00012 CMD_STATE_ON,
00013 CMD_STATE_ONE
00014 } cmd_state_t;
00015
00016 typedef enum {
00017 ENGINE_ERROR_NONE,
00018 ENGINE_ERROR_AGAIN,
00019 ENGINE_ERROR_RECONNECT,
00020 ENGINE_ERROR_INVAL,
00021 ENGINE_ERROR_UNKNOWN
00022 } engine_error_t;
00023
00024 typedef struct {
00025 engine_xmpp_t* xmpp;
00026 engine_gps_t* gps;
00027
00028
00029 cmd_state_t cmd_state;
00030 } engine_t;
00031
00035 typedef enum {
00036 ENGINE_GPS,
00037 ENGINE_XMPP
00038 } engine_subsystem_t;
00039
00044 engine_t* engine_new();
00045
00052 void engine_set_logger(engine_t* engine, engine_subsystem_t subsystem, BIO* logger);
00053
00059 void engine_set_xmpp_server(engine_t* engine, char* server);
00060
00067 void engine_set_xmpp_account(engine_t* engine, char* account, char* password);
00068
00074 void engine_set_gps_device(engine_t* engine, char* device);
00075
00080 engine_error_t engine_run(engine_t* engine);
00081
00085 void engine_stop(engine_t* engine);
00086
00087 #endif