MythTV  master
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ZMServer Class Reference

#include <zmserver.h>

Collaboration diagram for ZMServer:
Collaboration graph
[legend]

Public Member Functions

 ZMServer (int sock, bool debug)
 
 ~ZMServer ()
 
bool processRequest (char *buf, int nbytes)
 

Private Member Functions

string getZMSetting (const string &setting) const
 
bool send (const string &s) const
 
bool send (const string &s, const unsigned char *buffer, int dataLen) const
 
void sendError (const string &error)
 
void getMonitorList (void)
 
void handleHello (void)
 
void handleGetServerStatus (void)
 
void handleGetMonitorStatus (void)
 
void handleGetAlarmStates (void)
 
void handleGetMonitorList (void)
 
void handleGetCameraList (void)
 
void handleGetEventList (vector< string > tokens)
 
void handleGetEventFrame (vector< string > tokens)
 
void handleGetAnalysisFrame (vector< string > tokens)
 
void handleGetLiveFrame (vector< string > tokens)
 
void handleGetFrameList (vector< string > tokens)
 
void handleDeleteEvent (vector< string > tokens)
 
void handleDeleteEventList (vector< string > tokens)
 
void handleGetEventDates (vector< string > tokens)
 
void handleRunZMAudit (void)
 
void handleSetMonitorFunction (vector< string > tokens)
 
void zmcControl (MONITOR *monitor, const string &mode)
 
void zmaControl (MONITOR *monitor, const string &mode)
 

Static Private Member Functions

static int getFrame (unsigned char *buffer, int bufferSize, MONITOR *monitor)
 
static long long getDiskSpace (const string &filename, long long &total, long long &used)
 
static void tokenize (const string &command, vector< string > &tokens)
 
static string runCommand (const string &command)
 
static void getMonitorStatus (const string &id, const string &type, const string &device, const string &host, const string &channel, const string &function, string &zmcStatus, string &zmaStatus, const string &enabled)
 

Private Attributes

bool m_debug {false}
 
int m_sock {-1}
 
vector< MONITOR * > m_monitors
 
map< int, MONITOR * > m_monitorMap
 
bool m_useDeepStorage {false}
 
bool m_useAnalysisImages {false}
 
string m_eventFileFormat
 
string m_analysisFileFormat
 
key_t m_shmKey
 
string m_mmapPath
 
char m_buf [10] {0}
 

Detailed Description

Definition at line 240 of file zmserver.h.

Constructor & Destructor Documentation

◆ ZMServer()

ZMServer::ZMServer ( int  sock,
bool  debug 
)

Definition at line 478 of file zmserver.cpp.

◆ ~ZMServer()

ZMServer::~ZMServer ( )

Definition at line 552 of file zmserver.cpp.

Member Function Documentation

◆ processRequest()

bool ZMServer::processRequest ( char *  buf,
int  nbytes 
)

Definition at line 598 of file zmserver.cpp.

Referenced by main().

◆ getZMSetting()

string ZMServer::getZMSetting ( const string &  setting) const
private

Definition at line 1878 of file zmserver.cpp.

Referenced by zmaControl(), and ZMServer().

◆ send() [1/2]

bool ZMServer::send ( const string &  s) const
private

◆ send() [2/2]

bool ZMServer::send ( const string &  s,
const unsigned char *  buffer,
int  dataLen 
) const
private

Definition at line 674 of file zmserver.cpp.

◆ sendError()

void ZMServer::sendError ( const string &  error)
private

◆ getMonitorList()

void ZMServer::getMonitorList ( void  )
private

Definition at line 1673 of file zmserver.cpp.

Referenced by ZMServer().

◆ getFrame()

int ZMServer::getFrame ( unsigned char *  buffer,
int  bufferSize,
MONITOR monitor 
)
staticprivate

Definition at line 1744 of file zmserver.cpp.

Referenced by handleGetLiveFrame().

◆ getDiskSpace()

long long ZMServer::getDiskSpace ( const string &  filename,
long long &  total,
long long &  used 
)
staticprivate

Definition at line 711 of file zmserver.cpp.

Referenced by handleGetServerStatus().

◆ tokenize()

void ZMServer::tokenize ( const string &  command,
vector< string > &  tokens 
)
staticprivate

Definition at line 575 of file zmserver.cpp.

Referenced by processRequest().

◆ handleHello()

void ZMServer::handleHello ( void  )
private

Definition at line 701 of file zmserver.cpp.

Referenced by processRequest().

◆ runCommand()

string ZMServer::runCommand ( const string &  command)
staticprivate

◆ getMonitorStatus()

void ZMServer::getMonitorStatus ( const string &  id,
const string &  type,
const string &  device,
const string &  host,
const string &  channel,
const string &  function,
string &  zmcStatus,
string &  zmaStatus,
const string &  enabled 
)
staticprivate

Definition at line 1055 of file zmserver.cpp.

Referenced by handleGetMonitorStatus().

◆ handleGetServerStatus()

void ZMServer::handleGetServerStatus ( void  )
private

Definition at line 740 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetMonitorStatus()

void ZMServer::handleGetMonitorStatus ( void  )
private

Definition at line 949 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetAlarmStates()

void ZMServer::handleGetAlarmStates ( void  )
private

Definition at line 774 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetMonitorList()

void ZMServer::handleGetMonitorList ( void  )
private

Definition at line 1548 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetCameraList()

void ZMServer::handleGetCameraList ( void  )
private

Definition at line 1532 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetEventList()

void ZMServer::handleGetEventList ( vector< string >  tokens)
private

Definition at line 794 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetEventFrame()

void ZMServer::handleGetEventFrame ( vector< string >  tokens)
private

Definition at line 1106 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetAnalysisFrame()

void ZMServer::handleGetAnalysisFrame ( vector< string >  tokens)
private

Definition at line 1186 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetLiveFrame()

void ZMServer::handleGetLiveFrame ( vector< string >  tokens)
private

Definition at line 1353 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetFrameList()

void ZMServer::handleGetFrameList ( vector< string >  tokens)
private

Definition at line 1421 of file zmserver.cpp.

Referenced by processRequest().

◆ handleDeleteEvent()

void ZMServer::handleDeleteEvent ( vector< string >  tokens)
private

Definition at line 1583 of file zmserver.cpp.

Referenced by processRequest().

◆ handleDeleteEventList()

void ZMServer::handleDeleteEventList ( vector< string >  tokens)
private

Definition at line 1620 of file zmserver.cpp.

Referenced by processRequest().

◆ handleGetEventDates()

void ZMServer::handleGetEventDates ( vector< string >  tokens)
private

Definition at line 885 of file zmserver.cpp.

Referenced by processRequest().

◆ handleRunZMAudit()

void ZMServer::handleRunZMAudit ( void  )
private

Definition at line 1655 of file zmserver.cpp.

Referenced by processRequest().

◆ handleSetMonitorFunction()

void ZMServer::handleSetMonitorFunction ( vector< string >  tokens)
private

Definition at line 1910 of file zmserver.cpp.

Referenced by processRequest().

◆ zmcControl()

void ZMServer::zmcControl ( MONITOR monitor,
const string &  mode 
)
private

Definition at line 2013 of file zmserver.cpp.

Referenced by handleSetMonitorFunction().

◆ zmaControl()

void ZMServer::zmaControl ( MONITOR monitor,
const string &  mode 
)
private

Definition at line 2058 of file zmserver.cpp.

Referenced by handleSetMonitorFunction().

Member Data Documentation

◆ m_debug

bool ZMServer::m_debug {false}
private

◆ m_sock

int ZMServer::m_sock {-1}
private

Definition at line 283 of file zmserver.h.

Referenced by send(), and ZMServer().

◆ m_monitors

vector<MONITOR *> ZMServer::m_monitors
private

◆ m_monitorMap

map<int, MONITOR *> ZMServer::m_monitorMap
private

◆ m_useDeepStorage

bool ZMServer::m_useDeepStorage {false}
private

Definition at line 286 of file zmserver.h.

Referenced by handleGetAnalysisFrame(), handleGetEventFrame(), and ZMServer().

◆ m_useAnalysisImages

bool ZMServer::m_useAnalysisImages {false}
private

Definition at line 287 of file zmserver.h.

Referenced by handleGetAnalysisFrame(), and ZMServer().

◆ m_eventFileFormat

string ZMServer::m_eventFileFormat
private

Definition at line 288 of file zmserver.h.

Referenced by handleGetAnalysisFrame(), handleGetEventFrame(), and ZMServer().

◆ m_analysisFileFormat

string ZMServer::m_analysisFileFormat
private

Definition at line 289 of file zmserver.h.

Referenced by handleGetAnalysisFrame(), and ZMServer().

◆ m_shmKey

key_t ZMServer::m_shmKey
private

Definition at line 290 of file zmserver.h.

Referenced by getMonitorList(), and ZMServer().

◆ m_mmapPath

string ZMServer::m_mmapPath
private

Definition at line 291 of file zmserver.h.

Referenced by getMonitorList(), and ZMServer().

◆ m_buf

char ZMServer::m_buf[10] {0}
private

Definition at line 292 of file zmserver.h.


The documentation for this class was generated from the following files: