MythTV  master
zmserver.h
Go to the documentation of this file.
1 /* Definition of the ZMServer class.
2  * ============================================================
3  * This program is free software; you can redistribute it
4  * and/or modify it under the terms of the GNU General
5  * Public License as published bythe Free Software Foundation;
6  * either version 2, or (at your option)
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * ============================================================ */
15 
16 #ifndef ZMSERVER_H
17 #define ZMSERVER_H
18 
19 #include <cstdint>
20 #include <map>
21 #include <mysql/mysql.h>
22 #include <sstream>
23 #include <string>
24 #include <unistd.h>
25 #include <vector>
26 
27 // the maximum image size we are ever likely to get from ZM
28 #define MAX_IMAGE_SIZE (2048*1536*3)
29 using FrameData = std::array<uint8_t,MAX_IMAGE_SIZE>;
30 
31 extern bool checkVersion(int major, int minor, int revision);
32 extern void loadZMConfig(const std::string &configfile);
33 extern void connectToDatabase(void);
34 extern void kickDatabase(bool debug);
35 
36 // these are shared by all ZMServer's
37 extern MYSQL g_dbConn;
38 extern std::string g_zmversion;
39 extern std::string g_password;
40 extern std::string g_server;
41 extern std::string g_database;
42 extern std::string g_webPath;
43 extern std::string g_user;
44 extern std::string g_webUser;
45 extern std::string g_binPath;
46 extern int g_majorVersion;
47 extern int g_minorVersion;
48 extern int g_revisionVersion;
49 
50 #define DB_CHECK_TIME 60
51 extern time_t g_lastDBKick;
52 
53 const std::string FUNCTION_MONITOR = "Monitor";
54 const std::string FUNCTION_MODECT = "Modect";
55 const std::string FUNCTION_NODECT = "Nodect";
56 const std::string FUNCTION_RECORD = "Record";
57 const std::string FUNCTION_MOCORD = "Mocord";
58 const std::string FUNCTION_NONE = "None";
59 
60 const std::string RESTART = "restart";
61 const std::string RELOAD = "reload";
62 const std::string RUNNING = "running";
63 
64 enum State
65 {
71 };
72 
73 // Prevent clang-tidy modernize-avoid-c-arrays warnings in these
74 // library structures
75 extern "C" {
76 
77 // shared data for ZM version 1.24.x and 1.25.x
78 struct SharedData
79 {
80  int size;
81  bool valid;
82  bool active;
83  bool signal;
90  int action;
92  int hue;
93  int colour;
94  int contrast;
95  int alarm_x;
96  int alarm_y;
97  char control_state[256];
98 };
99 
100 // shared data for ZM version 1.26.x
102 {
103  uint32_t size;
105  uint32_t last_read_index;
106  uint32_t state;
107  uint32_t last_event;
108  uint32_t action;
109  int32_t brightness;
110  int32_t hue;
111  int32_t colour;
112  int32_t contrast;
113  int32_t alarm_x;
114  int32_t alarm_y;
115  uint8_t valid;
116  uint8_t active;
117  uint8_t signal;
118  uint8_t format;
119  uint32_t imagesize;
120  uint32_t epadding1;
121  uint32_t epadding2;
122  union {
124  uint64_t extrapad1;
125  };
126  union {
128  uint64_t extrapad2;
129  };
130  uint8_t control_state[256];
131 };
132 
133 // shared data for ZM version 1.32.x
135 {
136  uint32_t size;
138  uint32_t last_read_index;
139  uint32_t state;
140  uint64_t last_event;
141  uint32_t action;
142  int32_t brightness;
143  int32_t hue;
144  int32_t colour;
145  int32_t contrast;
146  int32_t alarm_x;
147  int32_t alarm_y;
148  uint8_t valid;
149  uint8_t active;
150  uint8_t signal;
151  uint8_t format;
152  uint32_t imagesize;
153  uint32_t epadding1;
154  union {
155  time_t startup_time;
156  uint64_t extrapad1;
157  };
158  union {
160  uint64_t extrapad2;
161  };
162  union {
164  uint64_t extrapad3;
165  };
166  uint8_t control_state[256];
167 
168  char alarm_cause[256];
169 };
170 
171 // shared data for ZM version 1.34.x
173 {
174  uint32_t size;
176  uint32_t last_read_index;
177  uint32_t state;
178  uint64_t last_event;
179  uint32_t action;
180  int32_t brightness;
181  int32_t hue;
182  int32_t colour;
183  int32_t contrast;
184  int32_t alarm_x;
185  int32_t alarm_y;
186  uint8_t valid;
187  uint8_t active;
188  uint8_t signal;
189  uint8_t format;
190  uint32_t imagesize;
191  uint32_t epadding1;
192  union {
193  time_t startup_time;
194  uint64_t extrapad1;
195  };
196  union { /* +72 */
197  time_t zmc_heartbeat_time; /* Constantly updated by zmc. Used to determine if the process is alive or hung or dead */
198  uint64_t extrapad2;
199  };
200  union { /* +80 */
201  time_t zma_heartbeat_time; /* Constantly updated by zma. Used to determine if the process is alive or hung or dead */
202  uint64_t extrapad3;
203  };
204  union {
206  uint64_t extrapad4;
207  };
208  union {
210  uint64_t extrapad5;
211  };
212  uint8_t control_state[256];
213 
214  char alarm_cause[256];
215 };
216 
217 
218 
220 
221 // Triggerdata for ZM version 1.24.x and 1.25.x
223 {
224  int size;
227  char trigger_cause[32];
228  char trigger_text[256];
229  char trigger_showtext[256];
230 };
231 
232 // Triggerdata for ZM version 1.26.x , 1.32.x and 1.34.x
234 {
235  uint32_t size;
236  uint32_t trigger_state;
237  uint32_t trigger_score;
238  uint32_t padding;
239  char trigger_cause[32];
240  char trigger_text[256];
241  char trigger_showtext[256];
242 };
243 
244 // VideoStoreData for ZM version 1.32.x and 1.34.x
246 {
247  uint32_t size;
248  uint64_t current_event;
249  char event_file[4096];
250  timeval recording;
251 };
252 
253 // end of library structures.
254 };
255 
256 class MONITOR
257 {
258  public:
259  MONITOR() = default;
260 
261  void initMonitor(bool debug, const std::string &mmapPath, int shmKey);
262 
263  bool isValid(void);
264 
265  std::string getIdStr(void);
266  int getLastWriteIndex(void);
267  int getSubpixelOrder(void);
268  int getState(void);
269  int getFrameSize(void);
270 
271  std::string m_name {};
272  std::string m_type {};
273  std::string m_function {};
274  int m_enabled {0};
275  std::string m_device {};
276  std::string m_host {};
278  int m_width {0};
279  int m_height {0};
281  int m_monId {0};
282  unsigned char *m_sharedImages {nullptr};
283  int m_lastRead {0};
284  std::string m_status {};
285  int m_palette {0};
286  int m_controllable {0};
287  int m_trackMotion {0};
288  int m_mapFile {-1};
289  void *m_shmPtr {nullptr};
290  private:
295  std::string m_id {};
296 };
297 
298 class ZMServer
299 {
300  public:
301  ZMServer(int sock, bool debug);
302  ~ZMServer();
303 
304  bool processRequest(char* buf, int nbytes);
305 
306  private:
307  std::string getZMSetting(const std::string &setting) const;
308  bool send(const std::string &s) const;
309  bool send(const std::string &s, const unsigned char *buffer, int dataLen) const;
310  void sendError(const std::string &error);
311  void getMonitorList(void);
312  static int getFrame(FrameData &buffer, MONITOR *monitor);
313  static long long getDiskSpace(const std::string &filename, long long &total, long long &used);
314  static void tokenize(const std::string &command, std::vector<std::string> &tokens);
315  void handleHello(void);
316  static std::string runCommand(const std::string& command);
317  static void getMonitorStatus(const std::string &id, const std::string &type,
318  const std::string &device, const std::string &host,
319  const std::string &channel, const std::string &function,
320  std::string &zmcStatus, std::string &zmaStatus,
321  const std::string &enabled);
322  void handleGetServerStatus(void);
323  void handleGetMonitorStatus(void);
324  void handleGetAlarmStates(void);
325  void handleGetMonitorList(void);
326  void handleGetCameraList(void);
327  void handleGetEventList(std::vector<std::string> tokens);
328  void handleGetEventFrame(std::vector<std::string> tokens);
329  void handleGetAnalysisFrame(std::vector<std::string> tokens);
330  void handleGetLiveFrame(std::vector<std::string> tokens);
331  void handleGetFrameList(std::vector<std::string> tokens);
332  void handleDeleteEvent(std::vector<std::string> tokens);
333  void handleDeleteEventList(std::vector<std::string> tokens);
334  void handleGetEventDates(std::vector<std::string> tokens);
335  void handleRunZMAudit(void);
336  void handleSetMonitorFunction(std::vector<std::string> tokens);
337  void zmcControl(MONITOR *monitor, const std::string &mode);
338  void zmaControl(MONITOR *monitor, const std::string &mode);
339 
340  bool m_debug {false};
341  int m_sock {-1};
342  std::vector<MONITOR *> m_monitors;
343  std::map<int, MONITOR *> m_monitorMap;
344  bool m_useDeepStorage {false};
345  bool m_useAnalysisImages {false};
346  std::string m_eventFileFormat;
347  std::string m_analysisFileFormat;
348  key_t m_shmKey;
349  std::string m_mmapPath;
350 };
351 
352 
353 #endif
SharedData34::format
uint8_t format
Definition: zmserver.h:189
connectToDatabase
void connectToDatabase(void)
Definition: zmserver.cpp:176
ZMServer::m_shmKey
key_t m_shmKey
Definition: zmserver.h:348
SharedData26::imagesize
uint32_t imagesize
Definition: zmserver.h:119
SharedData34::state
uint32_t state
Definition: zmserver.h:177
SharedData32::last_read_time
time_t last_read_time
Definition: zmserver.h:163
ZMServer::handleHello
void handleHello(void)
Definition: zmserver.cpp:730
TRIGGER_ON
@ TRIGGER_ON
Definition: zmserver.h:219
SharedData26::format
uint8_t format
Definition: zmserver.h:118
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:501
SharedData34::last_read_index
uint32_t last_read_index
Definition: zmserver.h:176
SharedData32::last_event
uint64_t last_event
Definition: zmserver.h:140
SharedData32::extrapad1
uint64_t extrapad1
Definition: zmserver.h:156
SharedData32::active
uint8_t active
Definition: zmserver.h:149
TRIGGER_CANCEL
@ TRIGGER_CANCEL
Definition: zmserver.h:219
ZMServer::handleRunZMAudit
void handleRunZMAudit(void)
Definition: zmserver.cpp:1688
ZMServer::m_useAnalysisImages
bool m_useAnalysisImages
Definition: zmserver.h:345
SharedData::alarm_y
int alarm_y
Definition: zmserver.h:96
SharedData26::contrast
int32_t contrast
Definition: zmserver.h:112
SharedData::signal
bool signal
Definition: zmserver.h:83
error
static void error(const char *str,...)
Definition: vbi.cpp:42
SharedData32::alarm_x
int32_t alarm_x
Definition: zmserver.h:146
SharedData26::alarm_y
int32_t alarm_y
Definition: zmserver.h:114
IDLE
@ IDLE
Definition: zmserver.h:66
SharedData34::signal
uint8_t signal
Definition: zmserver.h:188
SharedData26::valid
uint8_t valid
Definition: zmserver.h:115
MONITOR::isValid
bool isValid(void)
Definition: zmserver.cpp:409
RELOAD
const std::string RELOAD
Definition: zmserver.h:61
ZMServer::m_analysisFileFormat
std::string m_analysisFileFormat
Definition: zmserver.h:347
SharedData32::epadding1
uint32_t epadding1
Definition: zmserver.h:153
SharedData26::action
uint32_t action
Definition: zmserver.h:108
VideoStoreData::current_event
uint64_t current_event
Definition: zmserver.h:248
SharedData34::zma_heartbeat_time
time_t zma_heartbeat_time
Definition: zmserver.h:201
MONITOR::m_id
std::string m_id
Definition: zmserver.h:295
SharedData26::last_read_time
time_t last_read_time
Definition: zmserver.h:127
MONITOR::m_sharedData34
SharedData34 * m_sharedData34
Definition: zmserver.h:294
ZMServer::handleGetAnalysisFrame
void handleGetAnalysisFrame(std::vector< std::string > tokens)
Definition: zmserver.cpp:1219
MONITOR::m_sharedData32
SharedData32 * m_sharedData32
Definition: zmserver.h:293
TAPE
@ TAPE
Definition: zmserver.h:70
ZMServer::handleGetServerStatus
void handleGetServerStatus(void)
Definition: zmserver.cpp:769
SharedData::state
State state
Definition: zmserver.h:84
FUNCTION_NONE
const std::string FUNCTION_NONE
Definition: zmserver.h:58
MONITOR::m_trackMotion
int m_trackMotion
Definition: zmserver.h:287
FUNCTION_MODECT
const std::string FUNCTION_MODECT
Definition: zmserver.h:54
VideoStoreData::recording
timeval recording
Definition: zmserver.h:250
SharedData26::last_write_index
uint32_t last_write_index
Definition: zmserver.h:104
SharedData26::last_event
uint32_t last_event
Definition: zmserver.h:107
MONITOR::m_lastRead
int m_lastRead
Definition: zmserver.h:283
g_webUser
std::string g_webUser
Definition: zmserver.cpp:86
TriggerData26::trigger_score
uint32_t trigger_score
Definition: zmserver.h:237
ZMServer::getFrame
static int getFrame(FrameData &buffer, MONITOR *monitor)
Definition: zmserver.cpp:1778
SharedData34::hue
int32_t hue
Definition: zmserver.h:181
PREALARM
@ PREALARM
Definition: zmserver.h:67
SharedData32::last_write_time
time_t last_write_time
Definition: zmserver.h:159
MONITOR::m_width
int m_width
Definition: zmserver.h:278
SharedData32::control_state
uint8_t control_state[256]
Definition: zmserver.h:166
SharedData34::extrapad2
uint64_t extrapad2
Definition: zmserver.h:198
MONITOR::m_sharedData26
SharedData26 * m_sharedData26
Definition: zmserver.h:292
SharedData::last_event
int last_event
Definition: zmserver.h:89
g_database
std::string g_database
Definition: zmserver.cpp:83
FUNCTION_MONITOR
const std::string FUNCTION_MONITOR
Definition: zmserver.h:53
ZMServer::zmcControl
void zmcControl(MONITOR *monitor, const std::string &mode)
Definition: zmserver.cpp:2045
SharedData32::startup_time
time_t startup_time
Definition: zmserver.h:155
ZMServer::zmaControl
void zmaControl(MONITOR *monitor, const std::string &mode)
Definition: zmserver.cpp:2090
MONITOR::initMonitor
void initMonitor(bool debug, const std::string &mmapPath, int shmKey)
Definition: zmserver.cpp:228
ZMServer::handleGetAlarmStates
void handleGetAlarmStates(void)
Definition: zmserver.cpp:803
ZMServer
Definition: zmserver.h:298
SharedData32::valid
uint8_t valid
Definition: zmserver.h:148
ZMServer::getZMSetting
std::string getZMSetting(const std::string &setting) const
Definition: zmserver.cpp:1910
MONITOR::getState
int getState(void)
Definition: zmserver.cpp:453
TriggerData::size
int size
Definition: zmserver.h:224
SharedData34::last_read_time
time_t last_read_time
Definition: zmserver.h:209
ZMServer::runCommand
static std::string runCommand(const std::string &command)
Definition: zmserver.cpp:1071
g_server
std::string g_server
Definition: zmserver.cpp:82
SharedData34::extrapad3
uint64_t extrapad3
Definition: zmserver.h:202
SharedData::last_read_index
int last_read_index
Definition: zmserver.h:86
VideoStoreData::size
uint32_t size
Definition: zmserver.h:247
SharedData32::hue
int32_t hue
Definition: zmserver.h:143
MONITOR::m_imageBufferCount
int m_imageBufferCount
Definition: zmserver.h:277
SharedData32::signal
uint8_t signal
Definition: zmserver.h:150
SharedData26::active
uint8_t active
Definition: zmserver.h:116
RUNNING
const std::string RUNNING
Definition: zmserver.h:62
MONITOR::m_function
std::string m_function
Definition: zmserver.h:273
SharedData::contrast
int contrast
Definition: zmserver.h:94
ZMServer::handleGetCameraList
void handleGetCameraList(void)
Definition: zmserver.cpp:1565
SharedData26::extrapad2
uint64_t extrapad2
Definition: zmserver.h:128
ZMServer::getMonitorList
void getMonitorList(void)
Definition: zmserver.cpp:1706
minor
#define minor(X)
Definition: compat.h:139
ZMServer::getDiskSpace
static long long getDiskSpace(const std::string &filename, long long &total, long long &used)
Definition: zmserver.cpp:740
ZMServer::handleGetEventList
void handleGetEventList(std::vector< std::string > tokens)
Definition: zmserver.cpp:823
SharedData
Definition: zmserver.h:78
SharedData34::extrapad5
uint64_t extrapad5
Definition: zmserver.h:210
SharedData32::last_read_index
uint32_t last_read_index
Definition: zmserver.h:138
loadZMConfig
void loadZMConfig(const std::string &configfile)
Definition: zmserver.cpp:104
g_minorVersion
int g_minorVersion
Definition: zmserver.cpp:91
SharedData::brightness
int brightness
Definition: zmserver.h:91
MONITOR::m_enabled
int m_enabled
Definition: zmserver.h:274
TriggerData::trigger_text
char trigger_text[256]
Definition: zmserver.h:228
SharedData26::colour
int32_t colour
Definition: zmserver.h:111
TriggerData::trigger_score
int trigger_score
Definition: zmserver.h:226
SharedData::control_state
char control_state[256]
Definition: zmserver.h:97
MONITOR::getIdStr
std::string getIdStr(void)
Definition: zmserver.cpp:425
g_lastDBKick
time_t g_lastDBKick
Definition: zmserver.cpp:94
SharedData34::epadding1
uint32_t epadding1
Definition: zmserver.h:191
SharedData34::imagesize
uint32_t imagesize
Definition: zmserver.h:190
SharedData26::epadding1
uint32_t epadding1
Definition: zmserver.h:120
FUNCTION_RECORD
const std::string FUNCTION_RECORD
Definition: zmserver.h:56
debug
VERBOSE_PREAMBLE Most debug(nodatabase, notimestamp, noextra)") VERBOSE_MAP(VB_GENERAL
State
State
Definition: zmserver.h:64
SharedData34::zmc_heartbeat_time
time_t zmc_heartbeat_time
Definition: zmserver.h:197
MONITOR::m_status
std::string m_status
Definition: zmserver.h:284
SharedData32::extrapad3
uint64_t extrapad3
Definition: zmserver.h:164
ZMServer::handleDeleteEvent
void handleDeleteEvent(std::vector< std::string > tokens)
Definition: zmserver.cpp:1616
ZMServer::m_sock
int m_sock
Definition: zmserver.h:341
ZMServer::handleGetFrameList
void handleGetFrameList(std::vector< std::string > tokens)
Definition: zmserver.cpp:1457
SharedData::size
int size
Definition: zmserver.h:80
ZMServer::m_eventFileFormat
std::string m_eventFileFormat
Definition: zmserver.h:346
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
VideoStoreData::event_file
char event_file[4096]
Definition: zmserver.h:249
RESTART
const std::string RESTART
Definition: zmserver.h:60
SharedData::valid
bool valid
Definition: zmserver.h:81
ALERT
@ ALERT
Definition: zmserver.h:69
FUNCTION_NODECT
const std::string FUNCTION_NODECT
Definition: zmserver.h:55
VideoStoreData
Definition: zmserver.h:245
TRIGGER_OFF
@ TRIGGER_OFF
Definition: zmserver.h:219
SharedData26::alarm_x
int32_t alarm_x
Definition: zmserver.h:113
SharedData32::alarm_cause
char alarm_cause[256]
Definition: zmserver.h:168
SharedData34::alarm_y
int32_t alarm_y
Definition: zmserver.h:185
SharedData34::contrast
int32_t contrast
Definition: zmserver.h:183
MONITOR::m_monId
int m_monId
Definition: zmserver.h:281
SharedData26::extrapad1
uint64_t extrapad1
Definition: zmserver.h:124
g_revisionVersion
int g_revisionVersion
Definition: zmserver.cpp:92
SharedData::action
int action
Definition: zmserver.h:90
SharedData34::active
uint8_t active
Definition: zmserver.h:187
SharedData32::action
uint32_t action
Definition: zmserver.h:141
SharedData26::epadding2
uint32_t epadding2
Definition: zmserver.h:121
g_user
std::string g_user
Definition: zmserver.cpp:85
MONITOR::m_sharedImages
unsigned char * m_sharedImages
Definition: zmserver.h:282
g_binPath
std::string g_binPath
Definition: zmserver.cpp:87
checkVersion
bool checkVersion(int major, int minor, int revision)
Definition: zmserver.cpp:97
SharedData34::control_state
uint8_t control_state[256]
Definition: zmserver.h:212
g_dbConn
MYSQL g_dbConn
Definition: zmserver.cpp:79
MONITOR::m_device
std::string m_device
Definition: zmserver.h:275
ZMServer::handleGetMonitorList
void handleGetMonitorList(void)
Definition: zmserver.cpp:1581
SharedData26::hue
int32_t hue
Definition: zmserver.h:110
SharedData26::last_read_index
uint32_t last_read_index
Definition: zmserver.h:105
TriggerData
Definition: zmserver.h:222
SharedData32::colour
int32_t colour
Definition: zmserver.h:144
ZMServer::handleDeleteEventList
void handleDeleteEventList(std::vector< std::string > tokens)
Definition: zmserver.cpp:1653
TriggerData26::trigger_cause
char trigger_cause[32]
Definition: zmserver.h:239
g_webPath
std::string g_webPath
Definition: zmserver.cpp:84
MONITOR::MONITOR
MONITOR()=default
SharedData::hue
int hue
Definition: zmserver.h:92
TriggerData26::size
uint32_t size
Definition: zmserver.h:235
ZMServer::sendError
void sendError(const std::string &error)
Definition: zmserver.cpp:723
ZMServer::handleGetMonitorStatus
void handleGetMonitorStatus(void)
Definition: zmserver.cpp:978
SharedData34::extrapad1
uint64_t extrapad1
Definition: zmserver.h:194
FUNCTION_MOCORD
const std::string FUNCTION_MOCORD
Definition: zmserver.h:57
MONITOR::getSubpixelOrder
int getSubpixelOrder(void)
Definition: zmserver.cpp:470
ZMServer::m_useDeepStorage
bool m_useDeepStorage
Definition: zmserver.h:344
g_zmversion
std::string g_zmversion
Definition: zmserver.cpp:80
TriggerData::trigger_showtext
char trigger_showtext[256]
Definition: zmserver.h:229
SharedData32::contrast
int32_t contrast
Definition: zmserver.h:145
SharedData32::format
uint8_t format
Definition: zmserver.h:151
SharedData34::last_write_time
time_t last_write_time
Definition: zmserver.h:205
TriggerData26::trigger_state
uint32_t trigger_state
Definition: zmserver.h:236
MONITOR::m_shmPtr
void * m_shmPtr
Definition: zmserver.h:289
ZMServer::getMonitorStatus
static void getMonitorStatus(const std::string &id, const std::string &type, const std::string &device, const std::string &host, const std::string &channel, const std::string &function, std::string &zmcStatus, std::string &zmaStatus, const std::string &enabled)
Definition: zmserver.cpp:1085
SharedData34::action
uint32_t action
Definition: zmserver.h:179
ZMServer::m_monitorMap
std::map< int, MONITOR * > m_monitorMap
Definition: zmserver.h:343
SharedData26::signal
uint8_t signal
Definition: zmserver.h:117
SharedData26::last_write_time
time_t last_write_time
Definition: zmserver.h:123
MONITOR::getFrameSize
int getFrameSize(void)
Definition: zmserver.cpp:491
TriggerData26::trigger_text
char trigger_text[256]
Definition: zmserver.h:240
TriggerState
TriggerState
Definition: zmserver.h:219
MONITOR::m_bytesPerPixel
int m_bytesPerPixel
Definition: zmserver.h:280
SharedData34::size
uint32_t size
Definition: zmserver.h:174
SharedData::colour
int colour
Definition: zmserver.h:93
SharedData::last_write_time
time_t last_write_time
Definition: zmserver.h:87
ZMServer::tokenize
static void tokenize(const std::string &command, std::vector< std::string > &tokens)
Definition: zmserver.cpp:606
SharedData34::brightness
int32_t brightness
Definition: zmserver.h:180
SharedData34::alarm_cause
char alarm_cause[256]
Definition: zmserver.h:214
TriggerData::trigger_state
TriggerState trigger_state
Definition: zmserver.h:225
TriggerData26
Definition: zmserver.h:233
SharedData34::extrapad4
uint64_t extrapad4
Definition: zmserver.h:206
SharedData32
Definition: zmserver.h:134
MONITOR
Definition: zmserver.h:256
MONITOR::m_height
int m_height
Definition: zmserver.h:279
ALARM
@ ALARM
Definition: zmserver.h:68
MONITOR::m_palette
int m_palette
Definition: zmserver.h:285
SharedData34
Definition: zmserver.h:172
SharedData26::control_state
uint8_t control_state[256]
Definition: zmserver.h:130
g_password
std::string g_password
Definition: zmserver.cpp:81
SharedData32::brightness
int32_t brightness
Definition: zmserver.h:142
MONITOR::m_controllable
int m_controllable
Definition: zmserver.h:286
SharedData32::alarm_y
int32_t alarm_y
Definition: zmserver.h:147
ZMServer::handleSetMonitorFunction
void handleSetMonitorFunction(std::vector< std::string > tokens)
Definition: zmserver.cpp:1942
MONITOR::m_sharedData
SharedData * m_sharedData
Definition: zmserver.h:291
ZMServer::m_mmapPath
std::string m_mmapPath
Definition: zmserver.h:349
FrameData
std::array< uint8_t, MAX_IMAGE_SIZE > FrameData
Definition: zmserver.h:29
ZMServer::send
bool send(const std::string &s) const
Definition: zmserver.cpp:690
SharedData26::size
uint32_t size
Definition: zmserver.h:103
MONITOR::getLastWriteIndex
int getLastWriteIndex(void)
Definition: zmserver.cpp:436
SharedData34::alarm_x
int32_t alarm_x
Definition: zmserver.h:184
MONITOR::m_type
std::string m_type
Definition: zmserver.h:272
ZMServer::ZMServer
ZMServer(int sock, bool debug)
Definition: zmserver.cpp:510
ZMServer::m_monitors
std::vector< MONITOR * > m_monitors
Definition: zmserver.h:342
SharedData::last_read_time
time_t last_read_time
Definition: zmserver.h:88
SharedData34::last_write_index
uint32_t last_write_index
Definition: zmserver.h:175
SharedData32::last_write_index
uint32_t last_write_index
Definition: zmserver.h:137
TriggerData26::trigger_showtext
char trigger_showtext[256]
Definition: zmserver.h:241
TriggerData::trigger_cause
char trigger_cause[32]
Definition: zmserver.h:227
SharedData::active
bool active
Definition: zmserver.h:82
SharedData26
Definition: zmserver.h:101
MONITOR::m_host
std::string m_host
Definition: zmserver.h:276
TriggerData26::padding
uint32_t padding
Definition: zmserver.h:238
SharedData32::state
uint32_t state
Definition: zmserver.h:139
SharedData::last_write_index
int last_write_index
Definition: zmserver.h:85
ZMServer::~ZMServer
~ZMServer()
Definition: zmserver.cpp:583
ZMServer::processRequest
bool processRequest(char *buf, int nbytes)
Definition: zmserver.cpp:629
MONITOR::m_mapFile
int m_mapFile
Definition: zmserver.h:288
SharedData32::extrapad2
uint64_t extrapad2
Definition: zmserver.h:160
SharedData26::state
uint32_t state
Definition: zmserver.h:106
ZMServer::handleGetLiveFrame
void handleGetLiveFrame(std::vector< std::string > tokens)
Definition: zmserver.cpp:1389
g_majorVersion
int g_majorVersion
Definition: zmserver.cpp:90
MONITOR::m_name
std::string m_name
Definition: zmserver.h:271
SharedData34::valid
uint8_t valid
Definition: zmserver.h:186
SharedData26::brightness
int32_t brightness
Definition: zmserver.h:109
ZMServer::handleGetEventFrame
void handleGetEventFrame(std::vector< std::string > tokens)
Definition: zmserver.cpp:1136
ZMServer::m_debug
bool m_debug
Definition: zmserver.h:340
kickDatabase
void kickDatabase(bool debug)
Definition: zmserver.cpp:201
SharedData34::colour
int32_t colour
Definition: zmserver.h:182
SharedData34::startup_time
time_t startup_time
Definition: zmserver.h:193
SharedData::alarm_x
int alarm_x
Definition: zmserver.h:95
SharedData34::last_event
uint64_t last_event
Definition: zmserver.h:178
ZMServer::handleGetEventDates
void handleGetEventDates(std::vector< std::string > tokens)
Definition: zmserver.cpp:914
SharedData32::imagesize
uint32_t imagesize
Definition: zmserver.h:152
SharedData32::size
uint32_t size
Definition: zmserver.h:136