12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #ifndef __APP_H__
- #define __APP_H__
- #pragma once
- #include "sp_svc.h"
- #include "sp_iom.h"
- #include "sp_mod.h"
- #include "sp_var.h"
- #include "sp_env.h"
- #include "sp_rpc.h"
- #include "sp_gui.h"
- #include "sp_sps.h"
- #include "sp_bcm.h"
- #include "sp_cfg.h"
- #include <utility>
- #ifndef _WIN32
- #include <functional>
- #endif //NOT _WIN32
- #include "SimpleString.h"
- #ifndef SPSHELL_TAG
- #include <winpr/wlog.h>
- #ifndef RVC_TAG
- #define RVC_TAG(tag) "rvc." tag
- #endif
- #define SPSHELL_TAG(tag) RVC_TAG("spshell.") tag
- #endif //SPSHELL_TAG
- #define NO_GUI_WITH_WTL 0
- #define EXIT_FROM_GUARDIAN 1
- #define EXIT_FROM_KILL 2
- #define EXIT_FROM_REBOOT_CMD 3
- typedef struct app_t app_t;
- typedef struct log_t log_t;
- typedef class CSpShellConsole CSpShellConsole;
- struct app_t {
- bus_daemon_t *bus_daemon;
- sp_svc_t *svc;
- sp_iom_t *iom;
- sp_var_client_t* var_client;
- sp_var_daemon_t *var_daemon;
- sp_bcm_daemon_t *bcm_daemon;
- log_t *log;
- #if defined(_MSC_VER)
- sp_gui_t* bsc_gui;
- #else
- sp_gui_format_t* bsc_gui;
- #endif //_MSC_VER
- sp_rpc_server_t *rpc_server;
- sp_sps_t *sps;
- CSpShellConsole *pConsole;
- };
- app_t *get_app_instance();
- #if defined(_MSC_VER)
- std::pair<int, CSimpleStringA> app_init(const sp_cfg_start_args_t* args);
- #else
- int app_init(const sp_cfg_start_args_t* args, std::function<void(const char* msg, bool)> const& popup);
- #endif //_MSC_VER
- int app_term();
- int app_run();
- void app_stop(int from_id);
- /** 暂时不适用,由实体去控制,否则会出现因配置SYSEVENT未拉下来导致值不统一的问题 [Gifur@2025314]*/
- int app_update_terminal_state(int state);
- void app_clear();
- void app_upload_last_log();
- #endif //__APP_H__
|