diff --git a/lib/App/common/hardwareResourceSerialProvider.cpp b/lib/App/common/hardwareResourceSerialProvider.cpp index 6323ae2a..2e9b0c58 100644 --- a/lib/App/common/hardwareResourceSerialProvider.cpp +++ b/lib/App/common/hardwareResourceSerialProvider.cpp @@ -471,7 +471,7 @@ bool hardwareResourceSerialProvider::create_HW(){ m_bManualRTS = true; wiringPiSetup(); //Set RTS Pin - pinMode( 0, OUTPUT ); + pinMode( RTS_PIN_NUMBER, OUTPUT ); } else { #ifdef DEBUG LOG("NO MANUAL RTS CTL(R)"); @@ -490,7 +490,7 @@ bool hardwareResourceSerialProvider::create_HW(){ } else { //Set RTS Pin //pinMode( 0, OUTPUT ); - pinMode( 0, PINMODE_OUTPUT); + pinMode( RTS_PIN_NUMBER, PINMODE_OUTPUT); m_bManualRTS = true; }; } else { @@ -1222,9 +1222,9 @@ void hardwareResourceSerialProvider::setRTS( uint8_t Val ){ #if defined( USE_WIRINGPI ) || defined( USE_WIRINGX ) if ( Val ) { //Use RTS GPIO - digitalWrite( 0, HIGH ); + digitalWrite( RTS_PIN_NUMBER, HIGH ); } else { - digitalWrite( 0, LOW ); + digitalWrite( RTS_PIN_NUMBER, LOW ); }; #else int flags; @@ -1262,7 +1262,7 @@ int hardwareResourceSerialProvider::sendBlock(unsigned char* Data, int DataSize) do{ if( m_bManualRTS ) { #if defined( USE_WIRINGPI ) || defined( USE_WIRINGX ) - digitalWrite( 0, HIGH ); + digitalWrite( RTS_PIN_NUMBER, HIGH ); #else setRTS( 1 ); #endif @@ -1274,7 +1274,7 @@ int hardwareResourceSerialProvider::sendBlock(unsigned char* Data, int DataSize) int r = ioctl( m_iOutFID, TIOCSERGETLSR, &lsr ); } while (!(lsr & TIOCSER_TEMT)); #if defined( USE_WIRINGPI ) || defined( USE_WIRINGX ) - digitalWrite( 0, LOW ); + digitalWrite( RTS_PIN_NUMBER, LOW ); #else setRTS( 0 ); #endif diff --git a/lib/App/common/hardwareResourceSerialProvider.h b/lib/App/common/hardwareResourceSerialProvider.h index 1ddbc8e8..11c06fe2 100644 --- a/lib/App/common/hardwareResourceSerialProvider.h +++ b/lib/App/common/hardwareResourceSerialProvider.h @@ -26,8 +26,10 @@ #include #ifdef __aarch64__ #define WIRINGX_PLATFORM "rock4" + #define RTS_PIN_NUMBER 4 #else #define WIRINGX_PLATFORM "raspberrypi4" + #define RTS_PIN_NUMBER 0 #endif #endif #endif diff --git a/lib/App/common/kernelModule.h b/lib/App/common/kernelModule.h index d1bdd5c7..5130906c 100644 --- a/lib/App/common/kernelModule.h +++ b/lib/App/common/kernelModule.h @@ -1,58 +1,58 @@ -#ifndef __DFSL_KERNEL_MODULE_HEADER__ -#define __DFSL_KERNEL_MODULE_HEADER__ - -#include - -#include "../../components/base/basicObject.h" -#include "../../components/base/basicEngine.h" -#include "../../components/base/basicEventHandler.h" -#include "../../components/base/basicLogCollection.h" -#include "dataBinder.h" - - -typedef enum E_KERNEL_MODULE_TYPE{ - KERNEL_MODULE_UNKNOWN = 0, - //KERNEL_MODULE_ZLMEDIA = 1, - KERNEL_MODULE_DCBUSB = 1, - KERNEL_MODULE_KAFKA = 2, - KERNEL_MODULE_GPS = 3, - KERNEL_MODULE_NETWORK = 4, - KERNEL_MODULE_FLYHUNTER = 5, - KERNEL_MODULE_SSDP_ANONCE = 6, - KERNEL_MODULE_ONVIF_OBSERVER = 7, - KERNEL_MODULE_EMBED_VIDEO = 8, - KERNEL_MODULE_MODEM_MANAGER = 9 -}KERNEL_MODULE_TYPE; - -class kernelModule: public basicEventHandler, basicObject{ - protected: - basicLogCollection * m_pLog; - dataBinder * m_pDBC; - uint32_t m_nDBID; - uint32_t m_nDBAUXID; - bool m_bEnabled; - bool m_bDetached; - bool m_bEvtFlags[EVT_COUNT]; - KERNEL_MODULE_TYPE m_eType; - public: - explicit kernelModule( uint32_t id, KERNEL_MODULE_TYPE type = KERNEL_MODULE_UNKNOWN ); - virtual ~kernelModule(); - uint32_t getId() const { return m_nDBID; }; - uint32_t getAuxId() const { return m_nDBAUXID; }; - KERNEL_MODULE_TYPE getType() const { return m_eType; }; - bool isDetached() const { return m_bDetached; }; - bool isAttached() const { return !m_bDetached; }; - bool isEnabled() const { return m_bEnabled;}; - virtual bool reloadSettings(){ return false; }; - void setAttached( bool b=true ){ m_bDetached = !b; }; - void setDetached( bool b=true ){ m_bDetached = b; }; - virtual bool startService(){ return false; }; - virtual bool stopService( bool force = false ){ return true; }; - virtual bool validate(){ return false; }; - virtual void dispatchEvent( EVENT_CONTAINER *Evt ){}; -}; - -typedef std::vector vectorKernelModules; - -#endif - +#ifndef __DFSL_KERNEL_MODULE_HEADER__ +#define __DFSL_KERNEL_MODULE_HEADER__ + +#include + +#include "../../components/base/basicObject.h" +#include "../../components/base/basicEngine.h" +#include "../../components/base/basicEventHandler.h" +#include "../../components/base/basicLogCollection.h" +#include "dataBinder.h" + + +typedef enum E_KERNEL_MODULE_TYPE{ + KERNEL_MODULE_UNKNOWN = 0, + KERNEL_MODULE_DCBUSB = 1, + KERNEL_MODULE_KAFKA = 2, + KERNEL_MODULE_GPS = 3, + KERNEL_MODULE_NETWORK = 4, + KERNEL_MODULE_FLYHUNTER = 5, + KERNEL_MODULE_SSDP_ANONCE = 6, + KERNEL_MODULE_ONVIF_OBSERVER = 7, + KERNEL_MODULE_EMBED_VIDEO = 8, + KERNEL_MODULE_MODEM_MANAGER = 9, + KERNEL_MODULE_REMOTE_SERVER = 10 +}KERNEL_MODULE_TYPE; + +class kernelModule: public basicEventHandler, basicObject{ + protected: + basicLogCollection * m_pLog; + dataBinder * m_pDBC; + uint32_t m_nDBID; + uint32_t m_nDBAUXID; + bool m_bEnabled; + bool m_bDetached; + bool m_bEvtFlags[EVT_COUNT]; + KERNEL_MODULE_TYPE m_eType; + public: + explicit kernelModule( uint32_t id, KERNEL_MODULE_TYPE type = KERNEL_MODULE_UNKNOWN ); + virtual ~kernelModule(); + uint32_t getId() const { return m_nDBID; }; + uint32_t getAuxId() const { return m_nDBAUXID; }; + KERNEL_MODULE_TYPE getType() const { return m_eType; }; + bool isDetached() const { return m_bDetached; }; + bool isAttached() const { return !m_bDetached; }; + bool isEnabled() const { return m_bEnabled;}; + virtual bool reloadSettings(){ return false; }; + void setAttached( bool b=true ){ m_bDetached = !b; }; + void setDetached( bool b=true ){ m_bDetached = b; }; + virtual bool startService(){ return false; }; + virtual bool stopService( bool force = false ){ return true; }; + virtual bool validate(){ return false; }; + virtual void dispatchEvent( EVENT_CONTAINER *Evt ){}; +}; + +typedef std::vector vectorKernelModules; + +#endif + diff --git a/lib/App/mojo/mojoKernel.cpp b/lib/App/mojo/mojoKernel.cpp index bfc47e1c..02747047 100644 --- a/lib/App/mojo/mojoKernel.cpp +++ b/lib/App/mojo/mojoKernel.cpp @@ -58,6 +58,7 @@ mojoKernel::mojoKernel( config_setting_t *ptr ):kernelPrototype( ptr ){ m_pShadow = NULL; m_pSystemAnchor = NULL; m_bSessionStarted = false; + m_bWorkWithRemoteServer = false; //setWM( WM_NONE ); }; @@ -548,7 +549,8 @@ void mojoKernel::validateFilters(){ }; void mojoKernel::dispatchEvent( EVENT_CONTAINER *Evt ){ - if( m_pDBC == NULL ) return; + if ( m_bWorkWithRemoteServer ) return; + if (m_pDBC == NULL) return; if( Evt == NULL ) return; switch( Evt->m_eClass ) { /* diff --git a/lib/App/mojo/mojoKernel.h b/lib/App/mojo/mojoKernel.h index 8fe4d83a..da933174 100644 --- a/lib/App/mojo/mojoKernel.h +++ b/lib/App/mojo/mojoKernel.h @@ -69,6 +69,7 @@ class mojoKernel: public kernelPrototype{ bool m_bDebugMode; + bool m_bWorkWithRemoteServer; bool m_bSessionStarted; uint32_t m_nNoAlarmCounter;