MythTV
master
|
#include <chrono>
#include <cstdint>
#include <map>
#include <mysql/mysql.h>
#include <sstream>
#include <string>
#include <unistd.h>
#include <vector>
Go to the source code of this file.
Classes | |
struct | SharedData |
struct | SharedData26 |
struct | SharedData32 |
struct | SharedData34 |
struct | TriggerData |
struct | TriggerData26 |
struct | VideoStoreData |
class | MONITOR |
class | ZMServer |
Typedefs | |
using | Clock = std::chrono::system_clock |
using | TimePoint = std::chrono::time_point< Clock > |
using | FrameData = std::array< uint8_t, MAX_IMAGE_SIZE > |
Enumerations | |
enum | State : std::uint8_t { IDLE, PREALARM, ALARM, ALERT, TAPE, IDLE, PREALARM, ALARM, ALERT, TAPE } |
enum | TriggerState : std::uint8_t { TRIGGER_CANCEL, TRIGGER_ON, TRIGGER_OFF } |
Functions | |
bool | checkVersion (int major, int minor, int revision) |
void | loadZMConfig (const std::string &configfile) |
void | connectToDatabase (void) |
void | kickDatabase (bool debug) |
Variables | |
static constexpr size_t | MAX_IMAGE_SIZE { static_cast<size_t>(2048) * 1536 * 3 } |
MYSQL | g_dbConn |
std::string | g_zmversion |
std::string | g_password |
std::string | g_server |
std::string | g_database |
std::string | g_webPath |
std::string | g_user |
std::string | g_webUser |
std::string | g_binPath |
int | g_majorVersion |
int | g_minorVersion |
int | g_revisionVersion |
static constexpr std::chrono::seconds | DB_CHECK_TIME { 60s } |
TimePoint | g_lastDBKick |
const std::string | FUNCTION_MONITOR = "Monitor" |
const std::string | FUNCTION_MODECT = "Modect" |
const std::string | FUNCTION_NODECT = "Nodect" |
const std::string | FUNCTION_RECORD = "Record" |
const std::string | FUNCTION_MOCORD = "Mocord" |
const std::string | FUNCTION_NONE = "None" |
const std::string | RESTART = "restart" |
const std::string | RELOAD = "reload" |
const std::string | RUNNING = "running" |
using Clock = std::chrono::system_clock |
Definition at line 28 of file zmserver.h.
Definition at line 29 of file zmserver.h.
using FrameData = std::array<uint8_t,MAX_IMAGE_SIZE> |
Definition at line 33 of file zmserver.h.
enum State : std::uint8_t |
Enumerator | |
---|---|
IDLE | |
PREALARM | |
ALARM | |
ALERT | |
TAPE | |
IDLE | |
PREALARM | |
ALARM | |
ALERT | |
TAPE |
Definition at line 68 of file zmserver.h.
enum TriggerState : std::uint8_t |
Enumerator | |
---|---|
TRIGGER_CANCEL | |
TRIGGER_ON | |
TRIGGER_OFF |
Definition at line 223 of file zmserver.h.
bool checkVersion | ( | int | major, |
int | minor, | ||
int | revision | ||
) |
Definition at line 102 of file zmserver.cpp.
Referenced by ZMServer::getMonitorList(), ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventFrame(), MONITOR::initMonitor(), MONITOR::isValid(), main(), and ZMServer::ZMServer().
void loadZMConfig | ( | const std::string & | configfile | ) |
Definition at line 109 of file zmserver.cpp.
Referenced by main().
void connectToDatabase | ( | void | ) |
Definition at line 181 of file zmserver.cpp.
Referenced by kickDatabase(), and main().
void kickDatabase | ( | bool | debug | ) |
Definition at line 206 of file zmserver.cpp.
Referenced by ZMServer::handleGetLiveFrame(), and main().
|
staticconstexpr |
Definition at line 32 of file zmserver.h.
MYSQL g_dbConn |
Definition at line 84 of file zmserver.cpp.
Referenced by connectToDatabase(), ZMServer::getMonitorList(), ZMServer::getZMSetting(), ZMServer::handleDeleteEvent(), ZMServer::handleDeleteEventList(), ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventDates(), ZMServer::handleGetEventList(), ZMServer::handleGetFrameList(), ZMServer::handleGetMonitorStatus(), ZMServer::handleSetMonitorFunction(), kickDatabase(), main(), and ZMServer::zmcControl().
std::string g_zmversion |
Definition at line 85 of file zmserver.cpp.
Referenced by loadZMConfig(), and main().
std::string g_password |
Definition at line 86 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
std::string g_server |
Definition at line 87 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
std::string g_database |
Definition at line 88 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
std::string g_webPath |
Definition at line 89 of file zmserver.cpp.
Referenced by ZMServer::handleGetAnalysisFrame(), ZMServer::handleGetEventFrame(), ZMServer::handleGetServerStatus(), and loadZMConfig().
std::string g_user |
Definition at line 90 of file zmserver.cpp.
Referenced by connectToDatabase(), and loadZMConfig().
std::string g_webUser |
Definition at line 91 of file zmserver.cpp.
Referenced by loadZMConfig().
std::string g_binPath |
Definition at line 92 of file zmserver.cpp.
Referenced by ZMServer::getMonitorStatus(), ZMServer::handleDeleteEvent(), ZMServer::handleGetServerStatus(), ZMServer::handleRunZMAudit(), ZMServer::handleSetMonitorFunction(), loadZMConfig(), ZMServer::zmaControl(), and ZMServer::zmcControl().
int g_majorVersion |
Definition at line 95 of file zmserver.cpp.
Referenced by checkVersion(), and main().
int g_minorVersion |
Definition at line 96 of file zmserver.cpp.
Referenced by checkVersion(), and main().
int g_revisionVersion |
Definition at line 97 of file zmserver.cpp.
Referenced by checkVersion(), and main().
|
staticconstexpr |
Definition at line 54 of file zmserver.h.
Referenced by kickDatabase(), and main().
TimePoint g_lastDBKick |
Definition at line 99 of file zmserver.cpp.
Referenced by kickDatabase().
const std::string FUNCTION_MONITOR = "Monitor" |
Definition at line 57 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction().
const std::string FUNCTION_MODECT = "Modect" |
Definition at line 58 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().
const std::string FUNCTION_NODECT = "Nodect" |
Definition at line 59 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().
const std::string FUNCTION_RECORD = "Record" |
Definition at line 60 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().
const std::string FUNCTION_MOCORD = "Mocord" |
Definition at line 61 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().
const std::string FUNCTION_NONE = "None" |
Definition at line 62 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction().
const std::string RESTART = "restart" |
Definition at line 64 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction(), ZMServer::zmaControl(), and ZMServer::zmcControl().
const std::string RELOAD = "reload" |
Definition at line 65 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction(), and ZMServer::zmaControl().
const std::string RUNNING = "running" |
Definition at line 66 of file zmserver.h.
Referenced by ZMServer::handleSetMonitorFunction().