36 changed files with 1368 additions and 315 deletions
-
10Projects/la_mojo/build
-
6Projects/la_serva/build
-
5Projects/la_serva/la_serva.vpj
-
165Projects/la_serva/makefile
-
14lib/App/common/SQLite_dataBinder.cpp
-
2lib/App/common/SQLite_dataBinder.h
-
2lib/App/common/dataBinder.h
-
17lib/App/common/dataBinder_structures.h
-
1lib/App/common/deviceNode.h
-
1lib/App/common/deviceNodeCamera.h
-
2lib/App/common/kernelEventFilter.cpp
-
20lib/App/common/kernelEventFilterTrain.cpp
-
3lib/App/common/kernelEventFilterTrain.h
-
17lib/App/common/kernelModuleEmbedVideo.cpp
-
19lib/App/common/serverDataBinder.h
-
319lib/App/common/serverMySQL_dataBinder.cpp
-
16lib/App/common/serverMySQL_dataBinder.h
-
98lib/App/mojo/mojoKernel.cpp
-
4lib/App/mojo/mojoKernel.h
-
130lib/App/mojo/mojoRemoteClient.cpp
-
65lib/App/serva/servaKernel.cpp
-
5lib/App/serva/servaKernel.h
-
2lib/App/serva/servaKernelToolKit.cpp
-
41lib/App/serva/servaMediaEncoder.cpp
-
1lib/App/serva/servaMediaEncoder.h
-
144lib/App/serva/servaRemoteClientHandler.cpp
-
13lib/App/serva/servaRemoteClientHandler.h
-
384lib/App/serva/servaSessionManager.cpp
-
60lib/App/serva/servaSessionManager.h
-
30lib/components/base/basicFunctionality.cpp
-
1lib/components/base/basicFunctionality.h
-
9lib/data/net/serverPort.cpp
-
25lib/data/protocol/protocolARGUS_DATA.cpp
-
34lib/data/protocol/protocolARGUS_DATA.h
-
12lib/data/transport/transportSocket.cpp
-
6lib/data/transport/transportSocket.h
@ -1,14 +1,14 @@ |
|||
#! /bin/sh |
|||
|
|||
|
|||
make clean -e "CFG=Debug" |
|||
make -e "CFG=Debug" -j6 |
|||
#make clean -e "CFG=Debug" |
|||
#make -e "CFG=Debug" -j$(nproc) |
|||
|
|||
#make clean -e "CFG=Debug86" |
|||
#make -e "CFG=Debug86" -j4 |
|||
make clean -e "CFG=Debug86" |
|||
make -e "CFG=Debug86" -j$(nproc) |
|||
|
|||
#make clean -e "CFG=Release86" |
|||
#make -e "CFG=Release86" -j4 |
|||
#make -e "CFG=Release86" -j$(nproc) |
|||
#cd Release86 |
|||
#strip ./mojo |
|||
#cd .. |
|||
@ -0,0 +1,384 @@ |
|||
#include "servaSessionManager.h"
|
|||
#include "../common/serverMySQL_dataBinder.h"
|
|||
|
|||
|
|||
#define LOG( X ) m_pLog->Log( "SSMN", this, X )
|
|||
|
|||
#ifdef DEBUG
|
|||
#define LOG_ERROR( X ) {\
|
|||
char _tBfrErrMSG2w34[256];\ |
|||
sprintf( _tBfrErrMSG2w34, "In file %s[%d] in func:%s %s",__FILE__, __LINE__, __func__, X );\ |
|||
m_pLog->Log( "SSMN", this, _LOG_ERROR, _tBfrErrMSG2w34 );\ |
|||
} |
|||
#else
|
|||
#define LOG_ERROR( X ) m_pLog->Log( "SSMN", this, _LOG_ERROR, X );
|
|||
#endif
|
|||
|
|||
|
|||
servaSessionManager *servaSessionManager::_instance = NULL; |
|||
|
|||
servaSessionManager *servaSessionManager::getInstance( config_setting_t * Settings ){ |
|||
if( _instance == NULL ){ |
|||
_instance = new servaSessionManager( Settings ); |
|||
}; |
|||
return _instance; |
|||
}; |
|||
|
|||
servaSessionManager::servaSessionManager( config_setting_t * Settings ){ |
|||
m_pLog = basicLogCollection::getInstance(); |
|||
m_pDBC = (serverDataBinder*) servaMySQLDBC::getInstance(); |
|||
m_bRepIsConnected = false; |
|||
//Read System (loalfile) Settings
|
|||
m_pSettings = basicSettingsProvider::getInstance()->getSubNode( Settings, "SESSON_MNGR" ); |
|||
#ifdef DEBUG
|
|||
LOG("Getting Settings ..."); |
|||
#endif
|
|||
config_setting_t * pSetting; |
|||
int tVal; |
|||
const char * tBuf; |
|||
char tBuffer[128]; |
|||
|
|||
if(!config_setting_lookup_int(m_pSettings, "SESSION_TIMEOUT", &tVal )){ |
|||
pSetting = config_setting_add(m_pSettings, "SESSION_TIMEOUT", CONFIG_TYPE_INT); |
|||
m_nSessionTO = DEFAULT_SESSION_TIMEOUT; |
|||
config_setting_set_int( pSetting, m_nSessionTO ); |
|||
basicSettingsProvider::getInstance()->compromise(); |
|||
LOG("Session Timeout not set - using default"); |
|||
} else { |
|||
m_nSessionTO = tVal; |
|||
sprintf( tBuffer, "Session Timeout Read From Settings: %d sec.", m_nSessionTO ); |
|||
LOG( tBuffer ); |
|||
}; |
|||
if(!config_setting_lookup_string(m_pSettings, "REPORTS_DIR_NAME", &tBuf )){ |
|||
pSetting = config_setting_add(m_pSettings, "REPORTS_DIR_NAME", CONFIG_TYPE_STRING); |
|||
sprintf( m_pDbReportBase, "data/reports" ); |
|||
config_setting_set_string( pSetting, m_pDbReportBase ); |
|||
basicSettingsProvider::getInstance()->compromise(); |
|||
LOG("Reports Storage not set - using default"); |
|||
} else { |
|||
sprintf( m_pDbReportBase, tBuf ); |
|||
}; |
|||
if(!config_setting_lookup_string(m_pSettings, "WEB_ACCESS_USER", &tBuf )){ |
|||
pSetting = config_setting_add(m_pSettings, "WEB_ACCESS_USER", CONFIG_TYPE_STRING); |
|||
sprintf( web_access_user, "www-data" ); |
|||
config_setting_set_string( pSetting, web_access_user ); |
|||
basicSettingsProvider::getInstance()->compromise(); |
|||
LOG("Web Access User not set - using default"); |
|||
} else { |
|||
sprintf( web_access_user, tBuf ); |
|||
}; |
|||
if(!config_setting_lookup_string(m_pSettings, "WEB_ACCESS_GROUP", &tBuf )){ |
|||
pSetting = config_setting_add(m_pSettings, "WEB_ACCESS_GROUP", CONFIG_TYPE_STRING); |
|||
sprintf( web_access_group, "www-data" ); |
|||
config_setting_set_string( pSetting, web_access_group ); |
|||
basicSettingsProvider::getInstance()->compromise(); |
|||
LOG("Web Access Group not set - using default"); |
|||
} else { |
|||
sprintf( web_access_group, tBuf ); |
|||
}; |
|||
|
|||
basicSettingsProvider::getInstance()->validate(); |
|||
|
|||
//if( !fileExist( DB_SHMEM_POINT )) {
|
|||
// bRecreateMemStructures = true;
|
|||
// mkdir( DB_SHMEM_POINT, STORAGE_DIR_MODE );// S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH );
|
|||
// chown( DB_SHMEM_POINT, getUserUid(web_access_user), getUserGid(web_access_group) ); //To make Accessed from PHP
|
|||
// chmod( DB_SHMEM_POINT, STORAGE_DIR_MODE );
|
|||
//};
|
|||
|
|||
|
|||
|
|||
|
|||
}; |
|||
|
|||
servaSessionManager::~servaSessionManager(){ |
|||
//Close all Ongoing Session since Application goes to die
|
|||
m_pDBC->closeAllOnGoingSessions(); |
|||
}; |
|||
|
|||
uint64_t servaSessionManager::addEvent( uint32_t tack_id, uint32_t module_id, ARGUS_DATA_EVENT *ptr ){ |
|||
uint64_t rV = 0; |
|||
if( SESSION_DATA *sp = updateSession( tack_id, module_id ) ) { |
|||
if( addEvent( sp, ptr ) ) rV = sp->db_id; |
|||
}; |
|||
return rV; |
|||
}; |
|||
|
|||
bool servaSessionManager::addEvent( uint64_t sid, ARGUS_DATA_EVENT *ptr ){ |
|||
if( SESSION_DATA *sp = validateSession( sid ) ) { |
|||
return addEvent( sp, ptr ); |
|||
}; |
|||
return false; |
|||
}; |
|||
|
|||
bool servaSessionManager::addEvent( SESSION_DATA *sp, ARGUS_DATA_EVENT *ptr ){ |
|||
if ( ptr == NULL ) return false; |
|||
if ( sp == NULL ) return false; |
|||
if ( sp->m_pDataReport ) { |
|||
char tQBuf[1024]; |
|||
switch ( ptr->TYPE ) { |
|||
case EVT_LRF_END_SESSION_TO: |
|||
case EVT_LRF_END_SESSION_MA: |
|||
sprintf( tQBuf, "INSERT INTO `events`(`module_id`,`ts`,`ts_ms`,`evt_type`) VALUES(%d,%d,%d,%d)", |
|||
ptr->MODULE_ID, |
|||
ptr->TS, |
|||
ptr->MS, |
|||
ptr->TYPE |
|||
); |
|||
break; |
|||
case EVT_LRF_START_SESSION: |
|||
sprintf( tQBuf, "INSERT INTO `events`(`module_id`,`ts`,`ts_ms`,`evt_type`) VALUES(%d,%d,%d,%d)", |
|||
ptr->MODULE_ID, |
|||
ptr->TS, |
|||
ptr->MS, |
|||
ptr->TYPE |
|||
); |
|||
break; |
|||
case EVT_FLT_LATF_CHK: |
|||
case EVT_FLT_LATF_UP_DETEC: |
|||
case EVT_FLT_LATF_BT_DETEC: |
|||
case EVT_FLT_LATF_TRP_DET: |
|||
case EVT_FLT_LATF_TRP_UPDT: |
|||
case EVT_FLT_LATF_SUSP_START: |
|||
case EVT_FLT_LATF_SUSP_NAK: |
|||
case EVT_FLT_LATF_REGULAR: |
|||
case EVT_FLT_LATF_DISABLED: |
|||
case EVT_FLT_LATF_SUSP_DET: |
|||
case EVT_FLT_LATF_DIFF_DET: |
|||
case EVT_FLT_LATF_OP_DISABLED: |
|||
case EVT_FLT_LATF_OP_TD: |
|||
case EVT_FLT_LATF_OP_TG: |
|||
case EVT_FLT_LATF_OP_EXP: |
|||
case EVT_OP_ACK_MASK: |
|||
case EVT_OP_NACK_MASK: |
|||
case EVT_OP_ON_MASK: |
|||
case EVT_OP_OFF_MASK: |
|||
case EVT_CONNECTED: |
|||
case EVT_DISCONNECTED: |
|||
case EVT_COMMUNICATION_JAMED: |
|||
case EVT_STUDY: |
|||
case EVT_BUSY: |
|||
case EVT_FLIP: |
|||
case EVT_READY: |
|||
case EVT_ERR_LRF_NO_IRQ: |
|||
case EVT_ERR_LRF_NO_ZERO: |
|||
case EVT_ERR_LRF_ANGLE: |
|||
case EVT_ERR_LRF_VOLTAGE: |
|||
case EVT_ERR_LRF_BROKEN: |
|||
case EVT_LRF_VIS_CHANGED: |
|||
case EVT_ERR_OVERFLOW: |
|||
case EVT_SST_OVERFLOW: |
|||
case EVT_VIDEO_FPS_DEGRADED: |
|||
case EVT_VIDEO_FPS_RAISED:{ |
|||
sprintf( tQBuf, "INSERT INTO `events`(`module_id`,`ts`,`ts_ms`,`evt_type`) VALUES(%d,%d,%d,%d)", |
|||
ptr->MODULE_ID, |
|||
ptr->TS, |
|||
ptr->MS, |
|||
ptr->TYPE |
|||
); |
|||
break; |
|||
}; |
|||
case EVT_ROI_ACTIVE: |
|||
case EVT_TARGET_3D_WHITE: |
|||
case EVT_TARGET_3D_BLACK:{ |
|||
updateSessionStat( sp->db_id ); |
|||
sprintf( tQBuf, "INSERT INTO `events`(`module_id`,`ts`,`ts_ms`,`evt_type`,`azimuth`,`elevation`,`range`,`area`)" \ |
|||
" VALUES(%d,%d,%d,%d,%0.2f,%0.2f,%0.2f,%0.2f)", |
|||
ptr->MODULE_ID, |
|||
ptr->TS, |
|||
ptr->MS, |
|||
ptr->TYPE, |
|||
ptr->AZIMUTH / 1000.0f, |
|||
ptr->ELEVATION / 1000.0f, |
|||
ptr->RANGE / 1000.0f, |
|||
ptr->AREA / 100.0f |
|||
); |
|||
break; |
|||
}; |
|||
case EVT_TARGET_2D_WHITE: |
|||
case EVT_TARGET_2D_BLACK:{ |
|||
updateSessionStat( sp->db_id ); |
|||
sprintf( tQBuf, "INSERT INTO `events`(`module_id`,`ts`,`ts_ms`,`evt_type`,`azimuth`,`range`,`area`)" \ |
|||
" VALUES(%d,%d,%d,%d,%0.2f,%0.2f,%0.2f,%0.2f)", |
|||
ptr->MODULE_ID, |
|||
ptr->TS, |
|||
ptr->MS, |
|||
ptr->TYPE, |
|||
ptr->AZIMUTH / 1000.0f, |
|||
ptr->RANGE / 1000.0f, |
|||
ptr->AREA / 100.0f |
|||
); |
|||
break; |
|||
}; |
|||
default: return false; |
|||
}; |
|||
#ifdef DEBUG_EXTRA
|
|||
LOG( tQBuf ); |
|||
#endif
|
|||
return sp->m_pDataReport->SilentQuery( tQBuf ); |
|||
}; |
|||
return false; |
|||
}; |
|||
|
|||
bool servaSessionManager::addVideo( DBC_RPC_MEDIA_INFO_EX *ptr ){//uint32_t module_id, uint32_t ts, uint16_t tsms, CSTR uuid, CSTR fmt, uint8_t fps ){
|
|||
if ( ptr == NULL ) return false; |
|||
SESSION_DATA *sp = validateSession( ptr->session_id ); |
|||
if ( sp == NULL ) return false; |
|||
if ( sp->m_pDataReport ) { |
|||
updateSessionStat( ptr->session_id, false ); |
|||
char tQBuf[1024]; |
|||
sprintf( tQBuf, "INSERT INTO `videos`(`module_id`,`uuid`,`ts`,`ts_ms`,`ext`,`fps`) VALUES(%d,'%s',%d,%d,'%s',%d)", |
|||
ptr->module_id, |
|||
ptr->uuid, |
|||
ptr->ts, |
|||
ptr->tms, |
|||
ptr->fmt, |
|||
ptr->fps |
|||
); |
|||
#ifdef DEBUG_EXTRA
|
|||
LOG( tQBuf ); |
|||
#endif
|
|||
return sp->m_pDataReport->SilentQuery( tQBuf ); |
|||
}; |
|||
return false; |
|||
}; |
|||
|
|||
bool servaSessionManager::create(){ |
|||
//Reset All Ongoing Session since Application was restarted (crashed?)
|
|||
return m_pDBC->closeAllOnGoingSessions(); |
|||
}; |
|||
|
|||
CSTR servaSessionManager::getSessionBase( uint64_t sid ){ |
|||
SESSION_DATA *sp = validateSession( sid ); |
|||
if ( sp ) return sp->reportVaultPath; |
|||
return NULL; |
|||
}; |
|||
|
|||
SESSION_DATA *servaSessionManager::updateSession( uint32_t tack_id, uint32_t module_id ){ |
|||
SESSION_DATA * tData = NULL; |
|||
try { |
|||
tData = m_mSessions.at( tack_id ); |
|||
#ifdef DEBUG
|
|||
LOG("Have Opened Session"); |
|||
#endif
|
|||
} catch ( ... ) { |
|||
// No Session -> Create one
|
|||
tData = (SESSION_DATA*) malloc( sizeof(SESSION_DATA) ); |
|||
if ( tData ) { |
|||
memset( tData, 0, sizeof(SESSION_DATA) ); |
|||
uint64_t cms = getMilliseconds(); |
|||
tData->lts = tData->sts = cms/1000; |
|||
tData->sms = cms%1000; |
|||
tData->track_id = tack_id; |
|||
getUniqID_UUID( tData->uuid ); |
|||
// Create History Database if not exists
|
|||
char tBase[MAX_PATH]; |
|||
sprintf( tBase, "%s/%d", m_pDbReportBase, tack_id ); |
|||
|
|||
if( fileExist( tBase ) == 0 ){ |
|||
if (!createAccessibleDir( tBase, STORAGE_DIR_MODE, getUserUid(web_access_user), getUserGid(web_access_group))){ |
|||
LOG_ERROR("Cannot create Base Report Dir!"); |
|||
#ifdef DEBUG
|
|||
char tB[1024]; |
|||
sprintf( tB, "Dir: %s, UID[%s]: %d GID[%s]: %d", tBase, web_access_user, getUserUid(web_access_user) ,web_access_group, getUserGid(web_access_group) ); |
|||
LOG( tB ); |
|||
#endif
|
|||
free( tData ); |
|||
return NULL; |
|||
}; |
|||
}; |
|||
REPORT_DIRINFO tRDF; |
|||
fillRDF( tData->sts, tRDF ); |
|||
|
|||
if( checkRDFDir( tBase, tRDF, true, getUserUid(web_access_user), getUserGid(web_access_group), STORAGE_DIR_MODE ) ){ |
|||
#ifdef DEBUG
|
|||
LOG("Connect to Report Database"); |
|||
#endif
|
|||
sprintf( tData->reportVaultPath, "%s/%s/%s/%s", tBase, tRDF.YEAR, tRDF.MONTH, tRDF.DAY ); |
|||
//LOG( tData->reportVaultPath );
|
|||
char tName[MAX_PATH]; |
|||
sprintf( tName, "%s/report.db", tData->reportVaultPath ); |
|||
|
|||
if( fileExist( tName ) ){ |
|||
//Allready have report file
|
|||
tData->m_pDataReport = new SQLite_Connector(); |
|||
if ( tData->m_pDataReport ) { |
|||
if( !tData->m_pDataReport->Connect( tName, 0, true) ) { |
|||
//Cleanup
|
|||
delete( tData->m_pDataReport ); |
|||
free( tData ); |
|||
tData = NULL; |
|||
}; |
|||
} else { |
|||
free( tData ); |
|||
tData = NULL; |
|||
}; |
|||
} else { |
|||
#ifdef DEBUG
|
|||
LOG("Create New Report Database"); |
|||
#endif
|
|||
//Create new report file
|
|||
tData->m_pDataReport = new SQLite_Connector(); |
|||
if ( tData->m_pDataReport ) { |
|||
if( tData->m_pDataReport->Connect( tName, 0, true) ) { |
|||
chown( tName, getUserUid(web_access_user), getUserGid(web_access_group) ); |
|||
chmod( tName, DB_FILE_MODE ); |
|||
tData->m_pDataReport->SilentQuery("CREATE TABLE IF NOT EXISTS \"events\" ( \"id\" INTEGER NOT NULL, \"module_id\" INTEGER NOT NULL, \"ts\" INTEGER NOT NULL, \"ts_ms\" INTEGER NOT NULL, \"evt_type\" INTEGER NOT NULL, \"azimuth\" REAL, \"elevation\" REAL, \"range\" REAL, \"area\" REAL, PRIMARY KEY(\"id\" AUTOINCREMENT) )"); |
|||
tData->m_pDataReport->SilentQuery("CREATE TABLE IF NOT EXISTS \"videos\" ( \"id\" INTEGER NOT NULL, \"module_id\" INTEGER NOT NULL, \"uuid\" TEXT NOT NULL UNIQUE, \"ts\" INTEGER NOT NULL, \"ts_ms\" INTEGER NOT NULL, \"ext\" TEXT NOT NULL, \"fps\" INTEGER NOT NULL, PRIMARY KEY(\"id\" AUTOINCREMENT) )"); |
|||
} else { |
|||
//Cleanup
|
|||
delete( tData->m_pDataReport ); |
|||
free( tData ); |
|||
tData = NULL; |
|||
}; |
|||
} else { |
|||
free( tData ); |
|||
tData = NULL; |
|||
}; |
|||
}; |
|||
} else { |
|||
LOG_ERROR("The report Vault Dir can not be accessed!"); |
|||
free( tData ); |
|||
tData = NULL; |
|||
}; |
|||
} else return NULL; |
|||
if ( tData ) { |
|||
//module_id??
|
|||
tData->db_id = m_pDBC->sessionCreate( tData->track_id, tData->sts, tData->sms, tData->uuid, 'A' ); |
|||
if ( tData->db_id == 0 ) { |
|||
//Cleanup
|
|||
delete( tData->m_pDataReport ); |
|||
free( tData ); |
|||
tData = NULL; |
|||
} else m_mSessions[tack_id] = tData; |
|||
}; |
|||
}; |
|||
return tData; |
|||
}; |
|||
|
|||
bool servaSessionManager::updateSessionStat( uint64_t session_id, bool evt ){ |
|||
if ( evt ) { |
|||
m_pDBC->sessionStatAddEvt( session_id ); |
|||
} else { |
|||
m_pDBC->sessionStatAddVid( session_id ); |
|||
}; |
|||
return true; |
|||
}; |
|||
|
|||
bool servaSessionManager::validate(){ |
|||
uint32_t cts = time(NULL); |
|||
for( M_SESSIONS::iterator idx = m_mSessions.begin(); idx != m_mSessions.end(); idx++ ){ |
|||
if( cts - (*idx).second->lts > m_nSessionTO ){ |
|||
// Close Session
|
|||
m_pDBC->updateSessionStatus( (*idx).second->db_id, 1 ); |
|||
// remove session
|
|||
|
|||
}; |
|||
}; |
|||
return true; |
|||
}; |
|||
|
|||
SESSION_DATA *servaSessionManager::validateSession( uint64_t sid ){ |
|||
for( M_SESSIONS::iterator idx = m_mSessions.begin(); idx != m_mSessions.end(); idx++ ) if( (*idx).second->db_id == sid ) return (*idx).second; |
|||
return NULL; |
|||
}; |
|||
@ -0,0 +1,60 @@ |
|||
#ifndef __SERV_A_SESSION_MANAGER_HEADER__ |
|||
#define __SERV_A_SESSION_MANAGER_HEADER__ |
|||
|
|||
#include <unordered_map> |
|||
|
|||
#include "../data/sqlite/sqlite_class.h" |
|||
#include "../common/dataBinder_ReportAux.h" |
|||
#include "../../components/base/basicSettingsProvider.h" |
|||
#include "../../components/base/basicEvent.h" |
|||
#include "../common/serverDataBinder.h" |
|||
#include "../../data/protocol/protocolARGUS_DATA.h" |
|||
|
|||
|
|||
#define DEFAULT_SESSION_TIMEOUT 120 // 2 minutes |
|||
|
|||
typedef struct S_SESSION_DATA{ |
|||
uint32_t track_id; |
|||
uint64_t db_id; |
|||
char uuid[65]; |
|||
uint32_t sts; |
|||
uint32_t sms; |
|||
uint32_t lts; |
|||
uint8_t src; |
|||
char reportVaultPath[MAX_PATH]; |
|||
SQLite_Connector * m_pDataReport; |
|||
}SESSION_DATA; |
|||
|
|||
typedef std::unordered_map< uint32_t, SESSION_DATA* > M_SESSIONS; |
|||
|
|||
class servaSessionManager{ |
|||
private: |
|||
basicLogCollection * m_pLog; |
|||
serverDataBinder * m_pDBC; |
|||
config_setting_t * m_pSettings; |
|||
M_SESSIONS m_mSessions; |
|||
uint32_t m_nSessionTO; |
|||
static servaSessionManager * _instance; |
|||
bool m_bRepIsConnected; |
|||
char web_access_user[64]; |
|||
char web_access_group[64]; |
|||
char m_pDbReportBase[MAX_PATH]; |
|||
bool addEvent( SESSION_DATA *sp, ARGUS_DATA_EVENT *ptr ); //DBC_EVT_RECORD *ptr ); |
|||
protected: |
|||
explicit servaSessionManager( config_setting_t * Settings ); |
|||
public: |
|||
virtual ~servaSessionManager(); |
|||
uint64_t addEvent( uint32_t tack_id, uint32_t module_id, ARGUS_DATA_EVENT *ptr ); //DBC_EVT_RECORD *ptr ); |
|||
bool addEvent( uint64_t sid, ARGUS_DATA_EVENT *ptr ); //DBC_EVT_RECORD *ptr ); |
|||
bool addVideo( DBC_RPC_MEDIA_INFO_EX *ptr ); //uint32_t module_id, uint32_t ts, uint16_t tsms, CSTR uuid, CSTR fmt, uint8_t fps ); |
|||
CSTR getSessionBase( uint64_t sid ); |
|||
bool create(); |
|||
static servaSessionManager * getInstance( config_setting_t * Settings = NULL ); |
|||
SESSION_DATA * updateSession( uint32_t tack_id, uint32_t module_id ); |
|||
bool updateSessionStat( uint64_t session_id, bool evt = true ); |
|||
bool validate(); |
|||
SESSION_DATA * validateSession( uint64_t sid ); |
|||
}; |
|||
|
|||
#endif |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue