45 changed files with 1669 additions and 1893 deletions
-
2Projects/la_mojo/build
-
6Projects/la_mojo/la_mojo.vpj
-
77Projects/la_mojo/makefile
-
42Projects/la_serva/make_c_bin.php
-
126lib/App/common/SQLite_dataBinder.cpp
-
2lib/App/common/SQLite_dataBinder.h
-
5lib/App/common/dataBinder.h
-
19lib/App/common/deviceNode2D.cpp
-
95lib/App/common/deviceNodeCamera.cpp
-
19lib/App/common/deviceNodeCamera.h
-
2lib/App/common/deviceNodeEthernet2Serial.cpp
-
65lib/App/common/deviceNodePTZCamControl.cpp
-
2lib/App/common/deviceNodeSensor.cpp
-
5lib/App/common/deviceNodeSensor.h
-
2lib/App/common/hardwareManager.cpp
-
1lib/App/common/hardwareResource.cpp
-
4lib/App/common/hardwareResource.h
-
304lib/App/common/hardwareResourceSerialProvider.cpp
-
71lib/App/common/hardwareResourceSerialProvider.h
-
3lib/App/common/kernelModule.h
-
275lib/App/common/kernelModuleAttentionCloud.cpp
-
67lib/App/common/kernelModuleAttentionCloud.h
-
944lib/App/common/kernelModuleBosch.cpp
-
35lib/App/common/kernelModuleBosch.h
-
39lib/App/common/kernelModuleFactory.cpp
-
32lib/App/common/sequentalIOps.cpp
-
41lib/App/common/sequentalIOps.h
-
3lib/App/common/streamHandler.h
-
2lib/App/mojo/mojoKernel.cpp
-
10lib/components/base/basicEvent.cpp
-
3lib/components/base/basicMediaDestination.h
-
3lib/components/base/basicMediaSource.h
-
9lib/components/base/basicTransport.h
-
33lib/components/base/basicTypes.h
-
605lib/data/bosch_rcp/bosch_rcp.cpp
-
176lib/data/bosch_rcp/bosch_rcp.h
-
25lib/data/curl/curlRequest.cpp
-
4lib/data/ponvif/ponvif.cpp
-
21lib/data/ponvif/ponvif.h
-
6lib/data/protocol/protocol.cpp
-
15lib/data/protocol/protocolBVMS.cpp
-
150lib/data/protocol/protocolLGS2D.cpp
-
3lib/data/protocol/protocolPTZ.h
-
206lib/data/protocol/protocolPTZ_BRCP.cpp
-
3lib/data/protocol/protocolPTZ_BRCP.h
@ -0,0 +1,42 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
$FILE = fopen( 'no-signal_h.png', "rb" ); |
||||
|
$idx = 0; |
||||
|
$CL = array(); |
||||
|
$CC = array(); |
||||
|
$cnt = 0; |
||||
|
while( !feof( $FILE ) ){ |
||||
|
if( ( $byte = fread( $FILE, 1 ) ) !== false ){ |
||||
|
$OO = bin2hex($byte); |
||||
|
if( strlen( $OO ) == 2 ){ |
||||
|
$cnt++; |
||||
|
$CC[$idx] = '0x'. $OO; |
||||
|
$idx++; |
||||
|
if( ( $idx % 16 ) == 0 ){ |
||||
|
$CL[] = implode( ',', $CC ); |
||||
|
$idx = 0; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
fclose( $FILE ); |
||||
|
if( $idx ){ |
||||
|
$BL = array(); |
||||
|
for( $i = 0; $i < $idx; $i++ ){ |
||||
|
$BL[$i] = $CC[$i]; |
||||
|
}; |
||||
|
$CL[] = implode( ',', $BL ); |
||||
|
}; |
||||
|
echo "const unsigned char no_frame_png_1600x900[{$cnt}] = {\n"; |
||||
|
$id = 0; |
||||
|
foreach( $CL as $C ){ |
||||
|
$id++; |
||||
|
if( $id < count( $CL ) ){ |
||||
|
echo "\t" . $C . ",\n"; |
||||
|
} else { |
||||
|
echo "\t" . $C . "\n"; |
||||
|
}; |
||||
|
}; |
||||
|
echo "};\n"; |
||||
|
?>
|
||||
@ -0,0 +1,275 @@ |
|||||
|
#include "kernelModuleAttentionCloud.h"
|
||||
|
#include "deviceNodeFactory.h"
|
||||
|
#include "deviceNodeCamera.h"
|
||||
|
|
||||
|
|
||||
|
#define LOG(X) kernelModule::m_pLog->Log("TCLOUD", this, X)
|
||||
|
#define LOG_ERROR(X) kernelModule::m_pLog->Log("TCLOUD", this, _LOG_ERROR, X)
|
||||
|
|
||||
|
kernelAttentionCloud::kernelAttentionCloud( uint32_t id ): kernelModule( id , KERNEL_MODULE_ATTENTION_CLOUD ){ |
||||
|
m_pEvtHeap = basicEventHeap::getInstance(); |
||||
|
}; |
||||
|
|
||||
|
kernelAttentionCloud::~kernelAttentionCloud(){ |
||||
|
stopService( true ); |
||||
|
waitThreadEnd( true ); |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::reloadSettings(){ |
||||
|
DBC_ATC_MODULE_DATA *tData = m_pDBC->getAttentionModuleData( m_nDBAUXID ); |
||||
|
if( tData ){ |
||||
|
memcpy( &m_sModuleData, tData, sizeof( DBC_ATC_MODULE_DATA )); |
||||
|
free( tData ); |
||||
|
return true; |
||||
|
}; |
||||
|
return false; |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::startService(){ |
||||
|
LOG("Starting Service!"); |
||||
|
DBC_ATC_MODULE_DATA *tData = m_pDBC->getAttentionModuleData( m_nDBAUXID ); |
||||
|
if( tData ){ |
||||
|
memcpy( &m_sModuleData, tData, sizeof( DBC_ATC_MODULE_DATA )); |
||||
|
free( tData ); |
||||
|
} else { |
||||
|
m_sModuleData.rest_time = 1000; // 1 sec
|
||||
|
m_sModuleData.persist_time = 3000; // 3 seconds
|
||||
|
m_sModuleData.attention_zone_range = 3.0f; // 3 meters
|
||||
|
}; |
||||
|
loadCameras(); |
||||
|
return init(); |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::stopService( bool force ){ |
||||
|
LOG("Stoping Service!"); |
||||
|
return uninit(); |
||||
|
}; |
||||
|
|
||||
|
void kernelAttentionCloud::m_fThreadProc(void){ |
||||
|
bool bNewSecondLoop = false; |
||||
|
uint32_t cTimeSeconds = 0; |
||||
|
uint32_t oTimeSeconds = 0; |
||||
|
m_bThreadStatus = TH_WORKING; |
||||
|
pthread_setname_np( pthread_self(), "AttentionCloud" ); |
||||
|
while( m_bThreadStatus < TH_ENDED ){ |
||||
|
uint64_t cts = getMilliseconds(); |
||||
|
m_mCloudsProtector.lock(); |
||||
|
if( m_vCloud.size() ){ |
||||
|
for( AttentionCloud::iterator idx = m_vCloud.begin(); idx != m_vCloud.end(); idx++ ){ |
||||
|
switch( (*idx)->status ) { |
||||
|
case ATTENTION_STATUS_NEW:{ |
||||
|
if ( ( cts - (*idx)->ts ) > ( m_sModuleData.persist_time << 2 ) ){ |
||||
|
// Kill Not Sutable Targets
|
||||
|
(*idx)->status = ATTENTION_STATUS_ZOMBIE; |
||||
|
break; |
||||
|
}; |
||||
|
if( m_vCameras.size() ){ |
||||
|
//Try find sutable free camera for that
|
||||
|
for( CamCtlAreas::iterator dx = m_vCameras.begin(); dx != m_vCameras.end(); dx++ ) |
||||
|
if ( !(*dx)->busy ){ |
||||
|
#ifdef DEBUG_EXTRA
|
||||
|
char tB[256]; |
||||
|
sprintf( tB,"Cam# %ld is not buzy range is: %0.2f meters", (*dx)->cam_id, (*dx)->range ); |
||||
|
LOG( tB ); |
||||
|
#endif
|
||||
|
if( checkLocation( (*idx)->loc, (*dx)->loc, (*dx)->range ) ) { |
||||
|
TARGET_DATA *tData = (TARGET_DATA *) malloc( sizeof( TARGET_DATA )); |
||||
|
if ( tData ) { |
||||
|
memset(tData,0, sizeof(TARGET_DATA)); |
||||
|
tData->system_target.x = (*idx)->loc.x; |
||||
|
tData->system_target.y = (*idx)->loc.y; |
||||
|
tData->system_target.z = (*idx)->loc.z; |
||||
|
EVENT_CONTAINER * tEvt = createBasicEvent( 0, EVT_CLASS_CAMERA_CTRL, EVT_CAMERA_MOVE_TO, NULL, NULL, tData ); |
||||
|
if ( tEvt ) { |
||||
|
tEvt->m_db_id = 1; // to comply cam fusion engine
|
||||
|
tEvt->m_nDestinationNodeID = (*dx)->cam_id; |
||||
|
m_pEvtHeap->broadcast( tEvt ); |
||||
|
}; |
||||
|
}; |
||||
|
(*idx)->status = ATTENTION_STATUS_SHOWING; |
||||
|
(*idx)->ts = cts; |
||||
|
(*idx)->cam_ctl = (*dx); |
||||
|
(*idx)->cam_ctl->busy = true; |
||||
|
break; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
break; |
||||
|
}; |
||||
|
case ATTENTION_STATUS_SHOWING:{ |
||||
|
if ( ( cts - (*idx)->ts ) > m_sModuleData.persist_time ) { |
||||
|
(*idx)->cam_ctl->busy = false; |
||||
|
(*idx)->cam_ctl = NULL; |
||||
|
(*idx)->status = ATTENTION_STATUS_RESTING; |
||||
|
}; |
||||
|
break; |
||||
|
}; |
||||
|
case ATTENTION_STATUS_RESTING:{ |
||||
|
if ( ( cts - (*idx)->ts ) > m_sModuleData.rest_time ) (*idx)->status = ATTENTION_STATUS_ZOMBIE; |
||||
|
break; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
m_mCloudsProtector.unlock(); |
||||
|
SLEEP(DEFAULT_THREAD_SLEEP_TIME); |
||||
|
}; |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::validate(){ |
||||
|
m_mCloudsProtector.lock(); |
||||
|
if( uint32_t cnt = m_vCloud.size() ){ |
||||
|
for( AttentionCloud::iterator idx = m_vCloud.begin(); idx != m_vCloud.end(); ){ |
||||
|
if( (*idx)->status == ATTENTION_STATUS_ZOMBIE ){ |
||||
|
m_vCloud.erase( idx ); |
||||
|
} else idx++; |
||||
|
}; |
||||
|
}; |
||||
|
m_mCloudsProtector.unlock(); |
||||
|
if ( m_vCameras.size() == 0 ) { |
||||
|
return loadCameras(); |
||||
|
} else { |
||||
|
//Try To Load more Cameras ....
|
||||
|
deviceNode ** tA = NULL; |
||||
|
size_t tCNT = deviceNodeFactory::getInstance()->fetchNodes( ARGUS_IP_PTZ_CAMERA, tA ); |
||||
|
if ( tCNT != m_vCameras.size() ) { |
||||
|
free(tA); |
||||
|
return loadCameras(); |
||||
|
}; |
||||
|
free(tA); |
||||
|
}; |
||||
|
//check settings
|
||||
|
DBC_ATC_MODULE_DATA *tData = m_pDBC->getAttentionModuleData( m_nDBAUXID ); |
||||
|
if( tData ){ |
||||
|
if( memcmp( &m_sModuleData, tData, sizeof( DBC_ATC_MODULE_DATA ) ) != 0 ){ |
||||
|
memcpy( &m_sModuleData, tData, sizeof( DBC_ATC_MODULE_DATA )); |
||||
|
}; |
||||
|
free( tData ); |
||||
|
return true; |
||||
|
}; |
||||
|
return false; |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::deleteCameras(){ |
||||
|
if ( m_vCameras.size() ) { |
||||
|
for( CamCtlAreas::iterator idx = m_vCameras.begin(); idx != m_vCameras.end(); idx++ ) delete( *idx ); |
||||
|
m_vCameras.clear(); |
||||
|
}; |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::loadCameras(){ |
||||
|
deleteCameras(); |
||||
|
deviceNode ** tA = NULL; |
||||
|
size_t tCNT = deviceNodeFactory::getInstance()->fetchNodes( ARGUS_IP_PTZ_CAMERA, tA ); |
||||
|
if( tA == NULL ) return false; |
||||
|
for ( size_t i = 0; i < tCNT; i++) { |
||||
|
CamCtlArea *tData = new CamCtlArea(); |
||||
|
if ( tData ) { |
||||
|
deviceNodeCamera *tCam = (deviceNodeCamera *)tA[i]; |
||||
|
tData->cam_id = tCam->getNodeID(); |
||||
|
tData->loc.x = tCam->getSystemLocationX(); |
||||
|
tData->loc.y = tCam->getSystemLocationY(); |
||||
|
tData->loc.z = tCam->getSystemLocationZ(); |
||||
|
tData->busy = false; |
||||
|
tData->range = tCam->getMaxRange(); |
||||
|
m_vCameras.push_back( tData ); |
||||
|
}; |
||||
|
}; |
||||
|
free(tA); |
||||
|
tA = NULL; |
||||
|
return true; |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::checkLocation( C3D_DECART BASE, C3D_DECART N, float range ){ |
||||
|
#ifdef DEBUG_EXTRA
|
||||
|
char tB[128]; |
||||
|
sprintf( tB, " Comp: %0.2fx%0.2f %0.2fx%0.2f %0.2fx%0.2f",BASE.x,N.x,BASE.y,N.y,BASE.z, N.z ); |
||||
|
LOG( tB ); |
||||
|
#endif
|
||||
|
float A = (BASE.x - N.x)*(BASE.x - N.x); |
||||
|
float B = (BASE.y - N.y)*(BASE.y - N.y); |
||||
|
float C = (BASE.z - N.z)*(BASE.z - N.z); |
||||
|
float D = sqrtf( A+B+C ); |
||||
|
#ifdef DEBUG_EXTRA
|
||||
|
sprintf( tB, " Final Comp: %0.2f %0.2f", D, range ); |
||||
|
LOG( tB ); |
||||
|
#endif
|
||||
|
return ( D < range ); |
||||
|
}; |
||||
|
|
||||
|
AttentionZone *kernelAttentionCloud::getOldest(){ |
||||
|
AttentionZone *RetVal = NULL; |
||||
|
m_mCloudsProtector.lock(); |
||||
|
if( m_vCloud.size() ){ |
||||
|
uint64_t max_ts = getMilliseconds(); |
||||
|
for( AttentionCloud::iterator idx = m_vCloud.begin(); idx != m_vCloud.end(); idx++ ) |
||||
|
if( (*idx)->ts < max_ts && (*idx)->status == ATTENTION_STATUS_NEW ) { |
||||
|
RetVal = *idx; |
||||
|
max_ts = (*idx)->ts; |
||||
|
break; |
||||
|
}; |
||||
|
}; |
||||
|
m_mCloudsProtector.unlock(); |
||||
|
return RetVal; |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::registerAttention( /*uint32_t TargetRefID,*/ C3D_DECART L ){ |
||||
|
AttentionZone * cAZ = NULL; |
||||
|
m_mCloudsProtector.lock(); |
||||
|
if( m_vCloud.size() ){ |
||||
|
for( AttentionCloud::iterator idx = m_vCloud.begin(); idx != m_vCloud.end(); idx++ ) |
||||
|
if ( checkLocation( (*idx)->loc, L, (*idx)->range ) ) { |
||||
|
cAZ = *idx; |
||||
|
break; |
||||
|
}; |
||||
|
}; |
||||
|
if ( cAZ ) { |
||||
|
//Found in collection -> update
|
||||
|
cAZ->loc.x = L.x; |
||||
|
cAZ->loc.y = L.y; |
||||
|
cAZ->loc.z = L.z; |
||||
|
if( cAZ->status == ATTENTION_STATUS_ZOMBIE ){ |
||||
|
cAZ->status = ATTENTION_STATUS_NEW; |
||||
|
cAZ->ts = getMilliseconds(); |
||||
|
}; |
||||
|
} else { |
||||
|
//Not Found in Current Active Zones
|
||||
|
AttentionZone * tAZ = new AttentionZone(); |
||||
|
if ( tAZ ) { |
||||
|
tAZ->loc.x = L.x; |
||||
|
tAZ->loc.y = L.y; |
||||
|
tAZ->loc.z = L.z; |
||||
|
tAZ->range = m_sModuleData.attention_zone_range; |
||||
|
tAZ->ts = getMilliseconds(); |
||||
|
tAZ->status = ATTENTION_STATUS_NEW; |
||||
|
m_vCloud.push_back( tAZ ); |
||||
|
}; |
||||
|
}; |
||||
|
m_mCloudsProtector.unlock(); |
||||
|
return true; |
||||
|
}; |
||||
|
|
||||
|
bool kernelAttentionCloud::dispatchEvent(EVENT_CONTAINER * E){ |
||||
|
if( E == NULL ) return false; |
||||
|
switch( E->m_eType ){ |
||||
|
case EVT_ROI_ACTIVE: |
||||
|
case EVT_TARGET_1D: |
||||
|
case EVT_TARGET_2D_BLACK: |
||||
|
case EVT_TARGET_2D_WHITE: |
||||
|
case EVT_TARGET_3D_BLACK: |
||||
|
case EVT_TARGET_3D_WHITE:{ |
||||
|
TARGET_DATA * tDATA; |
||||
|
tDATA = (TARGET_DATA *) E->m_pEvtData; |
||||
|
if( tDATA ) { |
||||
|
//LOG("Reg New Movement!");
|
||||
|
registerAttention( tDATA->system_target ); |
||||
|
} |
||||
|
break; |
||||
|
}; |
||||
|
default: break; |
||||
|
}; |
||||
|
return true; |
||||
|
}; |
||||
|
|
||||
|
#undef LOG_ERROR
|
||||
|
#undef LOG
|
||||
@ -0,0 +1,67 @@ |
|||||
|
#ifndef __KERNEL_MODULE_ATTENTION_CLOUD__ |
||||
|
#define __KERNEL_MODULE_ATTENTION_CLOUD__ |
||||
|
|
||||
|
#include "kernelModule.h" |
||||
|
#include "../../components/base/basicThread.h" |
||||
|
#include "../../components/base/basicMutex.h" |
||||
|
#include "../../components/base/basicEventHeap.h" |
||||
|
#include <vector> |
||||
|
|
||||
|
#define ATTENTION_STATUS_NEW 0 |
||||
|
#define ATTENTION_STATUS_SHOWING 1 |
||||
|
#define ATTENTION_STATUS_RESTING 2 |
||||
|
#define ATTENTION_STATUS_ZOMBIE 3 |
||||
|
|
||||
|
typedef struct S_AttentionTarget{ |
||||
|
float temperature; |
||||
|
}AttentionTarget; |
||||
|
|
||||
|
typedef std::vector<AttentionTarget *> AttentionTargets; |
||||
|
|
||||
|
typedef struct S_CamCtlArea{ |
||||
|
uint64_t cam_id; |
||||
|
uint64_t lts; |
||||
|
C3D_DECART loc; |
||||
|
float range; |
||||
|
basicMutex block; |
||||
|
bool busy; |
||||
|
}CamCtlArea; |
||||
|
|
||||
|
typedef struct S_AttentionZone{ |
||||
|
C3D_DECART loc; |
||||
|
float range; |
||||
|
uint64_t ts; |
||||
|
uint8_t status; |
||||
|
CamCtlArea * cam_ctl; |
||||
|
}AttentionZone; |
||||
|
|
||||
|
typedef std::vector<AttentionZone *> AttentionCloud; |
||||
|
typedef std::vector<CamCtlArea *> CamCtlAreas; |
||||
|
|
||||
|
class kernelAttentionCloud : public kernelModule, public basicThread { |
||||
|
private: |
||||
|
basicEventHeap * m_pEvtHeap; |
||||
|
AttentionCloud m_vCloud; |
||||
|
CamCtlAreas m_vCameras; |
||||
|
DBC_ATC_MODULE_DATA m_sModuleData; |
||||
|
basicMutex m_mCloudsProtector; |
||||
|
bool isCamBusy( uint64_t cam_id ); |
||||
|
bool registerAttention( /*uint32_t TargetRefID,*/ C3D_DECART L ); |
||||
|
bool checkLocation( C3D_DECART BASE, C3D_DECART N, float range ); |
||||
|
bool createMoveToEvt( uint32_t cam_id, C3D_DECART L ); |
||||
|
AttentionZone * getOldest(); |
||||
|
bool loadCameras(); |
||||
|
bool deleteCameras(); |
||||
|
protected: |
||||
|
void m_fThreadProc(void); |
||||
|
public: |
||||
|
explicit kernelAttentionCloud( uint32_t id ); |
||||
|
~kernelAttentionCloud(); |
||||
|
virtual bool reloadSettings(); |
||||
|
virtual bool startService(); |
||||
|
virtual bool stopService(bool force = false); |
||||
|
virtual bool validate(); |
||||
|
virtual bool dispatchEvent(EVENT_CONTAINER * Evt); |
||||
|
}; |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,32 @@ |
|||||
|
#include "sequentalIOps.h"
|
||||
|
|
||||
|
sequentalSerial::sequentalSerial( uint32_t dbID ):hardwareResourceSerialProvider( dbID ){ |
||||
|
m_pCurrentIO = NULL; |
||||
|
}; |
||||
|
|
||||
|
sequentalSerial::~sequentalSerial(){ |
||||
|
m_pCurrentIO = NULL; |
||||
|
}; |
||||
|
|
||||
|
IO_Sequence *sequentalSerial::fetchIO(){ |
||||
|
m_mCurrentIO.lock(); |
||||
|
if( m_qIOQ.size ){ |
||||
|
m_pCurrentIO = m_qIOQ.front(); |
||||
|
m_qIOQ.pop(); |
||||
|
} else m_pCurrentIO = NULL; |
||||
|
m_mCurrentIO.unlock(); |
||||
|
retrun m_pCurrentIO; |
||||
|
}; |
||||
|
|
||||
|
bool sequentalSerial::sendData( uint8_t *Data, size_t DataSize ){ |
||||
|
IO_Sequence *tData = new IO_Sequence(); |
||||
|
if( tData ){ |
||||
|
m_qIOQ.push( tData ); |
||||
|
return true; |
||||
|
}; |
||||
|
return false; |
||||
|
}; |
||||
|
|
||||
|
bool sequentalSerial::receiveData( IO_Sequence *ptr ){ |
||||
|
|
||||
|
}; |
||||
@ -0,0 +1,41 @@ |
|||||
|
#ifndef __SEQUENTAL_IOPS_HEADER__ |
||||
|
#define __SEQUENTAL_IOPS_HEADER__ |
||||
|
|
||||
|
#include "../../components/base/basicMutex.h" |
||||
|
#include <queue.h> |
||||
|
|
||||
|
typedef struct S_IO_Sequence{ |
||||
|
basicMutex block; |
||||
|
uint8_t * out_data; |
||||
|
size_t out_size; |
||||
|
bool sucess; |
||||
|
uint8_t * in_data; |
||||
|
size_t in_size; |
||||
|
}IO_Sequence; |
||||
|
|
||||
|
typedef std::queue<IO_Sequence*> QIO_Sequence; |
||||
|
|
||||
|
class sequentalSerial: public hardwareResourceSerialProvider{ |
||||
|
private: |
||||
|
basicMutex m_mCurrentIO; |
||||
|
QIO_Sequence m_qIOQ; |
||||
|
IO_Sequence * m_pCurrentIO; |
||||
|
protected: |
||||
|
IO_Sequence * fetchIO(){ |
||||
|
m_mCurrentIO.lock(); |
||||
|
if( m_qIOQ.size ){ |
||||
|
m_pCurrentIO = m_qIOQ.front(); |
||||
|
m_qIOQ.pop(); |
||||
|
} else m_pCurrentIO = NULL; |
||||
|
m_mCurrentIO.unlock(); |
||||
|
retrun m_pCurrentIO; |
||||
|
}; |
||||
|
public: |
||||
|
explicit sequentalSerial( uint32_t dbID ); |
||||
|
~sequentalSerial(); |
||||
|
bool sendData(); |
||||
|
bool receiveData( IO_Sequence *ptr ); |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
#endif |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue