From 9e504d2311aebc049d4f16795c6406f5151c4903 Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Tue, 10 Dec 2024 17:17:28 +0200 Subject: [PATCH] Checking Presets Of Camera --- Projects/la_mojo/build | 4 ++-- lib/App/common/deviceNodeCamera.cpp | 8 ++++++-- lib/App/common/kernelModuleEmbedVideo.cpp | 10 +++++----- lib/App/common/kernelModuleModemManager.cpp | 3 ++- lib/data/transport/transportSocket.cpp | 13 +++++++------ 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Projects/la_mojo/build b/Projects/la_mojo/build index 70621108..e30c9046 100755 --- a/Projects/la_mojo/build +++ b/Projects/la_mojo/build @@ -2,10 +2,10 @@ #make clean -e "CFG=Debug" -make -e "CFG=Debug" -j6 +#make -e "CFG=Debug" -j6 #make clean -e "CFG=Debug86" -#make -e "CFG=Debug86" -j4 +make -e "CFG=Debug86" -j4 #make clean -e "CFG=Release86" #make -e "CFG=Release86" -j4 diff --git a/lib/App/common/deviceNodeCamera.cpp b/lib/App/common/deviceNodeCamera.cpp index 87e49dbc..8a644039 100644 --- a/lib/App/common/deviceNodeCamera.cpp +++ b/lib/App/common/deviceNodeCamera.cpp @@ -1056,8 +1056,10 @@ void deviceNodeCamera::m_fThreadProc( void ){ }; }; } else { + LOG("Get ABS Preset!"); CSTR token = getPresetToken( COL, ROW ); if ( token ) { + LOG("Have One!"); //update position Info m_bCurrentPresetCol = COL; m_bCurrentPresetRow = ROW; @@ -1196,8 +1198,8 @@ void deviceNodeCamera::m_fThreadProc( void ){ CSTR TK = getPresetToken( ARGUS_PRESET_TYPE_HOME ); if( TK ) { if ( !m_bCameraOnHomePosition ) { - //LOG("Go Home!"); - //LOG( m_sCamData.home_token ); + LOG("Go Home!"); + LOG( TK ); if( !m_pProtocol->goPreset( TK )){ LOG_ERROR("Cannot Issue goPreset Command!"); }; @@ -1208,6 +1210,7 @@ void deviceNodeCamera::m_fThreadProc( void ){ break; }; case CAM_WS_GO_PRESET:{ + LOG("Go Preset!"); //if( m_sCamData.home_token[0] != (char)0 ) { // LOG("Go Home!"); // LOG( m_sCamData.home_token ); @@ -1219,6 +1222,7 @@ void deviceNodeCamera::m_fThreadProc( void ){ break; }; case CAM_WS_SET_PRESET:{ + LOG("Set Preset!"); //if( m_sCamData.home_token[0] != (char)0 ) { // LOG("Go Home!"); // LOG( m_sCamData.home_token ); diff --git a/lib/App/common/kernelModuleEmbedVideo.cpp b/lib/App/common/kernelModuleEmbedVideo.cpp index f3a9bc3c..85094a23 100644 --- a/lib/App/common/kernelModuleEmbedVideo.cpp +++ b/lib/App/common/kernelModuleEmbedVideo.cpp @@ -1291,7 +1291,7 @@ bool kernelModuleEmbedVideo::reloadSettings(){ }; bool kernelModuleEmbedVideo::validate(){ - //LOG("EVE Validation!"); + LOG("EVE Validation!"); bool RetVal = true; if( m_pDBC ){ DBC_MODULE_EMBED_VIDEO_DATA *tDATA = m_pDBC->getEmbedVideoData( m_nDBAUXID ); @@ -1615,11 +1615,11 @@ bool kernelModuleEmbedVideo::registerStream( uint32_t streamID ){ m_mStreamHandlersProtector.unlock(); return true; } else { - LOG("Error Creating new Stream Handler!"); + LOG_ERROR("Error Creating new Stream Handler[t]!"); delete( tData ); }; } else { - LOG("Error Constructing new Stream Handler!"); + LOG_ERROR("Error Constructing new Stream Handler[t]!"); }; } catch (const std::out_of_range& oor ) { m_mStreamHandlersProtector.unlock(); @@ -1636,11 +1636,11 @@ bool kernelModuleEmbedVideo::registerStream( uint32_t streamID ){ m_mStreamHandlersProtector.unlock(); return true; } else { - LOG("Error Creating new Stream Handler!"); + LOG_ERROR("Error Creating new Stream Handler[c]!"); delete( tSH ); }; } else { - LOG("Error Constructing new Stream Handler!"); + LOG_ERROR("Error Constructing new Stream Handler[c]!"); }; }; return false; diff --git a/lib/App/common/kernelModuleModemManager.cpp b/lib/App/common/kernelModuleModemManager.cpp index 736de17a..cb2e561b 100644 --- a/lib/App/common/kernelModuleModemManager.cpp +++ b/lib/App/common/kernelModuleModemManager.cpp @@ -591,6 +591,7 @@ bool kernelModuleModemManager::updateWanIP(){ }; } else { if ( strstr( tB, "wwan")) bIfMeet = true; + if ( strstr( tB, "wwx")) bIfMeet = true; }; }; }; @@ -601,7 +602,7 @@ bool kernelModuleModemManager::updateWanIP(){ }; pclose( fd ); }; -#ifdef DEBUG +#ifdef DEBUG_EXTRA if ( bDone ) { sprintf( CMD, "WAN IP4: %s", m_cMyWanIP ); LOG( CMD ); diff --git a/lib/data/transport/transportSocket.cpp b/lib/data/transport/transportSocket.cpp index 1c5a90cf..6347ce46 100644 --- a/lib/data/transport/transportSocket.cpp +++ b/lib/data/transport/transportSocket.cpp @@ -29,11 +29,12 @@ transportSocket::transportSocket() : basicTransport(), basicDualThread(){ // Destructor implementation transportSocket::~transportSocket(){ -# ifdef DEBUG_EXTRA +# ifdef DEBUG LOG("Destructor begin!"); # endif + m_mBufferProtectorMutex.unlock(); uninit(); -# ifdef DEBUG_EXTRA +# ifdef DEBUG LOG("Destructor end!"); # endif }; @@ -54,7 +55,7 @@ void transportSocket::m_fThreadAProc(void){ #endif while (m_bThreadAStatus < TH_ENDED) { m_mBufferProtectorMutex.lock(); - if( m_nOutputBufferSize > 0 ){ + if( m_nOutputBufferSize > 0 && m_bThreadAStatus < TH_ENDED ){ index = 0; while ((index < m_nOutputBufferSize) && (m_bThreadAStatus < TH_ENDED)){ RetVal = sendBlock(m_pOutputBuffer + index, m_nOutputBufferSize - index); @@ -71,7 +72,7 @@ void transportSocket::m_fThreadAProc(void){ m_mBufferProtectorMutex.unlock(); } else { m_mBufferProtectorMutex.unlock(); - usleep(100); + if( m_bThreadAStatus < TH_ENDED ) usleep(100); }; }; LOG("Sender Thread End!"); @@ -104,11 +105,11 @@ void transportSocket::m_fThreadBProc(void){ #ifdef DEBUG_EXTRA LOG_ERROR("Try to parse data but No Parsers Assigned!"); #endif - SLEEP(100); + if( m_bThreadAStatus < TH_ENDED ) usleep(100); }; } while( ( m_vParsers.size() == 0 ) && ( m_bThreadBStatus < TH_ENDED ) && ( m_bThreadBStatus < TH_ENDED ) ); } else { - usleep(100); + if( m_bThreadAStatus < TH_ENDED ) usleep(100); }; }; LOG("Recipient Thread End!");