Compare commits
No commits in common. "bf3130376308a01ba9d34bcf1b6ed27d134f51de" and "3f28be77935cf462f1c72f09610c4880c9098e75" have entirely different histories.
bf31303763
...
3f28be7793
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
#QT += Network
|
#QT += Network
|
||||||
#QT += gui declarative network
|
#QT += gui declarative network
|
||||||
QT += gui network serialport mqtt websockets
|
QT += gui network serialport mqtt
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
#CONFIG += console
|
#CONFIG += console
|
||||||
@ -8,6 +8,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
|||||||
HEADERS += \
|
HEADERS += \
|
||||||
Sources/Chalet/ChaletData.h \
|
Sources/Chalet/ChaletData.h \
|
||||||
Sources/Chalet/ChaletInterface.h \
|
Sources/Chalet/ChaletInterface.h \
|
||||||
|
Sources/Chalet/ChaletLoraDevice.h \
|
||||||
Sources/Ispindel/IspindelData.h \
|
Sources/Ispindel/IspindelData.h \
|
||||||
Sources/LoraNetworkCommIF.h \
|
Sources/LoraNetworkCommIF.h \
|
||||||
Sources/MasterCtrl.h \
|
Sources/MasterCtrl.h \
|
||||||
@ -52,17 +53,12 @@ HEADERS += \
|
|||||||
Sources/Chalet/ChaletModbusServer.h \
|
Sources/Chalet/ChaletModbusServer.h \
|
||||||
Sources/Ispindel/IspindelDevice.h \
|
Sources/Ispindel/IspindelDevice.h \
|
||||||
Sources/Ispindel/IspindelDataLogger.h \
|
Sources/Ispindel/IspindelDataLogger.h \
|
||||||
Sources/Ispindel/IspindelInterface.h \
|
Sources/Ispindel/IspindelInterface.h
|
||||||
Sources/Gui/LoraSettingsGui.h \
|
|
||||||
Sources/LoraModuleInterface/LoraModuleInterface.h \
|
|
||||||
Sources/NetworkCommIFSurrogate.h \
|
|
||||||
Sources/LoraModuleInterface/LoraModuleInterfaceData.h \
|
|
||||||
Sources/LoraModuleInterface/LoraModuleInterfaceInterface.h \
|
|
||||||
Sources/Chalet/ChaletDevice.h
|
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
Sources/Chalet/ChaletData.cpp \
|
Sources/Chalet/ChaletData.cpp \
|
||||||
Sources/Chalet/ChaletInterface.cpp \
|
Sources/Chalet/ChaletInterface.cpp \
|
||||||
|
Sources/Chalet/ChaletLoraDevice.cpp \
|
||||||
Sources/Ispindel/IspindelData.cpp \
|
Sources/Ispindel/IspindelData.cpp \
|
||||||
Sources/LoraNetworkCommIF.cpp \
|
Sources/LoraNetworkCommIF.cpp \
|
||||||
Sources/main.cpp \
|
Sources/main.cpp \
|
||||||
@ -103,13 +99,7 @@ SOURCES += \
|
|||||||
Sources/Chalet/ChaletModbusServer.cpp \
|
Sources/Chalet/ChaletModbusServer.cpp \
|
||||||
Sources/Ispindel/IspindelDevice.cpp \
|
Sources/Ispindel/IspindelDevice.cpp \
|
||||||
Sources/Ispindel/IspindelDataLogger.cpp \
|
Sources/Ispindel/IspindelDataLogger.cpp \
|
||||||
Sources/Ispindel/IspindelInterface.cpp \
|
Sources/Ispindel/IspindelInterface.cpp
|
||||||
Sources/Gui/LoraSettingsGui.cpp \
|
|
||||||
Sources/LoraModuleInterface/LoraModuleInterface.cpp \
|
|
||||||
Sources/NetworkCommIFSurrogate.cpp \
|
|
||||||
Sources/LoraModuleInterface/LoraModuleInterfaceData.cpp \
|
|
||||||
Sources/LoraModuleInterface/LoraModuleInterfaceInterface.cpp \
|
|
||||||
Sources/Chalet/ChaletDevice.cpp
|
|
||||||
|
|
||||||
DEFINES -= Q_OS_UNIX
|
DEFINES -= Q_OS_UNIX
|
||||||
|
|
||||||
@ -130,10 +120,6 @@ INCLUDEPATH += $$PWD/ \
|
|||||||
$$PWD/blynk-library-master/src/ \
|
$$PWD/blynk-library-master/src/ \
|
||||||
$$PWD/Sources/Modbus \
|
$$PWD/Sources/Modbus \
|
||||||
$$PWD/Sources/Ispindel \
|
$$PWD/Sources/Ispindel \
|
||||||
$$PWD/Sources/LoraModuleInterface \
|
|
||||||
# $$PWD/Lib/QtHTTPServer/include/ \
|
# $$PWD/Lib/QtHTTPServer/include/ \
|
||||||
|
|
||||||
LIBS += -L$$PWD/Lib/QtHTTPServer/ -lQt5HttpServer
|
LIBS += -L$$PWD/Lib/QtHTTPServer/ -lQt5HttpServer
|
||||||
|
|
||||||
FORMS += \
|
|
||||||
Sources/Gui/LoraSettingsGui.ui
|
|
||||||
|
|||||||
@ -1,264 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE QtCreatorProject>
|
|
||||||
<!-- Written by QtCreator 4.2.1, 2023-02-25T13:35:02. -->
|
|
||||||
<qtcreator>
|
|
||||||
<data>
|
|
||||||
<variable>EnvironmentId</variable>
|
|
||||||
<value type="QByteArray">{5a351af6-dc3b-4afc-af92-7da5e3a5cd12}</value>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
|
||||||
<value type="int">0</value>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
|
||||||
<valuemap type="QVariantMap">
|
|
||||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
|
||||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
|
||||||
<value type="QString" key="language">Cpp</value>
|
|
||||||
<valuemap type="QVariantMap" key="value">
|
|
||||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
|
||||||
</valuemap>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
|
||||||
<value type="QString" key="language">QmlJS</value>
|
|
||||||
<valuemap type="QVariantMap" key="value">
|
|
||||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
|
||||||
</valuemap>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
|
||||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
|
||||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
|
||||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
|
||||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
|
||||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
|
||||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
|
||||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
|
||||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
|
||||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
|
||||||
</valuemap>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
|
||||||
<valuemap type="QVariantMap"/>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
|
||||||
<valuemap type="QVariantMap">
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.14.2</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.14.2</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{dc2b548b-27bc-4e25-8500-cc36640735d8}</value>
|
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Main/PicDev/Projets/MasterCtrl/Masterctrl</value>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
|
||||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
|
||||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
|
||||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
|
||||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
|
||||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Main/PicDev/Projets/MasterCtrl/Masterctrl/release</value>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
|
|
||||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
|
||||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
|
||||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
|
||||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
|
||||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
|
||||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
|
||||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
|
||||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
|
||||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
|
||||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
|
||||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
|
||||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
|
||||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
|
||||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
|
||||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
|
||||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
|
||||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
|
||||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
|
||||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
|
||||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
|
||||||
<value type="int">0</value>
|
|
||||||
<value type="int">1</value>
|
|
||||||
<value type="int">2</value>
|
|
||||||
<value type="int">3</value>
|
|
||||||
<value type="int">4</value>
|
|
||||||
<value type="int">5</value>
|
|
||||||
<value type="int">6</value>
|
|
||||||
<value type="int">7</value>
|
|
||||||
<value type="int">8</value>
|
|
||||||
<value type="int">9</value>
|
|
||||||
<value type="int">10</value>
|
|
||||||
<value type="int">11</value>
|
|
||||||
<value type="int">12</value>
|
|
||||||
<value type="int">13</value>
|
|
||||||
<value type="int">14</value>
|
|
||||||
</valuelist>
|
|
||||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
|
||||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">MasterCtrl</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/Main/PicDev/Projets/MasterCtrl/Masterctrl/MasterCtrl.pro</value>
|
|
||||||
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">MasterCtrl.pro</value>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">D:/Main/PicDev/Projets/MasterCtrl/Masterctrl</value>
|
|
||||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
|
||||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
|
||||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
|
||||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
|
||||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
|
||||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
|
||||||
</valuemap>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
|
||||||
<value type="int">1</value>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
|
||||||
<value type="int">18</value>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>Version</variable>
|
|
||||||
<value type="int">18</value>
|
|
||||||
</data>
|
|
||||||
</qtcreator>
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
#include "AVReceiverDevice.h"
|
#include "AVReceiverDevice.h"
|
||||||
#include "GlobalDefine.h"
|
#include "GlobalDefine.h"
|
||||||
#include "ProtocolDefs.h"
|
#include "ProtocolDefs.h"
|
||||||
#include <QDataStream>
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,7 +25,6 @@ CAVReceiverDevice::CAVReceiverDevice()
|
|||||||
mReceiverSocket = new QTcpSocket;
|
mReceiverSocket = new QTcpSocket;
|
||||||
mDisconnectTimer = new QTimer;
|
mDisconnectTimer = new QTimer;
|
||||||
mStateRequestTimer = new QTimer;
|
mStateRequestTimer = new QTimer;
|
||||||
// mSyncDelayTimer = new QTimer;
|
|
||||||
|
|
||||||
mDisconnectTimer->setSingleShot(true);
|
mDisconnectTimer->setSingleShot(true);
|
||||||
mDisconnectTimer->stop();
|
mDisconnectTimer->stop();
|
||||||
@ -34,9 +32,6 @@ CAVReceiverDevice::CAVReceiverDevice()
|
|||||||
mStateRequestTimer->setSingleShot(true);
|
mStateRequestTimer->setSingleShot(true);
|
||||||
mStateRequestTimer->setInterval(RECEIVER_STATE_UPDATE_TIMEOUT);
|
mStateRequestTimer->setInterval(RECEIVER_STATE_UPDATE_TIMEOUT);
|
||||||
|
|
||||||
// mSyncDelayTimer->setSingleShot(true);
|
|
||||||
// mSyncDelayTimer->setInterval(500);
|
|
||||||
|
|
||||||
|
|
||||||
connect(mDisconnectTimer,SIGNAL(timeout()),this,SLOT(DisconnectTimerExpired()));
|
connect(mDisconnectTimer,SIGNAL(timeout()),this,SLOT(DisconnectTimerExpired()));
|
||||||
|
|
||||||
@ -45,20 +40,16 @@ CAVReceiverDevice::CAVReceiverDevice()
|
|||||||
connect(mReceiverSocket,SIGNAL(readyRead()),this,SLOT(SocketRX()));
|
connect(mReceiverSocket,SIGNAL(readyRead()),this,SLOT(SocketRX()));
|
||||||
|
|
||||||
connect(mStateRequestTimer,SIGNAL(timeout()),this,SLOT(StateRequestTimerExpired()));
|
connect(mStateRequestTimer,SIGNAL(timeout()),this,SLOT(StateRequestTimerExpired()));
|
||||||
|
|
||||||
// connect(mSyncDelayTimer,&QTimer::timeout,this,&CAVReceiverDevice::SyncTimerExpired);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CAVReceiverDevice::~CAVReceiverDevice()
|
CAVReceiverDevice::~CAVReceiverDevice()
|
||||||
{
|
{
|
||||||
mReceiverSocket->disconnectFromHost();
|
mReceiverSocket->disconnectFromHost();
|
||||||
mReceiverSocket->waitForDisconnected(100);
|
mReceiverSocket->waitForDisconnected();
|
||||||
|
|
||||||
delete mReceiverSocket;
|
delete mReceiverSocket;
|
||||||
delete mDisconnectTimer;
|
delete mDisconnectTimer;
|
||||||
delete mStateRequestTimer;
|
delete mStateRequestTimer;
|
||||||
// delete mSyncDelayTimer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAVReceiverDevice::Start()
|
int CAVReceiverDevice::Start()
|
||||||
@ -122,36 +113,27 @@ int CAVReceiverDevice::AnalyseRxData(QByteArray data)
|
|||||||
int CAVReceiverDevice::UpdateReceiverStateParam(QString SubUnit, QString Fcn, QString Param)
|
int CAVReceiverDevice::UpdateReceiverStateParam(QString SubUnit, QString Fcn, QString Param)
|
||||||
{
|
{
|
||||||
static bool AllValid = false;
|
static bool AllValid = false;
|
||||||
CAvReceiverMainStatus *UnitStatus = 0;
|
|
||||||
if(SubUnit == "MAIN")
|
|
||||||
{
|
|
||||||
UnitStatus = &mReceiverStatus;
|
|
||||||
}
|
|
||||||
else if(SubUnit == "ZONE2")
|
|
||||||
{
|
|
||||||
UnitStatus = &mZone2Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(UnitStatus != 0)
|
if(SubUnit == "MAIN")
|
||||||
{
|
{
|
||||||
if(Fcn == "PWR")
|
if(Fcn == "PWR")
|
||||||
{
|
{
|
||||||
if(Param == "On")
|
if(Param == "On")
|
||||||
{
|
{
|
||||||
UnitStatus->mMainPwrStatus = true;
|
mReceiverStatus.mMainPwrStatus = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
UnitStatus->mMainPwrStatus = false;
|
mReceiverStatus.mMainPwrStatus = false;
|
||||||
}
|
}
|
||||||
if(Fcn == "SLEEP")
|
if(Fcn == "SLEEP")
|
||||||
{
|
{
|
||||||
if(Param == "On")
|
if(Param == "On")
|
||||||
{
|
{
|
||||||
UnitStatus->mMainSleepStatus = true;
|
mReceiverStatus.mMainSleepStatus = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnitStatus->mMainSleepStatus = false;
|
mReceiverStatus.mMainSleepStatus = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(Fcn == "VOL")
|
else if(Fcn == "VOL")
|
||||||
@ -160,31 +142,53 @@ int CAVReceiverDevice::UpdateReceiverStateParam(QString SubUnit, QString Fcn, QS
|
|||||||
float Vol = Param.toFloat(&OK);
|
float Vol = Param.toFloat(&OK);
|
||||||
if(OK)
|
if(OK)
|
||||||
{
|
{
|
||||||
UnitStatus->mMainVolume = Vol;
|
mReceiverStatus.mMainVolume = Vol;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnitStatus->mMainPwrStatus = 0xDEADBEEF;
|
mReceiverStatus.mMainPwrStatus = 0xDEADBEEF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(Fcn == "MUTE")
|
else if(Fcn == "MUTE")
|
||||||
{
|
{
|
||||||
if(Param == "On")
|
if(Param == "On")
|
||||||
{
|
{
|
||||||
UnitStatus->mIsMute = true;
|
mReceiverStatus.mIsMute = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnitStatus->mIsMute = false;
|
mReceiverStatus.mIsMute = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Fcn == "INP")
|
else if (Fcn == "INP")
|
||||||
{
|
{
|
||||||
UnitStatus->mInput = Param;
|
mReceiverStatus.mInput = Param;
|
||||||
}
|
}
|
||||||
else if (Fcn == "SOUNDPRG")
|
else if (Fcn == "SOUNDPRG")
|
||||||
{
|
{
|
||||||
UnitStatus->mProgram = Param;
|
mReceiverStatus.mProgram = Param;
|
||||||
|
}
|
||||||
|
else if(Fcn == "SPEAKERA")
|
||||||
|
{
|
||||||
|
if(Param == "On")
|
||||||
|
{
|
||||||
|
mReceiverStatus.mSpeakerAState = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mReceiverStatus.mSpeakerAState = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(Fcn == "SPEAKERB")
|
||||||
|
{
|
||||||
|
if(Param == "On")
|
||||||
|
{
|
||||||
|
mReceiverStatus.mSpeakerBState = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mReceiverStatus.mSpeakerBState = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
@ -193,10 +197,9 @@ int CAVReceiverDevice::UpdateReceiverStateParam(QString SubUnit, QString Fcn, QS
|
|||||||
int CAVReceiverDevice::SendReceiverCommand(QString Command)
|
int CAVReceiverDevice::SendReceiverCommand(QString Command)
|
||||||
{
|
{
|
||||||
//Make sure the escape sequence is correct.
|
//Make sure the escape sequence is correct.
|
||||||
// Command.remove("\r");
|
Command.remove("\r");
|
||||||
// Command.remove("\n");
|
Command.remove("\n");
|
||||||
// Command.append("\r\n");
|
Command.append("\r\n");
|
||||||
|
|
||||||
|
|
||||||
if(mReceiverSocket->state() == QAbstractSocket::ConnectedState)
|
if(mReceiverSocket->state() == QAbstractSocket::ConnectedState)
|
||||||
{
|
{
|
||||||
@ -262,7 +265,7 @@ void CAVReceiverDevice::StateRequestTimerExpired()
|
|||||||
{
|
{
|
||||||
if(mReceiverSocket->state() != QAbstractSocket::ConnectedState)
|
if(mReceiverSocket->state() != QAbstractSocket::ConnectedState)
|
||||||
{
|
{
|
||||||
SendReceiverCommand("@MAIN:BASIC=?\r\n@ZONE2:BASIC=?\r\n");
|
SendReceiverCommand("@MAIN:BASIC=?");
|
||||||
mStateRequestTimer->start(RECEIVER_STATE_UPDATE_TIMEOUT);
|
mStateRequestTimer->start(RECEIVER_STATE_UPDATE_TIMEOUT);
|
||||||
DisconnectReceiverDelayed(1000);
|
DisconnectReceiverDelayed(1000);
|
||||||
}
|
}
|
||||||
@ -275,31 +278,30 @@ void CAVReceiverDevice::StateRequestTimerExpired()
|
|||||||
|
|
||||||
////// Network Interface Implementation
|
////// Network Interface Implementation
|
||||||
|
|
||||||
int CAVReceiverDevice::SetZone2(bool OnOff)
|
int CAVReceiverDevice::SetSpeakerB(bool OnOff)
|
||||||
{
|
{
|
||||||
QString Cmd = "@ZONE2:PWR=";
|
QString Cmd = "@MAIN:SPEAKERB=";
|
||||||
if(OnOff)
|
if(OnOff)
|
||||||
{
|
{
|
||||||
Cmd += "On\r\n";
|
Cmd += "On";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Cmd += "Standby\r\n";
|
Cmd += "Off";
|
||||||
|
|
||||||
SendReceiverCommand(Cmd);
|
SendReceiverCommand(Cmd);
|
||||||
|
|
||||||
DisconnectReceiverDelayed();
|
DisconnectReceiverDelayed();
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAVReceiverDevice::SetMainZone(bool OnOff)
|
int CAVReceiverDevice::SetSpeakerA(bool OnOff)
|
||||||
{
|
{
|
||||||
QString Cmd = "@MAIN:PWR=";
|
QString Cmd = "@MAIN:SPEAKERA=";
|
||||||
if(OnOff)
|
if(OnOff)
|
||||||
{
|
{
|
||||||
Cmd += "On\r\n";
|
Cmd += "On";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Cmd += "Standby\r\n";
|
Cmd += "Off";
|
||||||
|
|
||||||
SendReceiverCommand(Cmd);
|
SendReceiverCommand(Cmd);
|
||||||
DisconnectReceiverDelayed();
|
DisconnectReceiverDelayed();
|
||||||
@ -313,22 +315,22 @@ int CAVReceiverDevice::SetSpeakers(int SpeakerA, int SpeakerB)
|
|||||||
QString Cmd = "@MAIN:SPEAKERA=";
|
QString Cmd = "@MAIN:SPEAKERA=";
|
||||||
if(SpeakerA == RECEIVER_SET_SPK_ON)
|
if(SpeakerA == RECEIVER_SET_SPK_ON)
|
||||||
{
|
{
|
||||||
Cmd += "On\r\n";
|
Cmd += "On";
|
||||||
}
|
}
|
||||||
else if(SpeakerA == RECEIVER_SET_SPK_OFF)
|
else if(SpeakerA == RECEIVER_SET_SPK_OFF)
|
||||||
{
|
{
|
||||||
Cmd += "Off\r\n";
|
Cmd += "Off";
|
||||||
}
|
}
|
||||||
else if(SpeakerA == RECEVIVER_TOGGLE_SPK)
|
else if(SpeakerA == RECEVIVER_TOGGLE_SPK)
|
||||||
{
|
{
|
||||||
// if(mReceiverStatus.mSpeakerAState == true)
|
if(mReceiverStatus.mSpeakerAState == true)
|
||||||
// {
|
{
|
||||||
// Cmd += "Off";
|
Cmd += "Off";
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// Cmd += "On";
|
Cmd += "On";
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -352,14 +354,14 @@ int CAVReceiverDevice::SetSpeakers(int SpeakerA, int SpeakerB)
|
|||||||
}
|
}
|
||||||
else if(SpeakerB == RECEVIVER_TOGGLE_SPK)
|
else if(SpeakerB == RECEVIVER_TOGGLE_SPK)
|
||||||
{
|
{
|
||||||
// if(mReceiverStatus.mSpeakerAState == true)
|
if(mReceiverStatus.mSpeakerAState == true)
|
||||||
// {
|
{
|
||||||
// Cmd += "Off";
|
Cmd += "Off";
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// Cmd += "On";
|
Cmd += "On";
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -380,93 +382,3 @@ int CAVReceiverDevice::SendRawCommand(QString Cmd)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray CAVReceiverDevice::GetReceiverStatus()
|
|
||||||
{
|
|
||||||
QByteArray StatusArray;
|
|
||||||
QDataStream Strm(&StatusArray,QIODevice::WriteOnly | QIODevice::Unbuffered);
|
|
||||||
Strm.device()->seek(0);
|
|
||||||
|
|
||||||
Strm << mReceiverStatus
|
|
||||||
<< mZone2Status ;
|
|
||||||
|
|
||||||
if(mReceiverStatus.mSyncZonesVolumes == true &&
|
|
||||||
( (mReceiverStatus.mMainVolume != mLastMainZoneVolume) ||
|
|
||||||
(mReceiverStatus.mMainVolume != mZone2Status.mMainVolume)))
|
|
||||||
{
|
|
||||||
SetZone2Volume(mReceiverStatus.mMainVolume);
|
|
||||||
}
|
|
||||||
|
|
||||||
mLastMainZoneVolume = mReceiverStatus.mMainVolume;
|
|
||||||
return StatusArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CAVReceiverDevice::SelectScene(char Zone, char Scene)
|
|
||||||
{
|
|
||||||
QString Cmd;
|
|
||||||
if(Zone == AV_RECEIVER_MAIN_ZONE)
|
|
||||||
{
|
|
||||||
Cmd = QString("@MAIN:SCENE=Scene %1\r\n").arg((int)Scene,1);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(Zone == AV_RECEIVER_ZONE_2)
|
|
||||||
{
|
|
||||||
Cmd = QString("@ZONE2:SCENE=Scene %1\r\n").arg((int)Scene,1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return RET_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
SendReceiverCommand(Cmd);
|
|
||||||
DisconnectReceiverDelayed(2000);
|
|
||||||
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CAVReceiverDevice::SetMainVolume(float Volume)
|
|
||||||
{
|
|
||||||
QString Cmd;
|
|
||||||
Cmd = QString("@MAIN:VOL=%1\r\n").arg(Volume,1,'f',1);
|
|
||||||
|
|
||||||
// qDebug("%s",qPrintable(Cmd));
|
|
||||||
|
|
||||||
SendReceiverCommand(Cmd);
|
|
||||||
// DisconnectReceiverDelayed();
|
|
||||||
|
|
||||||
if(mReceiverStatus.mSyncZonesVolumes == true)
|
|
||||||
{
|
|
||||||
SetZone2Volume(Volume);
|
|
||||||
}
|
|
||||||
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CAVReceiverDevice::SetZone2Volume(float Volume)
|
|
||||||
{
|
|
||||||
QString Cmd;
|
|
||||||
Cmd = QString("@ZONE2:VOL=%1\r\n").arg(Volume,1,'f',1);
|
|
||||||
|
|
||||||
SendReceiverCommand(Cmd);
|
|
||||||
// DisconnectReceiverDelayed();
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CAVReceiverDevice::SetZone2Input(QString InputString)
|
|
||||||
{
|
|
||||||
QString Cmd;
|
|
||||||
Cmd = QString("@ZONE2:INP=%1\r\n").arg(InputString);
|
|
||||||
|
|
||||||
SendReceiverCommand(Cmd);
|
|
||||||
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CAVReceiverDevice::SetSyncZ2withZ1(bool Sync)
|
|
||||||
{
|
|
||||||
mReceiverStatus.mSyncZonesVolumes = Sync;
|
|
||||||
if(Sync == true)
|
|
||||||
{
|
|
||||||
SetZone2Volume(mReceiverStatus.mMainVolume);
|
|
||||||
}
|
|
||||||
// qDebug("Sync Z2 with Z1: %d",Sync);
|
|
||||||
}
|
|
||||||
|
|||||||
@ -48,20 +48,7 @@ enum eReceiverSubUnits
|
|||||||
IPODUSB
|
IPODUSB
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eReceiverZone2Inputs
|
class CAVReceiverDevice : QObject
|
||||||
{
|
|
||||||
AUDIO1,
|
|
||||||
AUDIO2,
|
|
||||||
AUDIO3,
|
|
||||||
AUDIO4,
|
|
||||||
AUDIO5,
|
|
||||||
PHONO,
|
|
||||||
TUNER,
|
|
||||||
SERVER,
|
|
||||||
MAIN_ZONE_SYNC
|
|
||||||
};
|
|
||||||
|
|
||||||
class CAVReceiverDevice :public QObject
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -80,27 +67,20 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//Network Interface Implementation
|
//Network Interface Implementation
|
||||||
int SetZone2(bool OnOff);
|
int SetSpeakerB(bool OnOff);
|
||||||
int SetMainZone(bool OnOff);
|
int SetSpeakerA(bool OnOff);
|
||||||
int SetSpeakers(int SpeakerA, int SpeakerB);
|
int SetSpeakers(int SpeakerA, int SpeakerB);
|
||||||
int SendRawCommand(QString Cmd);
|
int SendRawCommand(QString Cmd);
|
||||||
int SelectScene(char Zone, char Scene);
|
CAvReceiverMainStatus GetReceiverStatus(){return mReceiverStatus;}
|
||||||
int SetMainVolume(float Volume);
|
|
||||||
int SetZone2Volume(float Volume);
|
|
||||||
int SetZone2Input(QString InputString);
|
|
||||||
int SetSyncZ2withZ1(bool Sync);
|
|
||||||
QByteArray GetReceiverStatus();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTcpSocket *mReceiverSocket;
|
QTcpSocket *mReceiverSocket;
|
||||||
int AnalyseRxData(QByteArray data);
|
int AnalyseRxData(QByteArray data);
|
||||||
QTimer *mDisconnectTimer, *mStateRequestTimer, *mSyncDelayTimer;
|
QTimer *mDisconnectTimer, *mStateRequestTimer;
|
||||||
CAvReceiverMainStatus mReceiverStatus;
|
CAvReceiverMainStatus mReceiverStatus;
|
||||||
CAvReceiverMainStatus mZone2Status;
|
|
||||||
|
|
||||||
bool mIsConnected;
|
bool mIsConnected;
|
||||||
QString mPendingCommand;
|
QString mPendingCommand;
|
||||||
float mLastMainZoneVolume;
|
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@ -109,7 +89,6 @@ public slots:
|
|||||||
void SocketRX();
|
void SocketRX();
|
||||||
void DisconnectTimerExpired();
|
void DisconnectTimerExpired();
|
||||||
void StateRequestTimerExpired();
|
void StateRequestTimerExpired();
|
||||||
// void SyncTimerExpired();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AVRECEIVERDEVICE_H
|
#endif // AVRECEIVERDEVICE_H
|
||||||
|
|||||||
@ -5,7 +5,6 @@ CAvReceiverMainStatus::CAvReceiverMainStatus()
|
|||||||
{
|
{
|
||||||
mDataValid = false;
|
mDataValid = false;
|
||||||
mReceiverOnline = false;
|
mReceiverOnline = false;
|
||||||
mSyncZonesVolumes = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray CAvReceiverMainStatus::ToByteArray()
|
QByteArray CAvReceiverMainStatus::ToByteArray()
|
||||||
@ -21,10 +20,11 @@ QByteArray CAvReceiverMainStatus::ToByteArray()
|
|||||||
Strm << mIsMute;
|
Strm << mIsMute;
|
||||||
Strm << mInput;
|
Strm << mInput;
|
||||||
Strm << mProgram;
|
Strm << mProgram;
|
||||||
|
Strm << mSpeakerAState;
|
||||||
|
Strm << mSpeakerBState;
|
||||||
|
|
||||||
Strm << mDataValid;
|
Strm << mDataValid;
|
||||||
Strm << mReceiverOnline;
|
Strm << mReceiverOnline;
|
||||||
Strm << mSyncZonesVolumes;
|
|
||||||
|
|
||||||
return Output;
|
return Output;
|
||||||
|
|
||||||
@ -41,39 +41,12 @@ int CAvReceiverMainStatus::FromByteArray(QByteArray Data)
|
|||||||
Strm >> mIsMute;
|
Strm >> mIsMute;
|
||||||
Strm >> mInput;
|
Strm >> mInput;
|
||||||
Strm >> mProgram;
|
Strm >> mProgram;
|
||||||
|
Strm >> mSpeakerAState;
|
||||||
|
Strm >> mSpeakerBState;
|
||||||
|
|
||||||
Strm >> mDataValid;
|
Strm >> mDataValid;
|
||||||
Strm >> mReceiverOnline;
|
Strm >> mReceiverOnline;
|
||||||
Strm >> mSyncZonesVolumes;
|
|
||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
QDataStream &operator<<(QDataStream &out, const CAvReceiverMainStatus &source)
|
|
||||||
{
|
|
||||||
out << source.mMainPwrStatus
|
|
||||||
<< source.mMainSleepStatus
|
|
||||||
<< source.mMainVolume
|
|
||||||
<< source.mIsMute
|
|
||||||
<< source.mInput
|
|
||||||
<< source.mProgram
|
|
||||||
<< source.mDataValid
|
|
||||||
<< source.mReceiverOnline
|
|
||||||
<< source.mSyncZonesVolumes;
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDataStream &operator>>(QDataStream &in, CAvReceiverMainStatus &dest)
|
|
||||||
{
|
|
||||||
in >> dest.mMainPwrStatus
|
|
||||||
>> dest.mMainSleepStatus
|
|
||||||
>> dest.mMainVolume
|
|
||||||
>> dest.mIsMute
|
|
||||||
>> dest.mInput
|
|
||||||
>> dest.mProgram
|
|
||||||
>> dest.mDataValid
|
|
||||||
>> dest.mReceiverOnline
|
|
||||||
>> dest.mSyncZonesVolumes;
|
|
||||||
return in;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -3,13 +3,6 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include "GlobalDefine.h"
|
#include "GlobalDefine.h"
|
||||||
|
|
||||||
enum eAVReceiverZones
|
|
||||||
{
|
|
||||||
AV_RECEIVER_MAIN_ZONE = 1,
|
|
||||||
AV_RECEIVER_ZONE_2,
|
|
||||||
|
|
||||||
AV_RECEIVER_MAX_ZONE
|
|
||||||
};
|
|
||||||
|
|
||||||
class CAvReceiverMainStatus
|
class CAvReceiverMainStatus
|
||||||
{
|
{
|
||||||
@ -26,13 +19,12 @@ public:
|
|||||||
bool mIsMute;
|
bool mIsMute;
|
||||||
QString mInput;
|
QString mInput;
|
||||||
QString mProgram;
|
QString mProgram;
|
||||||
bool mSyncZonesVolumes;
|
bool mSpeakerAState;
|
||||||
|
bool mSpeakerBState;
|
||||||
|
|
||||||
bool mDataValid;
|
bool mDataValid;
|
||||||
bool mReceiverOnline;
|
bool mReceiverOnline;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QDataStream &operator<<(QDataStream &out, const CAvReceiverMainStatus &source);
|
|
||||||
QDataStream &operator>>(QDataStream &in, CAvReceiverMainStatus &dest);
|
|
||||||
|
|
||||||
#endif // AVRECEIVERDATA_H
|
#endif // AVRECEIVERDATA_H
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#include "AvReceiverInterface.h"
|
#include "AvReceiverInterface.h"
|
||||||
#include "ProtocolDefs.h"
|
#include "ProtocolDefs.h"
|
||||||
#include "AVReceiverDevice.h"
|
#include "AVReceiverDevice.h"
|
||||||
#include <QDataStream>
|
|
||||||
|
|
||||||
CAvReceiverInterface::CAvReceiverInterface(int Address, CAbstractNetworkCommIF *NetworkInterface , CAVReceiverDevice *DevicePtr):
|
CAvReceiverInterface::CAvReceiverInterface(int Address, CAbstractNetworkCommIF *NetworkInterface , CAVReceiverDevice *DevicePtr):
|
||||||
CNetworkDevice(ID_AVRECEIVER_INTERFACE,Address,NetworkInterface)
|
CNetworkDevice(ID_AVRECEIVER_INTERFACE,Address,NetworkInterface)
|
||||||
@ -24,7 +23,7 @@ int CAvReceiverInterface::NewDeviceFrameReceived(int DeviceID, int DeviceAddress
|
|||||||
}
|
}
|
||||||
case AV_RECEIVER_INTERFACE_GENERAL_STATUS_REQUEST:
|
case AV_RECEIVER_INTERFACE_GENERAL_STATUS_REQUEST:
|
||||||
{
|
{
|
||||||
QByteArray data = mAvReceiverDevice->GetReceiverStatus();
|
QByteArray data = mAvReceiverDevice->GetReceiverStatus().ToByteArray();
|
||||||
mNetworkInterfacePtr->SendNetworkMessage(ID_AVRECEIVER_INTERFACE,mDeviceAddress,AV_RECEIVER_INTERFACE_GENERAL_STATUS_RESPONSE,data.size(),&data);
|
mNetworkInterfacePtr->SendNetworkMessage(ID_AVRECEIVER_INTERFACE,mDeviceAddress,AV_RECEIVER_INTERFACE_GENERAL_STATUS_RESPONSE,data.size(),&data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -33,16 +32,16 @@ int CAvReceiverInterface::NewDeviceFrameReceived(int DeviceID, int DeviceAddress
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AV_RECEIVER_INTERFACE_SET_ZONE2_REQUEST:
|
case AV_RECEIVER_INTERFACE_SET_SPEAKERB_REQUEST:
|
||||||
{
|
{
|
||||||
bool SpkStatus = (bool)Data[0];
|
bool SpkStatus = (bool)Data[0];
|
||||||
mAvReceiverDevice->SetZone2(SpkStatus);
|
mAvReceiverDevice->SetSpeakerB(SpkStatus);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AV_RECEIVER_INTERFACE_SET_MAIN_ZONE_REQUEST:
|
case AV_RECEIVER_INTERFACE_SET_SPEAKERA_REQUEST:
|
||||||
{
|
{
|
||||||
bool SpkStatus = (bool)Data[0];
|
bool SpkStatus = (bool)Data[0];
|
||||||
mAvReceiverDevice->SetMainZone(SpkStatus);
|
mAvReceiverDevice->SetSpeakerA(SpkStatus);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -54,58 +53,12 @@ int CAvReceiverInterface::NewDeviceFrameReceived(int DeviceID, int DeviceAddress
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AV_RECEIVER_INTERFACE_SELECT_SCENE_REQUEST:
|
|
||||||
{
|
|
||||||
mAvReceiverDevice->SelectScene(Data[0],Data[1]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case AV_RECEIVER_INTERFACE_SET_MAIN_VOLUME_REQUEST:
|
|
||||||
{
|
|
||||||
float VolumeData;
|
|
||||||
QDataStream Strm(&Data,QIODevice::ReadOnly);
|
|
||||||
Strm >> VolumeData;
|
|
||||||
|
|
||||||
mAvReceiverDevice->SetMainVolume(VolumeData);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case AV_RECEIVER_INTERFACE_SET_ZONE2_VOLUME_REQUEST:
|
|
||||||
{
|
|
||||||
float VolumeData;
|
|
||||||
QDataStream Strm(&Data,QIODevice::ReadOnly);
|
|
||||||
Strm >> VolumeData;
|
|
||||||
|
|
||||||
mAvReceiverDevice->SetZone2Volume(VolumeData);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case AV_RECEIVER_INTERFACE_SET_ZONE2_INPUT_REQUEST:
|
|
||||||
{
|
|
||||||
QString Source;
|
|
||||||
QDataStream Strm(&Data,QIODevice::ReadOnly);
|
|
||||||
Strm >> Source;
|
|
||||||
|
|
||||||
mAvReceiverDevice->SetZone2Input(Source);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case AV_RECEIVER_INTERFACE_SET_SYNC_Z2_WITH_Z1_REQUEST:
|
|
||||||
{
|
|
||||||
bool Sync;
|
|
||||||
QDataStream Strm(&Data,QIODevice::ReadOnly);
|
|
||||||
Strm >> Sync;
|
|
||||||
|
|
||||||
mAvReceiverDevice->SetSyncZ2withZ1(Sync);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case AV_RECEIVER_INTERFACE_GENERAL_STATUS_RESPONSE:
|
case AV_RECEIVER_INTERFACE_GENERAL_STATUS_RESPONSE:
|
||||||
case AV_RECEIVER_INTERFACE_SET_MAIN_POWER_RESPONSE:
|
case AV_RECEIVER_INTERFACE_SET_MAIN_POWER_RESPONSE:
|
||||||
case AV_RECEIVER_INTERFACE_SET_ZONE2_RESPONSE:
|
case AV_RECEIVER_INTERFACE_SET_SPEAKERB_RESPONSE:
|
||||||
case AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_RESPONSE:
|
case AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_RESPONSE:
|
||||||
case AV_RECEIVER_INTERFACE_SET_SPEAKERS_RESPONSE:
|
case AV_RECEIVER_INTERFACE_SET_SPEAKERS_RESPONSE:
|
||||||
case AV_RECEIVER_INTERFACE_SET_MAIN_ZONE_RESPONSE:
|
case AV_RECEIVER_INTERFACE_SET_SPEAKERA_RESPONSE:
|
||||||
case AV_RECEIVER_INTERFACE_SELECT_SCENE_RESPONSE:
|
|
||||||
case AV_RECEIVER_INTERFACE_SET_MAIN_VOLUME_RESPONSE:
|
|
||||||
case AV_RECEIVER_INTERFACE_SET_ZONE2_VOLUME_RESPONSE:
|
|
||||||
case AV_RECEIVER_INTERFACE_SET_ZONE2_INPUT_RESPONSE:
|
|
||||||
case AV_RECEIVER_INTERFACE_SET_SYNC_Z2_WITH_Z1_RESPONSE:
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
qDebug("Received invalid msg from Sprinkler Interface");
|
qDebug("Received invalid msg from Sprinkler Interface");
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#include "ChaletInterface.h"
|
#include "ChaletInterface.h"
|
||||||
#include "ChaletDataLogger.h"
|
#include "ChaletDataLogger.h"
|
||||||
|
|
||||||
CChaletInterface::CChaletInterface(int Address, CAbstractNetworkCommIF *NetworkInterface, CChaletDevice *DevicePtr):
|
CChaletInterface::CChaletInterface(int Address, CAbstractNetworkCommIF *NetworkInterface, CChaletLoraDevice *DevicePtr):
|
||||||
CNetworkDevice(ID_CHALET_INTERFACE,Address,NetworkInterface)
|
CNetworkDevice(ID_CHALET_INTERFACE,Address,NetworkInterface)
|
||||||
{
|
{
|
||||||
mChaletLoraDevice = DevicePtr;
|
mChaletLoraDevice = DevicePtr;
|
||||||
@ -9,7 +9,6 @@ CChaletInterface::CChaletInterface(int Address, CAbstractNetworkCommIF *NetworkI
|
|||||||
|
|
||||||
connect(mChaletLoraDevice,SIGNAL(DeviceWifiStoredParamsReceived()),this,SLOT(DeviceWiFiDataReceived()));
|
connect(mChaletLoraDevice,SIGNAL(DeviceWifiStoredParamsReceived()),this,SLOT(DeviceWiFiDataReceived()));
|
||||||
connect(mChaletLoraDevice,SIGNAL(DeviceFirmwareVersionReceived()),this,SLOT(DeviceFirmwareVersionReceived()));
|
connect(mChaletLoraDevice,SIGNAL(DeviceFirmwareVersionReceived()),this,SLOT(DeviceFirmwareVersionReceived()));
|
||||||
connect(mChaletLoraDevice,SIGNAL(DeviceWifiStatusReceived(QByteArray)),this,SLOT(DeviceWifiStatusReceived(QByteArray)));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,11 +119,6 @@ int CChaletInterface::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, in
|
|||||||
// mChaletLoraDevice->ResetCommStats();
|
// mChaletLoraDevice->ResetCommStats();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CHALET_INTERFACE_GET_WIFI_STATUS_REQUEST:
|
|
||||||
{
|
|
||||||
mChaletLoraDevice->SendGetWifiStatusRequest();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case CHALET_INTERFACE_WIFI_GET_DEVICE_PARAMS_RESPONSE:
|
case CHALET_INTERFACE_WIFI_GET_DEVICE_PARAMS_RESPONSE:
|
||||||
case CHALET_INTERFACE_WIFI_SET_DEVICE_PARAMS_RESPONSE:
|
case CHALET_INTERFACE_WIFI_SET_DEVICE_PARAMS_RESPONSE:
|
||||||
case CHALET_INTERFACE_GET_DATA_LOG_RESPONSE:
|
case CHALET_INTERFACE_GET_DATA_LOG_RESPONSE:
|
||||||
@ -135,7 +129,6 @@ int CChaletInterface::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, in
|
|||||||
case CHALET_INTERFACE_BATTERY_VOLTAGE_RESPONSE:
|
case CHALET_INTERFACE_BATTERY_VOLTAGE_RESPONSE:
|
||||||
case CHALET_INTERFACE_WIFI_SET_STATE_RESPONSE:
|
case CHALET_INTERFACE_WIFI_SET_STATE_RESPONSE:
|
||||||
case CHALET_INTERFACE_CLEAR_COMMS_STATS_RESPONSE:
|
case CHALET_INTERFACE_CLEAR_COMMS_STATS_RESPONSE:
|
||||||
case CHALET_INTERFACE_GET_WIFI_STATUS_RESPONSE:
|
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -167,8 +160,3 @@ void CChaletInterface::DeviceFirmwareVersionReceived()
|
|||||||
QByteArray Data = mChaletLoraDevice->GetDeviceFirmwareVersion();
|
QByteArray Data = mChaletLoraDevice->GetDeviceFirmwareVersion();
|
||||||
mNetworkInterfacePtr->SendNetworkMessage(ID_CHALET_INTERFACE,mDeviceAddress,CHALET_INTERFACE_GET_FIRMWARE_VERSION_RESPONSE,Data.size(),&Data);
|
mNetworkInterfacePtr->SendNetworkMessage(ID_CHALET_INTERFACE,mDeviceAddress,CHALET_INTERFACE_GET_FIRMWARE_VERSION_RESPONSE,Data.size(),&Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChaletInterface::DeviceWifiStatusReceived(QByteArray Data)
|
|
||||||
{
|
|
||||||
mNetworkInterfacePtr->SendNetworkMessage(ID_CHALET_INTERFACE,mDeviceAddress,CHALET_INTERFACE_GET_WIFI_STATUS_RESPONSE,Data.size(),&Data);
|
|
||||||
}
|
|
||||||
|
|||||||
@ -3,25 +3,24 @@
|
|||||||
|
|
||||||
#include "NetworkDevice.h"
|
#include "NetworkDevice.h"
|
||||||
|
|
||||||
#include "ChaletDevice.h"
|
#include "ChaletLoraDevice.h"
|
||||||
|
|
||||||
class CChaletInterface: public QObject, public CNetworkDevice
|
class CChaletInterface: public QObject, public CNetworkDevice
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CChaletInterface(int Address, CAbstractNetworkCommIF *NetworkInterface, CChaletDevice *DevicePtr);
|
CChaletInterface(int Address, CAbstractNetworkCommIF *NetworkInterface, CChaletLoraDevice *DevicePtr);
|
||||||
virtual int NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
virtual int NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
||||||
|
|
||||||
void SendChaletCommActivityBeacon();
|
void SendChaletCommActivityBeacon();
|
||||||
private:
|
private:
|
||||||
CChaletDevice *mChaletLoraDevice;
|
CChaletLoraDevice *mChaletLoraDevice;
|
||||||
CChaletDataLogger *mChaletDataLogger;
|
CChaletDataLogger *mChaletDataLogger;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void DeviceWiFiDataReceived();
|
void DeviceWiFiDataReceived();
|
||||||
void DeviceFirmwareVersionReceived();
|
void DeviceFirmwareVersionReceived();
|
||||||
void DeviceWifiStatusReceived(QByteArray Data);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
#include "ChaletDevice.h"
|
#include "ChaletLoraDevice.h"
|
||||||
#include "GlobalDefine.h"
|
#include "GlobalDefine.h"
|
||||||
|
|
||||||
|
|
||||||
CChaletDevice::CChaletDevice(int Address, CAbstractNetworkCommIF *NetworkInterface):
|
CChaletLoraDevice::CChaletLoraDevice(int Address, CAbstractNetworkCommIF *NetworkInterface):
|
||||||
CNetworkDevice(ID_CHALET_DEVICE,Address,NetworkInterface)
|
CNetworkDevice(ID_CHALET_DEVICE,Address,NetworkInterface)
|
||||||
{
|
{
|
||||||
NetworkInterface->mDevicePtr = this;
|
NetworkInterface->mDevicePtr = this;
|
||||||
@ -27,12 +27,12 @@ CChaletDevice::CChaletDevice(int Address, CAbstractNetworkCommIF *NetworkInterfa
|
|||||||
ResetCommStats();
|
ResetCommStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
CChaletDevice::~CChaletDevice()
|
CChaletLoraDevice::~CChaletLoraDevice()
|
||||||
{
|
{
|
||||||
delete mChaletStatusTimer;
|
delete mChaletStatusTimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::Start()
|
int CChaletLoraDevice::Start()
|
||||||
{
|
{
|
||||||
ScheduleChaletStatusRequest();
|
ScheduleChaletStatusRequest();
|
||||||
mChaletStatusTimer->start(1000);
|
mChaletStatusTimer->start(1000);
|
||||||
@ -40,7 +40,7 @@ int CChaletDevice::Start()
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data)
|
int CChaletLoraDevice::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data)
|
||||||
{
|
{
|
||||||
Q_UNUSED(DeviceID)
|
Q_UNUSED(DeviceID)
|
||||||
Q_UNUSED(DeviceAddress)
|
Q_UNUSED(DeviceAddress)
|
||||||
@ -169,8 +169,8 @@ int CChaletDevice::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int M
|
|||||||
}
|
}
|
||||||
case CHALET_WIFI_STATUS_RESPONSE:
|
case CHALET_WIFI_STATUS_RESPONSE:
|
||||||
{
|
{
|
||||||
|
mChaletMainStatus.mWiFiModuleStatus = Data[0];
|
||||||
CmdResponseReceived(CHALET_WIFI_STATUS_REQUEST);
|
CmdResponseReceived(CHALET_WIFI_STATUS_REQUEST);
|
||||||
emit DeviceWifiStatusReceived(Data);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CHALET_WIFI_SET_STATE_RESPONSE:
|
case CHALET_WIFI_SET_STATE_RESPONSE:
|
||||||
@ -211,7 +211,7 @@ int CChaletDevice::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int M
|
|||||||
{
|
{
|
||||||
|
|
||||||
CmdResponseReceived(CHALET_GET_STORED_WIFI_SETTINGS_REQUEST);
|
CmdResponseReceived(CHALET_GET_STORED_WIFI_SETTINGS_REQUEST);
|
||||||
mDeviceWiFiParameters = Data.left(DataSize);
|
mDeviceWiFiParameters = Data.left(8);
|
||||||
emit DeviceWifiStoredParamsReceived();
|
emit DeviceWifiStoredParamsReceived();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -245,7 +245,7 @@ int CChaletDevice::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int M
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChaletDevice::CommTimerExpired()
|
void CChaletLoraDevice::CommTimerExpired()
|
||||||
{
|
{
|
||||||
if(mPendingNetworkMsgList.isEmpty())
|
if(mPendingNetworkMsgList.isEmpty())
|
||||||
{
|
{
|
||||||
@ -257,7 +257,7 @@ void CChaletDevice::CommTimerExpired()
|
|||||||
if(mPendingNetworkMsgList.first().PendingResponse == true)
|
if(mPendingNetworkMsgList.first().PendingResponse == true)
|
||||||
{
|
{
|
||||||
//The current command is still waiting for a response. Check how many times we tried to send it
|
//The current command is still waiting for a response. Check how many times we tried to send it
|
||||||
// qDebug("Cmd 0x%x timetout... retrying",mPendingNetworkMsgList.first().mMessageID);
|
qDebug("Cmd 0x%x timetout... retrying",mPendingNetworkMsgList.first().mMessageID);
|
||||||
if(mPendingNetworkMsgList.first().ResendCounter >= 2)
|
if(mPendingNetworkMsgList.first().ResendCounter >= 2)
|
||||||
{
|
{
|
||||||
//After 2 retries, declare module offline, clear the send buffer and start sending status requests...
|
//After 2 retries, declare module offline, clear the send buffer and start sending status requests...
|
||||||
@ -295,7 +295,7 @@ void CChaletDevice::CommTimerExpired()
|
|||||||
// SendChaletCommand(CHALET_GENERAL_STATUS_REQUEST,0,QByteArray());
|
// SendChaletCommand(CHALET_GENERAL_STATUS_REQUEST,0,QByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::SendWiFiModuleSetState(bool State)
|
int CChaletLoraDevice::SendWiFiModuleSetState(bool State)
|
||||||
{
|
{
|
||||||
QByteArray Data;
|
QByteArray Data;
|
||||||
Data.resize(1);
|
Data.resize(1);
|
||||||
@ -311,7 +311,7 @@ int CChaletDevice::SendWiFiModuleSetState(bool State)
|
|||||||
return ScheduleChaletCommand(CHALET_WIFI_SET_STATE_REQUEST,1,Data);
|
return ScheduleChaletCommand(CHALET_WIFI_SET_STATE_REQUEST,1,Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::SendInverterPowerRelayState(bool State)
|
int CChaletLoraDevice::SendInverterPowerRelayState(bool State)
|
||||||
{
|
{
|
||||||
QByteArray Data;
|
QByteArray Data;
|
||||||
Data.resize(1);
|
Data.resize(1);
|
||||||
@ -327,7 +327,7 @@ int CChaletDevice::SendInverterPowerRelayState(bool State)
|
|||||||
return ScheduleChaletCommand(CHALET_AC_POWER_SET_STATE_REQUEST,Data);
|
return ScheduleChaletCommand(CHALET_AC_POWER_SET_STATE_REQUEST,Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::SendDOHarakiri()
|
int CChaletLoraDevice::SendDOHarakiri()
|
||||||
{
|
{
|
||||||
QByteArray Data; //Magic word...
|
QByteArray Data; //Magic word...
|
||||||
Data.clear();
|
Data.clear();
|
||||||
@ -339,7 +339,7 @@ int CChaletDevice::SendDOHarakiri()
|
|||||||
return ScheduleChaletCommand(CHALET_DO_HARAKIRI_REQUEST,Data);
|
return ScheduleChaletCommand(CHALET_DO_HARAKIRI_REQUEST,Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::SendRebootCmd()
|
int CChaletLoraDevice::SendRebootCmd()
|
||||||
{
|
{
|
||||||
QByteArray Data; //Magic word...
|
QByteArray Data; //Magic word...
|
||||||
Data.clear();
|
Data.clear();
|
||||||
@ -350,38 +350,28 @@ int CChaletDevice::SendRebootCmd()
|
|||||||
|
|
||||||
return ScheduleChaletCommand(CHALET_REBOOT_CPU_REQUEST,Data);
|
return ScheduleChaletCommand(CHALET_REBOOT_CPU_REQUEST,Data);
|
||||||
}
|
}
|
||||||
int CChaletDevice::SendGetWifiParams()
|
int CChaletLoraDevice::SendGetWifiParams()
|
||||||
{
|
{
|
||||||
return ScheduleChaletCommand(CHALET_GET_STORED_WIFI_SETTINGS_REQUEST,QByteArray());
|
return ScheduleChaletCommand(CHALET_GET_STORED_WIFI_SETTINGS_REQUEST,QByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::SendSetWifiParams(QByteArray Data)
|
int CChaletLoraDevice::SendSetWifiParams(QByteArray Data)
|
||||||
{
|
{
|
||||||
return ScheduleChaletCommand(CHALET_SET_STORED_WIFI_SETTINGS_REQUEST,Data);
|
return ScheduleChaletCommand(CHALET_SET_STORED_WIFI_SETTINGS_REQUEST,Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::SendGetFirmwareVersion()
|
int CChaletLoraDevice::SendGetFirmwareVersion()
|
||||||
{
|
{
|
||||||
return ScheduleChaletCommand(CHALET_GET_FIRMWARE_VERSION_REQUEST,QByteArray());
|
return ScheduleChaletCommand(CHALET_GET_FIRMWARE_VERSION_REQUEST,QByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::SendClearCommStatsRequest()
|
int CChaletLoraDevice::SendClearCommStatsRequest()
|
||||||
{
|
{
|
||||||
return ScheduleChaletCommand(CHALET_CLEAR_COMMS_STATISTICS_REQUEST,QByteArray());
|
return ScheduleChaletCommand(CHALET_CLEAR_COMMS_STATISTICS_REQUEST,QByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::SendGetWifiStatusRequest()
|
int CChaletLoraDevice::SendChaletCommand(int CmdID, int DataSize, QByteArray Data)
|
||||||
{
|
{
|
||||||
return ScheduleChaletCommand(CHALET_WIFI_STATUS_REQUEST,QByteArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
int CChaletDevice::SendChaletCommand(int CmdID, int DataSize, QByteArray Data)
|
|
||||||
{
|
|
||||||
if(mNetworkInterfacePtr == 0)
|
|
||||||
{
|
|
||||||
return RET_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
mNetworkInterfacePtr->SendNetworkMessage(ID_CHALET_DEVICE,mDeviceAddress,CmdID,DataSize,&Data);
|
mNetworkInterfacePtr->SendNetworkMessage(ID_CHALET_DEVICE,mDeviceAddress,CmdID,DataSize,&Data);
|
||||||
mTotalNbRequest++;
|
mTotalNbRequest++;
|
||||||
mChaletMainStatus.mTotalNbMasterTxCmds++;
|
mChaletMainStatus.mTotalNbMasterTxCmds++;
|
||||||
@ -389,7 +379,7 @@ int CChaletDevice::SendChaletCommand(int CmdID, int DataSize, QByteArray Data)
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::CmdResponseReceived(int CmdID)
|
int CChaletLoraDevice::CmdResponseReceived(int CmdID)
|
||||||
{
|
{
|
||||||
Q_UNUSED(CmdID)
|
Q_UNUSED(CmdID)
|
||||||
|
|
||||||
@ -426,14 +416,12 @@ int CChaletDevice::CmdResponseReceived(int CmdID)
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CChaletLoraDevice::ScheduleChaletStatusRequest()
|
||||||
|
|
||||||
int CChaletDevice::ScheduleChaletStatusRequest()
|
|
||||||
{
|
{
|
||||||
return ScheduleChaletCommand(CHALET_GENERAL_STATUS_REQUEST,0,QByteArray());
|
return ScheduleChaletCommand(CHALET_GENERAL_STATUS_REQUEST,0,QByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::ScheduleChaletCommand(int CmdID, int DataSize, QByteArray Data)
|
int CChaletLoraDevice::ScheduleChaletCommand(int CmdID, int DataSize, QByteArray Data)
|
||||||
{
|
{
|
||||||
Q_UNUSED(DataSize)
|
Q_UNUSED(DataSize)
|
||||||
|
|
||||||
@ -450,7 +438,7 @@ int CChaletDevice::ScheduleChaletCommand(int CmdID, int DataSize, QByteArray Dat
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::ScheduleChaletCommand(int CmdID, QByteArray Data)
|
int CChaletLoraDevice::ScheduleChaletCommand(int CmdID, QByteArray Data)
|
||||||
{
|
{
|
||||||
// if(mChaletMainStatus.mIsOnline == false)
|
// if(mChaletMainStatus.mIsOnline == false)
|
||||||
// {
|
// {
|
||||||
@ -476,7 +464,7 @@ int CChaletDevice::ScheduleChaletCommand(int CmdID, QByteArray Data)
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::ResetCommStats()
|
int CChaletLoraDevice::ResetCommStats()
|
||||||
{
|
{
|
||||||
mLostRequestPercentage = 0.0;
|
mLostRequestPercentage = 0.0;
|
||||||
mTotalNbRequest = 0;
|
mTotalNbRequest = 0;
|
||||||
@ -487,7 +475,7 @@ int CChaletDevice::ResetCommStats()
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CChaletDevice::ComputeCommStats()
|
int CChaletLoraDevice::ComputeCommStats()
|
||||||
{
|
{
|
||||||
mLostRequestPercentage = ((float)mNbLostRequest/(float)mTotalNbRequest)*100;
|
mLostRequestPercentage = ((float)mNbLostRequest/(float)mTotalNbRequest)*100;
|
||||||
mChaletMainStatus.mLostRequestPercentage = mLostRequestPercentage;
|
mChaletMainStatus.mLostRequestPercentage = mLostRequestPercentage;
|
||||||
@ -1,9 +1,9 @@
|
|||||||
#ifndef CCHALETDEVICE_H
|
#ifndef CCHALETLORADEVICE_H
|
||||||
#define CCHALETDEVICE_H
|
#define CCHALETLORADEVICE_H
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSerialPort>
|
#include <QSerialPort>
|
||||||
#include "NetworkProtocol.h"
|
#include "LoraNetworkCommIF.h"
|
||||||
#include "NetworkDevice.h"
|
#include "NetworkDevice.h"
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "ChaletData.h"
|
#include "ChaletData.h"
|
||||||
@ -26,17 +26,16 @@
|
|||||||
#define LORA_CHALET_STATUS_POWER_RELAY_MASK 0x01
|
#define LORA_CHALET_STATUS_POWER_RELAY_MASK 0x01
|
||||||
#define LORA_CHALET_STATUS_CUR_SENSOR_MASK 0x02
|
#define LORA_CHALET_STATUS_CUR_SENSOR_MASK 0x02
|
||||||
|
|
||||||
class CChaletDevice : public QObject, public CNetworkDevice
|
class CChaletLoraDevice : public QObject, public CNetworkDevice
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CChaletDevice(int Address,CAbstractNetworkCommIF *NetworkInterface);
|
CChaletLoraDevice(int Address,CAbstractNetworkCommIF *NetworkInterface);
|
||||||
~CChaletDevice();
|
~CChaletLoraDevice();
|
||||||
|
|
||||||
virtual int NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
virtual int NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
||||||
|
|
||||||
QString mChaletName;
|
|
||||||
QTimer *mChaletStatusTimer;
|
QTimer *mChaletStatusTimer;
|
||||||
int Start();
|
int Start();
|
||||||
|
|
||||||
@ -74,7 +73,6 @@ public:
|
|||||||
int SendSetWifiParams(QByteArray Data);
|
int SendSetWifiParams(QByteArray Data);
|
||||||
int SendGetFirmwareVersion();
|
int SendGetFirmwareVersion();
|
||||||
int SendClearCommStatsRequest();
|
int SendClearCommStatsRequest();
|
||||||
int SendGetWifiStatusRequest();
|
|
||||||
|
|
||||||
int CmdResponseReceived(int CmdID);
|
int CmdResponseReceived(int CmdID);
|
||||||
int ScheduleChaletStatusRequest();
|
int ScheduleChaletStatusRequest();
|
||||||
@ -87,11 +85,10 @@ signals:
|
|||||||
void DeviceWifiStoredParamsReceived();
|
void DeviceWifiStoredParamsReceived();
|
||||||
void DeviceWifiSetParamsResult(char);
|
void DeviceWifiSetParamsResult(char);
|
||||||
void DeviceFirmwareVersionReceived();
|
void DeviceFirmwareVersionReceived();
|
||||||
void DeviceWifiStatusReceived(QByteArray);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void CommTimerExpired();
|
void CommTimerExpired();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CCHALETDEVICE_H
|
#endif // CCHALETLORADEVICE_H
|
||||||
@ -4,7 +4,7 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <ModbusBackend.h>
|
#include <ModbusBackend.h>
|
||||||
|
|
||||||
class CChaletDevice;
|
class CChaletLoraDevice;
|
||||||
|
|
||||||
class CChaletModbusServer : public CModbusBackend
|
class CChaletModbusServer : public CModbusBackend
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include "ChaletDevice.h"
|
#include "ChaletLoraDevice.h"
|
||||||
|
|
||||||
|
|
||||||
CThingsBoardInterface::CThingsBoardInterface()
|
CThingsBoardInterface::CThingsBoardInterface()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef THINGSBOARDINTERFACE_H
|
#ifndef THINGSBOARDINTERFACE_H
|
||||||
#define THINGSBOARDINTERFACE_H
|
#define THINGSBOARDINTERFACE_H
|
||||||
|
|
||||||
class CChaletDevice;
|
class CChaletLoraDevice;
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
@ -14,7 +14,7 @@ public:
|
|||||||
CThingsBoardInterface();
|
CThingsBoardInterface();
|
||||||
~CThingsBoardInterface();
|
~CThingsBoardInterface();
|
||||||
|
|
||||||
CChaletDevice *mChaletLoraDevice;
|
CChaletLoraDevice *mChaletLoraDevice;
|
||||||
|
|
||||||
int RegisterThingsboardRPC();
|
int RegisterThingsboardRPC();
|
||||||
void UpdateChaletVoltage(float Voltage);
|
void UpdateChaletVoltage(float Voltage);
|
||||||
|
|||||||
@ -24,8 +24,6 @@ int CEthernetNetworkCommIF::SendNetworkMessage(int DeviceID, int DeviceAddress,
|
|||||||
// Q_UNUSED(MessageID)
|
// Q_UNUSED(MessageID)
|
||||||
// Q_UNUSED(DataSize)
|
// Q_UNUSED(DataSize)
|
||||||
// Q_UNUSED(Data)
|
// Q_UNUSED(Data)
|
||||||
if(mTCPSocket == 0)
|
|
||||||
return RET_ERROR;
|
|
||||||
|
|
||||||
QByteArray Packet;
|
QByteArray Packet;
|
||||||
if(Data != 0)
|
if(Data != 0)
|
||||||
@ -36,7 +34,6 @@ int CEthernetNetworkCommIF::SendNetworkMessage(int DeviceID, int DeviceAddress,
|
|||||||
{
|
{
|
||||||
Packet = GetTxPacket(MessageID,0,0,0,DeviceAddress,DeviceID);
|
Packet = GetTxPacket(MessageID,0,0,0,DeviceAddress,DeviceID);
|
||||||
}
|
}
|
||||||
|
|
||||||
mTCPSocket->write(Packet);
|
mTCPSocket->write(Packet);
|
||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
|||||||
@ -208,34 +208,6 @@ void CEthernetNetworkServer::DeviceSocketDataAvail()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ID_LORA_INTERFACE_INTERFACE:
|
|
||||||
{
|
|
||||||
if(mDevicesMgrHandle->CreateNewLoraInterfaceInterface(DeviceAddress,(CAbstractNetworkCommIF*)NetworkIF) == RET_OK)
|
|
||||||
{
|
|
||||||
Result = RES_CREATION_SUCCESS;
|
|
||||||
qDebug("Created new Lora Interface Interface in ethernet server");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Result = RES_CREATION_FAILED;
|
|
||||||
qDebug("Could not create Lora Interface Interface in ethernet server");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ID_CHALET_DEVICE:
|
|
||||||
{
|
|
||||||
if(mDevicesMgrHandle->BindNetworkChaletDevice(DeviceAddress,(CAbstractNetworkCommIF*)NetworkIF) == RET_OK)
|
|
||||||
{
|
|
||||||
Result = RES_CREATION_SUCCESS;
|
|
||||||
qDebug("Created new Ethernet (LTE) Chalet Device in ethernet server");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Result = RES_CREATION_FAILED;
|
|
||||||
qDebug("Could not create Ethernet (LTE) Chalet Device in ethernet server");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Result = RES_CREATION_UNKNOWN_DEVICE;
|
Result = RES_CREATION_UNKNOWN_DEVICE;
|
||||||
@ -370,7 +342,7 @@ void CEthernetNetworkServer::DeviceSocketDataAvail()
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROTOCOL_RET_ERROR_BAD_HEADER:
|
case PROTOCOL_RET_OK_BAD_HEADER:
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,46 +0,0 @@
|
|||||||
#include "LoraSettingsGui.h"
|
|
||||||
#include "ui_LoraSettingsGui.h"
|
|
||||||
#include "ProgramSettings.h"
|
|
||||||
|
|
||||||
CLoraSettingsGui::CLoraSettingsGui(QWidget *parent) :
|
|
||||||
QWidget(parent),
|
|
||||||
ui(new Ui::CLoraSettingsGui)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
CLoraSettingsGui::~CLoraSettingsGui()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
CLoraSettingsGui::SetSettings(CSettings *settings)
|
|
||||||
{
|
|
||||||
ui->mLoraAddressSpinBx->setValue(settings->mChaletLoraAddress);
|
|
||||||
ui->mLoraChannelSpinBx->setValue(settings->mChaletLoraChannel);
|
|
||||||
ui->mComportComboBox->setCurrentText(settings->mChaletComPort);
|
|
||||||
ui->mUseLoraIFCheckBx->setChecked(settings->mChaletUseLoraIF);
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
quint16 CLoraSettingsGui::GetChaletLoraAddress()
|
|
||||||
{
|
|
||||||
quint16 Add = ui->mLoraAddressSpinBx->value();
|
|
||||||
return Add;
|
|
||||||
}
|
|
||||||
|
|
||||||
quint8 CLoraSettingsGui::GetChaletLoraChannel()
|
|
||||||
{
|
|
||||||
quint16 Chan = ui->mLoraChannelSpinBx->value();
|
|
||||||
return Chan;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CLoraSettingsGui::GetChaletLoraComPort()
|
|
||||||
{
|
|
||||||
return ui->mComportComboBox->currentText();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CLoraSettingsGui::GetChaletUseLoraIF()
|
|
||||||
{
|
|
||||||
return ui->mUseLoraIFCheckBx->isChecked();
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
#ifndef LORASETTINGSGUI_H
|
|
||||||
#define LORASETTINGSGUI_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
class CSettings;
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class CLoraSettingsGui;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CLoraSettingsGui : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit CLoraSettingsGui(QWidget *parent = 0);
|
|
||||||
~CLoraSettingsGui();
|
|
||||||
int SetSettings(CSettings* settings);
|
|
||||||
QString GetChaletLoraComPort();
|
|
||||||
quint8 GetChaletLoraChannel();
|
|
||||||
quint16 GetChaletLoraAddress();
|
|
||||||
bool GetChaletUseLoraIF();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::CLoraSettingsGui *ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LORASETTINGSGUI_H
|
|
||||||
@ -1,240 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>CLoraSettingsGui</class>
|
|
||||||
<widget class="QWidget" name="CLoraSettingsGui">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>553</width>
|
|
||||||
<height>413</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>100</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>151</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Chalet Settings</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QGroupBox" name="groupBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>110</x>
|
|
||||||
<y>170</y>
|
|
||||||
<width>221</width>
|
|
||||||
<height>191</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>LoRa</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Lora Address:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Lora Channel:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QSpinBox" name="mLoraAddressSpinBx">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>90</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>65535</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QComboBox" name="mComportComboBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>80</x>
|
|
||||||
<y>80</y>
|
|
||||||
<width>69</width>
|
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM1</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM2</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM3</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM4</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM5</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM6</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM7</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM8</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM9</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>COM10</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>80</y>
|
|
||||||
<width>51</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Com Port:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>110</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>31</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Chalet = 7
|
|
||||||
Chaloupe = 8</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCheckBox" name="mUseLoraIFCheckBx">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>160</y>
|
|
||||||
<width>191</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Use LoraInterface (restart needed)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QSpinBox" name="mLoraChannelSpinBx">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>90</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>65535</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>200</x>
|
|
||||||
<y>30</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>4</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCheckBox" name="checkBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>70</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>281</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Use LTE interface (restart needed)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@ -14,13 +14,10 @@ CSettingsWindow::CSettingsWindow()
|
|||||||
QVBoxLayout *MainLayout = new QVBoxLayout;
|
QVBoxLayout *MainLayout = new QVBoxLayout;
|
||||||
QWidget *mPagesContainer = new QWidget(this);
|
QWidget *mPagesContainer = new QWidget(this);
|
||||||
|
|
||||||
mLoraSettingsPage = new CLoraSettingsGui(mPagesContainer);
|
|
||||||
|
|
||||||
mOptionsTabBar = new QTabBar();
|
mOptionsTabBar = new QTabBar();
|
||||||
mOptionsTabBar->addTab("SMS");
|
mOptionsTabBar->addTab("SMS");
|
||||||
mOptionsTabBar->addTab("Network");
|
mOptionsTabBar->addTab("Network");
|
||||||
mOptionsTabBar->addTab("Contacts");
|
mOptionsTabBar->addTab("Contacts");
|
||||||
mOptionsTabBar->addTab("Chalet");
|
|
||||||
mOptionsTabBar->resize(this->geometry().width(),mOptionsTabBar->height());
|
mOptionsTabBar->resize(this->geometry().width(),mOptionsTabBar->height());
|
||||||
MainLayout->addWidget(mOptionsTabBar);
|
MainLayout->addWidget(mOptionsTabBar);
|
||||||
|
|
||||||
@ -163,22 +160,14 @@ void CSettingsWindow::TabBarClicked(int TabIndex)
|
|||||||
{
|
{
|
||||||
mSMSPage->hide();
|
mSMSPage->hide();
|
||||||
mContactsPage->hide();
|
mContactsPage->hide();
|
||||||
mLoraSettingsPage->hide();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(TabIndex == 2)//Contacts
|
else if(TabIndex == 2)//Contacts
|
||||||
{
|
{
|
||||||
mSMSPage->hide();
|
mSMSPage->hide();
|
||||||
mLoraSettingsPage->hide();
|
|
||||||
mContactsPage->show();
|
mContactsPage->show();
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(TabIndex == 3) //Lora
|
|
||||||
{
|
|
||||||
mSMSPage->hide();
|
|
||||||
mContactsPage->hide();
|
|
||||||
mLoraSettingsPage->show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettingsWindow::RetreiveDIDButtonClicked(bool checked)
|
void CSettingsWindow::RetreiveDIDButtonClicked(bool checked)
|
||||||
@ -218,8 +207,6 @@ unsigned int CSettingsWindow::SetSettingsData(CSettings *SettingsData)
|
|||||||
mDIDSelectionDropList->clear();
|
mDIDSelectionDropList->clear();
|
||||||
mDIDSelectionDropList->addItem(SettingsData->mVoipMSSettings.mDefaultDID);
|
mDIDSelectionDropList->addItem(SettingsData->mVoipMSSettings.mDefaultDID);
|
||||||
mVoipMSCalendar->setSelectedDate(SettingsData->mVoipMSSettings.mStartDate);
|
mVoipMSCalendar->setSelectedDate(SettingsData->mVoipMSSettings.mStartDate);
|
||||||
mLoraSettingsPage->SetSettings(SettingsData);
|
|
||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,10 +219,6 @@ void CSettingsWindow::DoneButtonClicked(bool checked)
|
|||||||
Settings->mVoipMSSettings.mPassword = mVoipMSPassword->text();
|
Settings->mVoipMSSettings.mPassword = mVoipMSPassword->text();
|
||||||
Settings->mVoipMSSettings.mStartDate = mVoipMSCalendar->selectedDate();
|
Settings->mVoipMSSettings.mStartDate = mVoipMSCalendar->selectedDate();
|
||||||
Settings->mVoipMSSettings.mUsername = mVoipMSUsername->text();
|
Settings->mVoipMSSettings.mUsername = mVoipMSUsername->text();
|
||||||
Settings->mChaletComPort = mLoraSettingsPage->GetChaletLoraComPort();
|
|
||||||
Settings->mChaletLoraAddress = mLoraSettingsPage->GetChaletLoraAddress();
|
|
||||||
Settings->mChaletLoraChannel = mLoraSettingsPage->GetChaletLoraChannel();
|
|
||||||
Settings->mChaletUseLoraIF = mLoraSettingsPage->GetChaletUseLoraIF();
|
|
||||||
|
|
||||||
mProgramHandle->SaveSettings(Settings);
|
mProgramHandle->SaveSettings(Settings);
|
||||||
mProgramHandle->SettingsWindowClosed();
|
mProgramHandle->SettingsWindowClosed();
|
||||||
|
|||||||
@ -11,7 +11,6 @@
|
|||||||
#include "ProgramSettings.h"
|
#include "ProgramSettings.h"
|
||||||
#include "QTableWidget"
|
#include "QTableWidget"
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include "LoraSettingsGui.h"
|
|
||||||
|
|
||||||
|
|
||||||
class CMasterCtrl;
|
class CMasterCtrl;
|
||||||
@ -29,7 +28,6 @@ public:
|
|||||||
QWidget *mSMSPage;
|
QWidget *mSMSPage;
|
||||||
QWidget *mContactsPage;
|
QWidget *mContactsPage;
|
||||||
QTabBar *mOptionsTabBar;
|
QTabBar *mOptionsTabBar;
|
||||||
CLoraSettingsGui *mLoraSettingsPage;
|
|
||||||
|
|
||||||
//SMS Page
|
//SMS Page
|
||||||
QLineEdit *mVoipMSUsername;
|
QLineEdit *mVoipMSUsername;
|
||||||
|
|||||||
@ -6,79 +6,11 @@ CHttpServer::CHttpServer()
|
|||||||
mHttpServer = new QHttpServer;
|
mHttpServer = new QHttpServer;
|
||||||
mHttpServer->route("/", []()
|
mHttpServer->route("/", []()
|
||||||
{
|
{
|
||||||
|
qDebug("Test");
|
||||||
|
|
||||||
|
return "Ja Mon CB!!!!";
|
||||||
// return " <!DOCTYPE html>\
|
|
||||||
// <html>\
|
|
||||||
// <head>\
|
|
||||||
// <title>Page Title</title>\
|
|
||||||
// </head>\
|
|
||||||
// <body>\
|
|
||||||
// \
|
|
||||||
// <h1>This is a Heading</h1>\
|
|
||||||
// <p>This is a paragraph.</p>\
|
|
||||||
// \
|
|
||||||
// </body>\
|
|
||||||
// </html>";
|
|
||||||
|
|
||||||
// return " <!DOCTYPE html>\
|
|
||||||
// <html>\
|
|
||||||
// <body>\
|
|
||||||
// \
|
|
||||||
// <h1>My First JavaScript</h1>\
|
|
||||||
// \
|
|
||||||
// <button type=\"button\" \
|
|
||||||
// onclick=\"document.getElementById('demo').innerHTML = Date()\">\
|
|
||||||
// Click me to display Date and Time.</button>\
|
|
||||||
// \
|
|
||||||
// <p id=\"demo\"></p>\
|
|
||||||
// \
|
|
||||||
// </body>\
|
|
||||||
// </html> ";
|
|
||||||
|
|
||||||
|
|
||||||
return "<!DOCTYPE html>\
|
|
||||||
<html>\
|
|
||||||
<body>\
|
|
||||||
\
|
|
||||||
<h2>SVG rect Element</h2>\
|
|
||||||
\
|
|
||||||
<svg width=\"300\" height=\"130\">\
|
|
||||||
<rect width=\"200\" height=\"100\" x=\"10\" y=\"10\" rx=\"20\" ry=\"20\" fill=\"blue\" />\
|
|
||||||
Sorry, your browser does not support inline SVG. \
|
|
||||||
</svg>\
|
|
||||||
\
|
|
||||||
</body>\
|
|
||||||
</html>";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mHttpServer->route("/test", []()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
return " <!DOCTYPE html>\
|
|
||||||
<html>\
|
|
||||||
<head>\
|
|
||||||
<title>Page Title</title>\
|
|
||||||
</head>\
|
|
||||||
<body>\
|
|
||||||
\
|
|
||||||
<h1>This is a Heading</h1>\
|
|
||||||
<p>This is a paragraph.</p>\
|
|
||||||
\
|
|
||||||
</body>\
|
|
||||||
</html>";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
const auto port = mHttpServer->listen(QHostAddress::Any,8080);
|
const auto port = mHttpServer->listen(QHostAddress::Any,8080);
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ CIspindelDevice::CIspindelDevice()
|
|||||||
{
|
{
|
||||||
mISpindelServer = new QTcpServer;
|
mISpindelServer = new QTcpServer;
|
||||||
connect(mISpindelServer,SIGNAL(newConnection()),this,SLOT(IspindelClientConnected()));
|
connect(mISpindelServer,SIGNAL(newConnection()),this,SLOT(IspindelClientConnected()));
|
||||||
mISpindelServer->listen(QHostAddress::Any,95);
|
mISpindelServer->listen(QHostAddress::Any,90);
|
||||||
|
|
||||||
mIspindelLog.clear();
|
mIspindelLog.clear();
|
||||||
mDataLogger.LoadLogData(&mIspindelLog);
|
mDataLogger.LoadLogData(&mIspindelLog);
|
||||||
@ -80,7 +80,7 @@ void CIspindelDevice::IspindelClientDataAvail()
|
|||||||
|
|
||||||
void CIspindelDevice::IspindelClientDisconnected()
|
void CIspindelDevice::IspindelClientDisconnected()
|
||||||
{
|
{
|
||||||
qDebug("Ispindel disconnected");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CIspindelDevice::~CIspindelDevice()
|
CIspindelDevice::~CIspindelDevice()
|
||||||
@ -135,7 +135,7 @@ bool CIspindelDevice::DeleteSampleRequest(int SampleIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mIspindelLog.removeAt(SampleIndex);
|
mIspindelLog.removeAt(SampleIndex);
|
||||||
mDataLogger.WriteLogToFile(&mIspindelLog,false);
|
mDataLogger.WriteLogToFile(&mIspindelLog);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
@ -1,199 +0,0 @@
|
|||||||
#include "LoraModuleInterface.h"
|
|
||||||
#include <QDataStream>
|
|
||||||
|
|
||||||
|
|
||||||
CLoraModuleInterface::CLoraModuleInterface()
|
|
||||||
{
|
|
||||||
connect(&mLoraModuleIFSerialPort,SIGNAL(readyRead()),this,SLOT(NewLoraModuleIFDataReady()));
|
|
||||||
|
|
||||||
mLoraModuleIFStatusTimer = new QTimer();
|
|
||||||
mLoraModuleIFStatusTimer->setSingleShot(false);
|
|
||||||
mLoraModuleIFStatusTimer->setInterval(1000);
|
|
||||||
mLoraModuleIFStatusTimer->start();
|
|
||||||
|
|
||||||
mLoraDeviceCommSurrogate = new CNetworkCommIFSurrogate;
|
|
||||||
mLoraDeviceCommSurrogate->mMyNetworkAddress = 1;
|
|
||||||
mLoraDeviceCommSurrogate->mMyNetworkID = ID_MASTER;
|
|
||||||
connect(mLoraDeviceCommSurrogate,&CNetworkCommIFSurrogate::ValidFrameReady,this,&CLoraModuleInterface::LoraRemoteDeviceDataReceived);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
connect(mLoraModuleIFStatusTimer,&QTimer::timeout,this,&CLoraModuleInterface::LoraModuleStatusTimerExpired);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
CLoraModuleInterface::~CLoraModuleInterface()
|
|
||||||
{
|
|
||||||
delete mLoraModuleIFStatusTimer;
|
|
||||||
delete mLoraDeviceCommSurrogate;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//This the handling of the Microcontroller (LoraModuleInterface)
|
|
||||||
int CLoraModuleInterface::NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data)
|
|
||||||
{
|
|
||||||
switch(MessageID)
|
|
||||||
{
|
|
||||||
case LORA_IF_GET_STATUS_RESPONSE:
|
|
||||||
{
|
|
||||||
QDataStream Strm(Data);
|
|
||||||
Strm >> mLoraModuleStatus;
|
|
||||||
qDebug("Lora device status received");
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LORA_IF_SEND_FRAME_RESPONSE:
|
|
||||||
{
|
|
||||||
qDebug("LoraModuleInterface sent frame to end Lora device");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LORA_IF_NEW_FRAME_RESPONSE: //LoraInterface received a message from the Lora end point (chalet for example). Let's decode it and send it to the destination device
|
|
||||||
{
|
|
||||||
|
|
||||||
//Use the surrogate to analyse the buffer. When frame is complete it will trigger a signal.
|
|
||||||
mLoraDeviceCommSurrogate->AnalyzeRxBuffer(Data);
|
|
||||||
|
|
||||||
// CNetworkProtocol *mTempProtocol = new CNetworkProtocol; //Let's instanciate a temp protocol class to avoid messing with our own derived class...
|
|
||||||
// int FwdDeviceID;
|
|
||||||
// int FwdDeviceAddress;
|
|
||||||
// int FwdMessageID;
|
|
||||||
// int FwdDataSize;
|
|
||||||
// QByteArray FwdData;
|
|
||||||
// if(mTempProtocol->ProtocolAnalyseBufferStatically(Data,FwdDeviceID,FwdDeviceAddress,FwdMessageID,FwdDataSize,FwdData) == PROTOCOL_RET_OK_PACKET_COMPLETE)
|
|
||||||
// {
|
|
||||||
// mDevicePtr->NewDeviceFrameReceived(FwdDeviceID,FwdDeviceAddress,FwdMessageID,FwdDataSize,FwdData);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// qDebug("LoraModuleInterface received an invalid packet from end Lora device in NewFrameReceived");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// delete mTempProtocol;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LORA_IF_GET_MODULE_CONFIG_RESPONSE:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LORA_IF_GET_RSSI_RESPONSE:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LORA_IF_SET_MODULE_CONFIG_RESPONSE:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LORA_IF_GET_STATUS_REQUEST:
|
|
||||||
case LORA_IF_SEND_FRAME_REQUEST:
|
|
||||||
case LORA_IF_GET_MODULE_CONFIG_REQUEST:
|
|
||||||
case LORA_IF_GET_RSSI_REQUEST:
|
|
||||||
case LORA_IF_SET_MODULE_CONFIG_REQUEST:
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
qDebug("CLoraModuleInterface: Received invalid response from LoraModule: %d",MessageID);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
//This is the CAbstractNetworkCommIF class implementation (to answer to CChaletDevice requests).
|
|
||||||
int CLoraModuleInterface::SendNetworkMessage(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray *Data)
|
|
||||||
{
|
|
||||||
qDebug("LoraInterfce: New frame received from MasterCtrl class");
|
|
||||||
|
|
||||||
|
|
||||||
//Get the payload by building the Msg packet
|
|
||||||
QByteArray Payload = GetTxPacket(MessageID,0,Data->data(),DataSize,DeviceAddress,DeviceID);
|
|
||||||
|
|
||||||
//Prepend the destination lora address & channel
|
|
||||||
Payload.prepend(mLoraPreamble);
|
|
||||||
// Payload.prepend(mDestLoraAddress);
|
|
||||||
// Payload.prepend((char)(mDestLoraChannel &0x00FF));
|
|
||||||
// Payload.prepend((char)((mDestLoraAddress >>8)));
|
|
||||||
|
|
||||||
//Now get the packet to communicate with LoraInterface uC
|
|
||||||
QByteArray Packet = GetTxPacket(LORA_IF_SEND_FRAME_REQUEST,0,Payload,Payload.size(),1,ID_LORA_INTERFACE_DEVICE);
|
|
||||||
mLoraModuleIFSerialPort.write(Packet);
|
|
||||||
mLoraModuleIFSerialPort.waitForBytesWritten(500);
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CLoraModuleInterface::LoraModuleStatusTimerExpired()
|
|
||||||
{
|
|
||||||
QByteArray Packet = GetTxPacket(LORA_IF_GET_STATUS_REQUEST,0,0,0,1,ID_LORA_INTERFACE_DEVICE);
|
|
||||||
mLoraModuleIFSerialPort.write(Packet);
|
|
||||||
mLoraModuleIFSerialPort.waitForBytesWritten(500);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CLoraModuleInterface::SetLoraModuleInterfaceParameters(QString ComPort, qint32 BaudRate)
|
|
||||||
{
|
|
||||||
mLoraModuleIFComPortName = ComPort;
|
|
||||||
mLoraModuleIFComPortBaudRate = BaudRate;
|
|
||||||
|
|
||||||
|
|
||||||
if(mLoraModuleIFSerialPort.isOpen())
|
|
||||||
{
|
|
||||||
mLoraModuleIFSerialPort.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
mLoraModuleIFSerialPort.setPortName(mLoraModuleIFComPortName);
|
|
||||||
if(mLoraModuleIFSerialPort.setBaudRate(mLoraModuleIFComPortBaudRate) == false)
|
|
||||||
{
|
|
||||||
qDebug("Invalid Lora Device serial port baud rate...");
|
|
||||||
}
|
|
||||||
|
|
||||||
//The other serial port parameters (parity, stop bits, data bits) are all set to mentally sane default values so no need to set them.
|
|
||||||
if(mLoraModuleIFSerialPort.open(QIODevice::ReadWrite) == false)
|
|
||||||
{
|
|
||||||
qDebug("Could not open Lora device port");
|
|
||||||
return RET_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
qDebug("LoraModuleInterface serial port opened");
|
|
||||||
return RET_OK;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CLoraModuleInterface::SetLoraDestinationAddress(quint16 Address, quint8 Channel)
|
|
||||||
{
|
|
||||||
mDestLoraAddress = Address;
|
|
||||||
mDestLoraChannel = Channel;
|
|
||||||
mLoraPreamble.clear();
|
|
||||||
mLoraPreamble.append(mDestLoraChannel);
|
|
||||||
mLoraPreamble.prepend((char)(mDestLoraAddress &0x00FF));
|
|
||||||
mLoraPreamble.prepend((char)((mDestLoraAddress >>8)));
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CLoraModuleInterface::NewLoraModuleIFDataReady()
|
|
||||||
{
|
|
||||||
QByteArray NewData = mLoraModuleIFSerialPort.readAll();
|
|
||||||
|
|
||||||
AnalyzeRxBuffer(NewData);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CLoraModuleInterface::LoraRemoteDeviceDataReceived(int FwdDeviceID, int FwdDeviceAddress, int FwdMessageID, int FwdDataSize, QByteArray FwdData)
|
|
||||||
{
|
|
||||||
//Multiple devices could be connected to the interface. Find the sender
|
|
||||||
//NOTE: This needs a major rework of the inheritance scheme!
|
|
||||||
|
|
||||||
QObject *SenderObj = QObject::sender();
|
|
||||||
if(SenderObj == mLoraDeviceCommSurrogate)
|
|
||||||
{
|
|
||||||
mDevicePtr->NewDeviceFrameReceived(FwdDeviceID,FwdDeviceAddress,FwdMessageID,FwdDataSize,FwdData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CLoraModuleInterface::LoraRemoteDeviceReceiveError(CNetworkProtocol::ProtocolRetValues RetID)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
#ifndef LORAMODULEINTERFACE_H
|
|
||||||
#define LORAMODULEINTERFACE_H
|
|
||||||
|
|
||||||
#include <QByteArray>
|
|
||||||
#include <QObject>
|
|
||||||
#include <QSerialPort>
|
|
||||||
#include "NetworkProtocol.h"
|
|
||||||
#include "AbstractNetworkInterface.h"
|
|
||||||
#include "NetworkDevice.h"
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QSerialPort>
|
|
||||||
#include <QByteArrayList>
|
|
||||||
#include "NetworkCommIFSurrogate.h"
|
|
||||||
#include "LoraModuleInterfaceData.h"
|
|
||||||
|
|
||||||
|
|
||||||
class CLoraModuleInterface : public QObject, public CNetworkProtocol, public CAbstractNetworkCommIF
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
CLoraModuleInterface();
|
|
||||||
virtual ~CLoraModuleInterface();
|
|
||||||
|
|
||||||
int SetLoraModuleInterfaceParameters(QString ComPort,qint32 BaudRate);
|
|
||||||
int SetLoraDestinationAddress(quint16 Address, quint8 Channel);
|
|
||||||
CLoraModuleInterfaceStatus GetModuleIFStatus() {return mLoraModuleStatus;}
|
|
||||||
|
|
||||||
QTimer *mLoraModuleIFStatusTimer;
|
|
||||||
QSerialPort mLoraModuleIFSerialPort;
|
|
||||||
QString mLoraModuleIFComPortName;
|
|
||||||
qint32 mLoraModuleIFComPortBaudRate;
|
|
||||||
CNetworkCommIFSurrogate *mLoraDeviceCommSurrogate;
|
|
||||||
unsigned short mDestLoraAddress;
|
|
||||||
unsigned char mDestLoraChannel;
|
|
||||||
QByteArray mLoraPreamble;
|
|
||||||
|
|
||||||
CLoraModuleInterfaceStatus mLoraModuleStatus;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//NetworkProtocol implementation
|
|
||||||
virtual int NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
|
||||||
|
|
||||||
//NetworkCommIF implementation
|
|
||||||
virtual int SendNetworkMessage(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray *Data);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void LoraModuleStatusTimerExpired();
|
|
||||||
void NewLoraModuleIFDataReady();
|
|
||||||
|
|
||||||
void LoraRemoteDeviceDataReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
|
||||||
void LoraRemoteDeviceReceiveError(CNetworkProtocol::ProtocolRetValues RetID);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LORAMODULEINTERFACE_H
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
#include "LoraModuleInterfaceData.h"
|
|
||||||
|
|
||||||
CLoraModuleInterfaceStatus::CLoraModuleInterfaceStatus()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
CLoraModuleInterfaceStatus& CLoraModuleInterfaceStatus::operator = (const CLoraModuleInterfaceStatus &rhs)
|
|
||||||
{
|
|
||||||
if(this == &rhs)
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
mModuleModel = rhs.mModuleModel;
|
|
||||||
mModuleInternalAddress = rhs.mModuleInternalAddress;
|
|
||||||
mModuleUARTParity = rhs.mModuleUARTParity;
|
|
||||||
mModuleUARTRate = rhs.mModuleUARTRate;
|
|
||||||
mModuleAirRate = rhs.mModuleAirRate;
|
|
||||||
mModuleSubPacket = rhs.mModuleSubPacket;
|
|
||||||
mModuleRSSIEnabled = rhs.mModuleRSSIEnabled;
|
|
||||||
mModuleTxPower = rhs.mModuleTxPower;
|
|
||||||
mModuleInternalChannel = rhs.mModuleInternalChannel;
|
|
||||||
mModuleRSSIByteEnabled = rhs.mModuleRSSIByteEnabled;
|
|
||||||
mModuleTxMethod = rhs.mModuleTxMethod;
|
|
||||||
mModuleLBTEnabled = rhs.mModuleLBTEnabled;
|
|
||||||
mModuleWORCycle = rhs.mModuleWORCycle;
|
|
||||||
mModuleAmbientRSSI = rhs.mModuleAmbientRSSI;
|
|
||||||
mModuleLastRxRSSI = rhs.mModuleLastRxRSSI;
|
|
||||||
|
|
||||||
mIPAddress1 = rhs.mIPAddress1;
|
|
||||||
mIPAddress2 = rhs.mIPAddress2;
|
|
||||||
mIPAddress3 = rhs.mIPAddress3;
|
|
||||||
mIPAddress4 = rhs.mIPAddress4;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDataStream &operator<<(QDataStream &out, const CLoraModuleInterfaceStatus &source)
|
|
||||||
{
|
|
||||||
out << source.mModuleModel
|
|
||||||
<< source.mModuleInternalAddress
|
|
||||||
<< source.mModuleUARTParity
|
|
||||||
<< source.mModuleUARTRate
|
|
||||||
<< source.mModuleAirRate
|
|
||||||
<< source.mModuleSubPacket
|
|
||||||
<< source.mModuleRSSIEnabled
|
|
||||||
<< source.mModuleTxPower
|
|
||||||
<< source.mModuleInternalChannel
|
|
||||||
<< source.mModuleRSSIByteEnabled
|
|
||||||
<< source.mModuleTxMethod
|
|
||||||
<< source.mModuleLBTEnabled
|
|
||||||
<< source.mModuleWORCycle
|
|
||||||
<< source.mModuleAmbientRSSI
|
|
||||||
<< source.mModuleLastRxRSSI
|
|
||||||
<< source.mIPAddress1
|
|
||||||
<< source.mIPAddress2
|
|
||||||
<< source.mIPAddress3
|
|
||||||
<< source.mIPAddress4;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDataStream &operator>>(QDataStream &in, CLoraModuleInterfaceStatus &dest)
|
|
||||||
{
|
|
||||||
in >> dest.mModuleModel
|
|
||||||
>> dest.mModuleInternalAddress
|
|
||||||
>> dest.mModuleUARTParity
|
|
||||||
>> dest.mModuleUARTRate
|
|
||||||
>> dest.mModuleAirRate
|
|
||||||
>> dest.mModuleSubPacket
|
|
||||||
>> dest.mModuleRSSIEnabled
|
|
||||||
>> dest.mModuleTxPower
|
|
||||||
>> dest.mModuleInternalChannel
|
|
||||||
>> dest.mModuleRSSIByteEnabled
|
|
||||||
>> dest.mModuleTxMethod
|
|
||||||
>> dest.mModuleLBTEnabled
|
|
||||||
>> dest.mModuleWORCycle
|
|
||||||
>> dest.mModuleAmbientRSSI
|
|
||||||
>> dest.mModuleLastRxRSSI
|
|
||||||
>> dest.mIPAddress1
|
|
||||||
>> dest.mIPAddress2
|
|
||||||
>> dest.mIPAddress3
|
|
||||||
>> dest.mIPAddress4;
|
|
||||||
|
|
||||||
|
|
||||||
return in;
|
|
||||||
}
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
#ifndef LORAMODULEINTERFACEDATA_H
|
|
||||||
#define LORAMODULEINTERFACEDATA_H
|
|
||||||
|
|
||||||
#include <QtGlobal>
|
|
||||||
#include <QDataStream>
|
|
||||||
|
|
||||||
class CLoraModuleInterfaceStatus
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
enum eE220UartRates
|
|
||||||
{
|
|
||||||
E220_UART_1200 = 0,
|
|
||||||
E220_UART_2400,
|
|
||||||
E220_UART_4800,
|
|
||||||
E220_UART_9600,
|
|
||||||
E220_UART_19200,
|
|
||||||
E220_UART_38400,
|
|
||||||
E220_UART_57600,
|
|
||||||
E220_UART_115200
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum eE220ParityBit
|
|
||||||
{
|
|
||||||
E220_UART_8N1=0,
|
|
||||||
E220_UART_8O1,
|
|
||||||
E220_UART_8E1,
|
|
||||||
E220_UART_8N1_bis
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum e220AirDataRates
|
|
||||||
{
|
|
||||||
E220_AIR_RATE_24K = 0,
|
|
||||||
E220_AIR_RATE_24K_1,
|
|
||||||
E220_AIR_RATE_24K_2,
|
|
||||||
E220_AIR_RATE_48K,
|
|
||||||
E220_AIR_RATE_96K,
|
|
||||||
E220_AIR_RATE_192K,
|
|
||||||
E220_AIR_RATE_384K,
|
|
||||||
E220_AIR_RATE_625K
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum e220PacketSizes
|
|
||||||
{
|
|
||||||
E220_PACKET_200,
|
|
||||||
E220_PACKET_128,
|
|
||||||
E220_PACKET_64,
|
|
||||||
E220_PACKET_32
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum e220TransmitPower
|
|
||||||
{
|
|
||||||
E220_TX_PWR_30,
|
|
||||||
E220_TX_PWR_27,
|
|
||||||
E220_TX_PWR_24,
|
|
||||||
E220_TX_PWR_21
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum e220WORCycles
|
|
||||||
{
|
|
||||||
E220_WOR_500MS,
|
|
||||||
E220_WOR_1000MS,
|
|
||||||
E220_WOR_1500MS,
|
|
||||||
E220_WOR_2000MS,
|
|
||||||
E220_WOR_2500MS,
|
|
||||||
E220_WOR_3000MS,
|
|
||||||
E220_WOR_3500MS,
|
|
||||||
E220_WOR_4000MS
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLoraModuleInterfaceStatus();
|
|
||||||
|
|
||||||
quint8 mModuleModel;
|
|
||||||
quint16 mModuleInternalAddress;
|
|
||||||
quint8 mModuleUARTParity;
|
|
||||||
quint8 mModuleUARTRate;
|
|
||||||
quint8 mModuleAirRate;
|
|
||||||
quint8 mModuleSubPacket;
|
|
||||||
quint8 mModuleRSSIEnabled;
|
|
||||||
quint8 mModuleTxPower;
|
|
||||||
quint8 mModuleInternalChannel;
|
|
||||||
quint8 mModuleRSSIByteEnabled;
|
|
||||||
quint8 mModuleTxMethod;
|
|
||||||
quint8 mModuleLBTEnabled;
|
|
||||||
quint8 mModuleWORCycle;
|
|
||||||
|
|
||||||
quint8 mModuleAmbientRSSI;
|
|
||||||
quint8 mModuleLastRxRSSI;
|
|
||||||
|
|
||||||
quint8 mIPAddress1;
|
|
||||||
quint8 mIPAddress2;
|
|
||||||
quint8 mIPAddress3;
|
|
||||||
quint8 mIPAddress4;
|
|
||||||
|
|
||||||
CLoraModuleInterfaceStatus& operator=(const CLoraModuleInterfaceStatus &rhs);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
QDataStream &operator<<(QDataStream &out, const CLoraModuleInterfaceStatus &source);
|
|
||||||
QDataStream &operator>>(QDataStream &in, CLoraModuleInterfaceStatus &dest);
|
|
||||||
|
|
||||||
#endif // LORAMODULEINTERFACEDATA_H
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
#include "LoraModuleInterfaceInterface.h"
|
|
||||||
|
|
||||||
|
|
||||||
CLoraModuleInterfaceInterface::CLoraModuleInterfaceInterface(int Address, CAbstractNetworkCommIF *NetworkInterface, CLoraModuleInterface *DevicePtr):
|
|
||||||
CNetworkDevice(ID_LORA_INTERFACE_INTERFACE,Address,NetworkInterface)
|
|
||||||
{
|
|
||||||
mLoraModuleIFPtr = DevicePtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CLoraModuleInterfaceInterface::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data)
|
|
||||||
{
|
|
||||||
Q_UNUSED(DeviceID)
|
|
||||||
Q_UNUSED(DeviceAddress)
|
|
||||||
Q_UNUSED(DataSize)
|
|
||||||
Q_UNUSED(Data)
|
|
||||||
|
|
||||||
switch(MessageID)
|
|
||||||
{
|
|
||||||
case LORA_MODULE_IF_INTERFACE_ACK:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LORA_MODULE_IF_INTERFACE_GENERAL_STATUS_REQUEST:
|
|
||||||
{
|
|
||||||
QByteArray StatusData;
|
|
||||||
QDataStream Strm(&StatusData,QIODevice::WriteOnly);
|
|
||||||
Strm << mLoraModuleIFPtr->GetModuleIFStatus();
|
|
||||||
mNetworkInterfacePtr->SendNetworkMessage(ID_LORA_INTERFACE_INTERFACE,mDeviceAddress,LORA_MODULE_IF_INTERFACE_GENERAL_STATUS_RESPONSE,StatusData.size(),&StatusData);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LORA_MODULE_IF_INTERFACE_GENERAL_STATUS_RESPONSE:
|
|
||||||
{
|
|
||||||
qDebug("CLoraModuleInterfaceInterface : Received an invalid command from remote");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
#ifndef LORAMODULEINTERFACEINTERFACE_H
|
|
||||||
#define LORAMODULEINTERFACEINTERFACE_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include "NetworkDevice.h"
|
|
||||||
#include "LoraModuleInterface.h"
|
|
||||||
|
|
||||||
class CLoraModuleInterfaceInterface: public QObject, public CNetworkDevice
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit CLoraModuleInterfaceInterface(int Address, CAbstractNetworkCommIF *NetworkInterface, CLoraModuleInterface *DevicePtr);
|
|
||||||
virtual int NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
|
||||||
|
|
||||||
CLoraModuleInterface *mLoraModuleIFPtr;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LORAMODULEINTERFACEINTERFACE_H
|
|
||||||
@ -10,9 +10,6 @@ CLoraNetworkCommIF::CLoraNetworkCommIF()
|
|||||||
mLoraMagicResponse.append(0xAD);
|
mLoraMagicResponse.append(0xAD);
|
||||||
mLoraMagicResponse.append(0xBE);
|
mLoraMagicResponse.append(0xBE);
|
||||||
mLoraMagicResponse.append(0xEF);
|
mLoraMagicResponse.append(0xEF);
|
||||||
|
|
||||||
mDestLoraAddress = 6;
|
|
||||||
mDestLoraChannel = 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray CLoraNetworkCommIF::GetLoraFrame(unsigned short DestAddress, unsigned char DestChannel, QByteArray Payload)
|
QByteArray CLoraNetworkCommIF::GetLoraFrame(unsigned short DestAddress, unsigned char DestChannel, QByteArray Payload)
|
||||||
@ -66,7 +63,6 @@ int CLoraNetworkCommIF::SendLoraFrame(unsigned short DestAddress, unsigned char
|
|||||||
{
|
{
|
||||||
|
|
||||||
mLoraDeviceSerialPort.write(GetLoraFrame(DestAddress,DestChannel,Payload));
|
mLoraDeviceSerialPort.write(GetLoraFrame(DestAddress,DestChannel,Payload));
|
||||||
// mLoraDeviceSerialPort.write(Payload);
|
|
||||||
mLoraDeviceSerialPort.waitForBytesWritten(500);
|
mLoraDeviceSerialPort.waitForBytesWritten(500);
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
|
||||||
@ -112,15 +108,7 @@ int CLoraNetworkCommIF::NewFrameReceived(int DeviceID, int DeviceAddress, int Me
|
|||||||
int CLoraNetworkCommIF::SendNetworkMessage(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray *Data)
|
int CLoraNetworkCommIF::SendNetworkMessage(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray *Data)
|
||||||
{
|
{
|
||||||
QByteArray Packet = GetTxPacket(MessageID,0,Data->data(),DataSize,DeviceAddress,DeviceID);
|
QByteArray Packet = GetTxPacket(MessageID,0,Data->data(),DataSize,DeviceAddress,DeviceID);
|
||||||
//SendLoraFrame(6,4,Packet); //channel 6 = chalet
|
SendLoraFrame(6,4,Packet); //channel 6 = chalet
|
||||||
//SendLoraFrame(7,4,Packet); //channel 7 = chaloupe
|
//SendLoraFrame(7,4,Packet); //channel 7 = chaloupe
|
||||||
SendLoraFrame(mDestLoraAddress,mDestLoraChannel,Packet);
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CLoraNetworkCommIF::SetLoraDestinationAddress(quint16 Address, quint8 Channel)
|
|
||||||
{
|
|
||||||
mDestLoraAddress = Address;
|
|
||||||
mDestLoraChannel = Channel;
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,13 +22,10 @@ public:
|
|||||||
|
|
||||||
unsigned short mMyLoraAddress;
|
unsigned short mMyLoraAddress;
|
||||||
unsigned char mMyLoraChannel;
|
unsigned char mMyLoraChannel;
|
||||||
unsigned short mDestLoraAddress;
|
|
||||||
unsigned char mDestLoraChannel;
|
|
||||||
QSerialPort mLoraDeviceSerialPort;
|
QSerialPort mLoraDeviceSerialPort;
|
||||||
|
|
||||||
int SendLoraFrame(unsigned short DestAddress,unsigned char DestChannel,QByteArray Payload);
|
int SendLoraFrame(unsigned short DestAddress,unsigned char DestChannel,QByteArray Payload);
|
||||||
int SetLoraSerialPortSettings(QString PortName, qint32 BaudRate);
|
int SetLoraSerialPortSettings(QString PortName, qint32 BaudRate);
|
||||||
int SetLoraDestinationAddress(quint16 Address, quint8 Channel);
|
|
||||||
|
|
||||||
//NetworkProtocol implementation
|
//NetworkProtocol implementation
|
||||||
int NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
int NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#include "MasterCtrl.h"
|
#include "MasterCtrl.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include "EthernetNetworkCommIF.h"
|
|
||||||
|
|
||||||
// #include <QByteArray>
|
// #include <QByteArray>
|
||||||
//#include <QBuffer>
|
//#include <QBuffer>
|
||||||
@ -8,10 +7,6 @@
|
|||||||
CMasterCtrl::CMasterCtrl()
|
CMasterCtrl::CMasterCtrl()
|
||||||
{
|
{
|
||||||
qDebug("Creation...");
|
qDebug("Creation...");
|
||||||
|
|
||||||
mChaletLoraModuleInterface = 0;
|
|
||||||
mChaletLoraNetworkCommInterface = 0;
|
|
||||||
|
|
||||||
// mDeadBoltDevice = new CDeadboltDevice(1);
|
// mDeadBoltDevice = new CDeadboltDevice(1);
|
||||||
mAVReceiverDevice = new CAVReceiverDevice();
|
mAVReceiverDevice = new CAVReceiverDevice();
|
||||||
mVoipMsSMSClient = new CVoipMsSMSClient;
|
mVoipMsSMSClient = new CVoipMsSMSClient;
|
||||||
@ -20,30 +15,12 @@ CMasterCtrl::CMasterCtrl()
|
|||||||
mSettingsWindow = new CSettingsWindow();
|
mSettingsWindow = new CSettingsWindow();
|
||||||
mSettingsWindow->mProgramHandle = this;
|
mSettingsWindow->mProgramHandle = this;
|
||||||
|
|
||||||
mSettingsManager.LoadSettings(&mMasterCtrlSettings);
|
mChaletLoraNetworkCommInterface = new CLoraNetworkCommIF();
|
||||||
|
mChaletLoraNetworkCommInterface->mMyLoraAddress = 5;
|
||||||
|
mChaletLoraNetworkCommInterface->mMyLoraChannel = 4;
|
||||||
|
mChaletLoraDevice = new CChaletLoraDevice(1,mChaletLoraNetworkCommInterface);
|
||||||
|
|
||||||
|
|
||||||
if(mMasterCtrlSettings.mChaletUseLoraIF == true)
|
|
||||||
{
|
|
||||||
mChaletLoraModuleInterface = new CLoraModuleInterface(); //JFM LoraInterface Dev
|
|
||||||
mChaletLoraDevice = new CChaletDevice(1,mChaletLoraModuleInterface); //JFM LoraInterface Dev
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mChaletLoraNetworkCommInterface = new CLoraNetworkCommIF();//JFM LoraInterface Dev
|
|
||||||
mChaletLoraDevice = new CChaletDevice(1,mChaletLoraNetworkCommInterface);//JFM LoraInterface Dev
|
|
||||||
}
|
|
||||||
|
|
||||||
CEthernetNetworkCommIF *Dummy = new CEthernetNetworkCommIF(NULL); //No memory leak here.. object will be deleted on reasignment.
|
|
||||||
mChaletLTEDevice = new CChaletDevice(1,(CAbstractNetworkCommIF*)Dummy);
|
|
||||||
|
|
||||||
|
|
||||||
// mChaletLoraInterface = new CChaletLoraInterface(mRooftopTowerLoraDevice);
|
// mChaletLoraInterface = new CChaletLoraInterface(mRooftopTowerLoraDevice);
|
||||||
|
|
||||||
|
|
||||||
mIspindelDevice = new CIspindelDevice;
|
mIspindelDevice = new CIspindelDevice;
|
||||||
|
|
||||||
|
|
||||||
@ -65,10 +42,7 @@ CMasterCtrl::~CMasterCtrl()
|
|||||||
delete mEthernetNetworkServer;
|
delete mEthernetNetworkServer;
|
||||||
delete mContactsRepository;
|
delete mContactsRepository;
|
||||||
delete mSprinklerManager;
|
delete mSprinklerManager;
|
||||||
if(mChaletLoraNetworkCommInterface != 0)
|
delete mChaletLoraNetworkCommInterface;
|
||||||
delete mChaletLoraNetworkCommInterface; //JFM LoraInterface Dev
|
|
||||||
if(mChaletLoraModuleInterface != 0)
|
|
||||||
delete mChaletLoraModuleInterface;
|
|
||||||
delete mChaletLoraDevice;
|
delete mChaletLoraDevice;
|
||||||
delete mIspindelDevice;
|
delete mIspindelDevice;
|
||||||
// delete mMasterCtrlSettings;
|
// delete mMasterCtrlSettings;
|
||||||
@ -99,8 +73,6 @@ void CMasterCtrl::Start()
|
|||||||
mNetworkDevicesManager->mAvReceiverDevice = mAVReceiverDevice;
|
mNetworkDevicesManager->mAvReceiverDevice = mAVReceiverDevice;
|
||||||
mNetworkDevicesManager->mChaletLoraDevice = mChaletLoraDevice;
|
mNetworkDevicesManager->mChaletLoraDevice = mChaletLoraDevice;
|
||||||
mNetworkDevicesManager->mIspindelDevice = mIspindelDevice;
|
mNetworkDevicesManager->mIspindelDevice = mIspindelDevice;
|
||||||
mNetworkDevicesManager->mLoraModuleInterfaceDevice = mChaletLoraModuleInterface;
|
|
||||||
mNetworkDevicesManager->mChaletLTEDevice = mChaletLTEDevice;
|
|
||||||
|
|
||||||
|
|
||||||
mEthernetNetworkServer->mDevicesMgrHandle = mNetworkDevicesManager;
|
mEthernetNetworkServer->mDevicesMgrHandle = mNetworkDevicesManager;
|
||||||
@ -113,7 +85,7 @@ void CMasterCtrl::Start()
|
|||||||
connect(mVoipMsSMSClient,SIGNAL(DIDSFetched(QStringList)),mSettingsWindow,SLOT(DIDsListFetched(QStringList)));
|
connect(mVoipMsSMSClient,SIGNAL(DIDSFetched(QStringList)),mSettingsWindow,SLOT(DIDsListFetched(QStringList)));
|
||||||
|
|
||||||
|
|
||||||
|
mSettingsManager.LoadSettings(&mMasterCtrlSettings);
|
||||||
mSettingsWindow->SetSettingsData(&mMasterCtrlSettings);
|
mSettingsWindow->SetSettingsData(&mMasterCtrlSettings);
|
||||||
mVoipMsSMSClient->SetVOIPMsSettings(&mMasterCtrlSettings.mVoipMSSettings);
|
mVoipMsSMSClient->SetVOIPMsSettings(&mMasterCtrlSettings.mVoipMSSettings);
|
||||||
mVoipMsSMSClient->DownloadSMSFromServer();
|
mVoipMsSMSClient->DownloadSMSFromServer();
|
||||||
@ -123,33 +95,11 @@ void CMasterCtrl::Start()
|
|||||||
|
|
||||||
mAVReceiverDevice->Start();
|
mAVReceiverDevice->Start();
|
||||||
|
|
||||||
//JFM LoraInterface Dev
|
mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings("COM3",QSerialPort::Baud9600);
|
||||||
if(mMasterCtrlSettings.mChaletUseLoraIF)
|
|
||||||
{
|
|
||||||
mChaletLoraModuleInterface->SetLoraModuleInterfaceParameters(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600);
|
|
||||||
mChaletLoraModuleInterface->SetLoraDestinationAddress(mMasterCtrlSettings.mChaletLoraAddress, 65 /*mMasterCtrlSettings.mChaletLoraChannel*/);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mChaletLoraNetworkCommInterface->mMyLoraAddress = 5;
|
|
||||||
// mChaletLoraNetworkCommInterface->mMyLoraChannel = 4;
|
|
||||||
mChaletLoraNetworkCommInterface->mMyLoraChannel = mMasterCtrlSettings.mChaletLoraChannel;
|
|
||||||
mChaletLoraNetworkCommInterface->SetLoraDestinationAddress(mMasterCtrlSettings.mChaletLoraAddress,mMasterCtrlSettings.mChaletLoraChannel);
|
|
||||||
mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600);
|
|
||||||
}
|
|
||||||
//JFM LoraInterface Dev
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings("COM5",QSerialPort::Baud9600);
|
// mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings("COM5",QSerialPort::Baud9600);
|
||||||
mChaletLoraDevice->mChaletName = "Chalet Lora";
|
|
||||||
mChaletLoraDevice->Start();
|
mChaletLoraDevice->Start();
|
||||||
|
|
||||||
|
|
||||||
mChaletLTEDevice->mChaletName = "Chalet LTE";
|
|
||||||
mChaletLTEDevice->Start();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -160,8 +110,7 @@ void CMasterCtrl::Start()
|
|||||||
|
|
||||||
unsigned int CMasterCtrl::QuitApplicationRequest()
|
unsigned int CMasterCtrl::QuitApplicationRequest()
|
||||||
{
|
{
|
||||||
// QApplication::exit(69);
|
QApplication::exit(69);
|
||||||
QCoreApplication::quit();
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,18 +141,6 @@ unsigned int CMasterCtrl::SettingsWindowClosed()
|
|||||||
{
|
{
|
||||||
mVoipMsSMSClient->SetVOIPMsSettings(&mMasterCtrlSettings.mVoipMSSettings);
|
mVoipMsSMSClient->SetVOIPMsSettings(&mMasterCtrlSettings.mVoipMSSettings);
|
||||||
mVoipMsSMSClient->DownloadSMSFromServer();
|
mVoipMsSMSClient->DownloadSMSFromServer();
|
||||||
|
|
||||||
if(mChaletLoraModuleInterface != 0)
|
|
||||||
{
|
|
||||||
mChaletLoraModuleInterface->SetLoraDestinationAddress(mMasterCtrlSettings.mChaletLoraAddress, 65 /*mMasterCtrlSettings.mChaletLoraChannel*/); //JFM LoraInterface Dev
|
|
||||||
mChaletLoraModuleInterface->SetLoraModuleInterfaceParameters(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600);
|
|
||||||
}
|
|
||||||
if(mChaletLoraNetworkCommInterface != 0)
|
|
||||||
{
|
|
||||||
mChaletLoraNetworkCommInterface->mMyLoraChannel = mMasterCtrlSettings.mChaletLoraChannel;
|
|
||||||
mChaletLoraNetworkCommInterface->SetLoraDestinationAddress(mMasterCtrlSettings.mChaletLoraAddress,mMasterCtrlSettings.mChaletLoraChannel); //JFM LoraInterface Dev
|
|
||||||
mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600); //JFM LoraInterface Dev
|
|
||||||
}
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,12 +12,11 @@
|
|||||||
#include "EthernetNetworkServer.h"
|
#include "EthernetNetworkServer.h"
|
||||||
#include "ContactRepository.h"
|
#include "ContactRepository.h"
|
||||||
#include "SprinklerMgr.h"
|
#include "SprinklerMgr.h"
|
||||||
#include "ChaletDevice.h"
|
#include "ChaletLoraDevice.h"
|
||||||
//#include "ChaletLoraInterface.h"
|
//#include "ChaletLoraInterface.h"
|
||||||
#include "LoraNetworkCommIF.h"
|
#include "LoraNetworkCommIF.h"
|
||||||
#include "HttpServer.h"
|
#include "HttpServer.h"
|
||||||
#include "IspindelDevice.h"
|
#include "IspindelDevice.h"
|
||||||
#include "LoraModuleInterface.h"
|
|
||||||
|
|
||||||
//#include "AppIconWidget.h"
|
//#include "AppIconWidget.h"
|
||||||
|
|
||||||
@ -41,14 +40,12 @@ public:
|
|||||||
CContactRepository *mContactsRepository;
|
CContactRepository *mContactsRepository;
|
||||||
CSprinklerMgr *mSprinklerManager;
|
CSprinklerMgr *mSprinklerManager;
|
||||||
|
|
||||||
CChaletDevice *mChaletLoraDevice;
|
CChaletLoraDevice *mChaletLoraDevice;
|
||||||
CChaletDevice *mChaletLTEDevice;
|
|
||||||
// CChaletLoraInterface *mChaletLoraInterface;
|
// CChaletLoraInterface *mChaletLoraInterface;
|
||||||
CLoraNetworkCommIF *mChaletLoraNetworkCommInterface;
|
CLoraNetworkCommIF *mChaletLoraNetworkCommInterface;
|
||||||
CLoraModuleInterface *mChaletLoraModuleInterface;
|
|
||||||
// CAppIconWidget mAppWidget;
|
// CAppIconWidget mAppWidget;
|
||||||
|
|
||||||
CHttpServer mHttpServer;
|
// CHttpServer mHttpServer;
|
||||||
|
|
||||||
CIspindelDevice *mIspindelDevice;
|
CIspindelDevice *mIspindelDevice;
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
#include "NetworkCommIFSurrogate.h"
|
|
||||||
|
|
||||||
CNetworkCommIFSurrogate::CNetworkCommIFSurrogate()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int CNetworkCommIFSurrogate:: NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data)
|
|
||||||
{
|
|
||||||
emit ValidFrameReady(DeviceID, DeviceAddress, MessageID, DataSize, Data);
|
|
||||||
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
#ifndef NETWORKCOMMIFSURROGATE_H
|
|
||||||
#define NETWORKCOMMIFSURROGATE_H
|
|
||||||
#include "NetworkProtocol.h"
|
|
||||||
|
|
||||||
//This class allows to instanciate and manage a NetworkProtocol class to decode network messages behind a proxy like LoraNetworkCommIF.
|
|
||||||
|
|
||||||
|
|
||||||
class CNetworkCommIFSurrogate : public QObject, public CNetworkProtocol
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
CNetworkCommIFSurrogate();
|
|
||||||
|
|
||||||
virtual int NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);// = 0;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void ValidFrameReady(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
|
|
||||||
void DataReceiveError(CNetworkProtocol::ProtocolRetValues RetID);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // NETWORKCOMMIFSURROGATE_H
|
|
||||||
@ -5,9 +5,8 @@ CNetworkDevice::CNetworkDevice(int DeviceID, int DeviceAddress, CAbstractNetwork
|
|||||||
{
|
{
|
||||||
mDeviceAddress = DeviceAddress;
|
mDeviceAddress = DeviceAddress;
|
||||||
mDeviceID = DeviceID;
|
mDeviceID = DeviceID;
|
||||||
mIsOnline = false;
|
|
||||||
mNetworkInterfacePtr = 0;
|
|
||||||
SetNetworkInterface(Interface);
|
SetNetworkInterface(Interface);
|
||||||
|
mIsOnline = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CNetworkDevice::~CNetworkDevice()
|
CNetworkDevice::~CNetworkDevice()
|
||||||
@ -20,8 +19,6 @@ CNetworkDevice::~CNetworkDevice()
|
|||||||
|
|
||||||
void CNetworkDevice::SetNetworkInterface(CAbstractNetworkCommIF *Interface)
|
void CNetworkDevice::SetNetworkInterface(CAbstractNetworkCommIF *Interface)
|
||||||
{
|
{
|
||||||
if(mNetworkInterfacePtr != 0)
|
|
||||||
delete mNetworkInterfacePtr;
|
|
||||||
mNetworkInterfacePtr = Interface;
|
mNetworkInterfacePtr = Interface;
|
||||||
if(Interface != 0)
|
if(Interface != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CNetworkDevicesMgr::CNetworkDevicesMgr()
|
CNetworkDevicesMgr::CNetworkDevicesMgr()
|
||||||
{
|
{
|
||||||
mVoipMSInterfaceHandle = 0;
|
mVoipMSInterfaceHandle = 0;
|
||||||
@ -16,7 +15,6 @@ CNetworkDevicesMgr::CNetworkDevicesMgr()
|
|||||||
mAvReceiverDevice = 0;
|
mAvReceiverDevice = 0;
|
||||||
mChaletLoraDevice = 0;
|
mChaletLoraDevice = 0;
|
||||||
mIspindelDevice = 0;
|
mIspindelDevice = 0;
|
||||||
mLoraModuleInterfaceDevice = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CNetworkDevicesMgr::~CNetworkDevicesMgr()
|
CNetworkDevicesMgr::~CNetworkDevicesMgr()
|
||||||
@ -102,8 +100,7 @@ int CNetworkDevicesMgr::CreateNewChaletInterface(int Address, CAbstractNetworkCo
|
|||||||
{
|
{
|
||||||
return RET_ERROR;
|
return RET_ERROR;
|
||||||
}
|
}
|
||||||
// CChaletInterface *ChaletInterface = new CChaletInterface(Address, NetworkIF,mChaletLoraDevice);
|
CChaletInterface *ChaletInterface = new CChaletInterface(Address, NetworkIF,mChaletLoraDevice);
|
||||||
CChaletInterface *ChaletInterface = new CChaletInterface(Address, NetworkIF,mChaletLTEDevice);
|
|
||||||
mNetworkDevicesList.append((CNetworkDevice*)ChaletInterface);
|
mNetworkDevicesList.append((CNetworkDevice*)ChaletInterface);
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
@ -119,25 +116,6 @@ int CNetworkDevicesMgr::CreateNewIspindleInterface(int Address, CAbstractNetwork
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CNetworkDevicesMgr::CreateNewLoraInterfaceInterface(int Address, CAbstractNetworkCommIF *NetworkIF)
|
|
||||||
{
|
|
||||||
if(mLoraModuleInterfaceDevice == 0)
|
|
||||||
{
|
|
||||||
return RET_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
CLoraModuleInterfaceInterface *LoraModuleIFInterface = new CLoraModuleInterfaceInterface(Address,NetworkIF,mLoraModuleInterfaceDevice);
|
|
||||||
mNetworkDevicesList.append((CNetworkDevice*)LoraModuleIFInterface);
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CNetworkDevicesMgr::BindNetworkChaletDevice(int Address, CAbstractNetworkCommIF *NetworkIF)
|
|
||||||
{
|
|
||||||
mChaletLTEDevice->mDeviceAddress = Address;
|
|
||||||
mChaletLTEDevice->SetNetworkInterface(NetworkIF);
|
|
||||||
return RET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CNetworkDevicesMgr::EthernetNetworkDeviceDisconnected(CNetworkDevice *Device)
|
void CNetworkDevicesMgr::EthernetNetworkDeviceDisconnected(CNetworkDevice *Device)
|
||||||
{
|
{
|
||||||
qDebug("Device disconnected. ID: %d, Address: %d",Device->GetDeviceID(),Device->GetDeviceAddress());
|
qDebug("Device disconnected. ID: %d, Address: %d",Device->GetDeviceID(),Device->GetDeviceAddress());
|
||||||
|
|||||||
@ -9,7 +9,6 @@
|
|||||||
#include "AvReceiverInterface.h"
|
#include "AvReceiverInterface.h"
|
||||||
#include "ChaletInterface.h"
|
#include "ChaletInterface.h"
|
||||||
#include "IspindelInterface.h"
|
#include "IspindelInterface.h"
|
||||||
#include "LoraModuleInterfaceInterface.h"
|
|
||||||
|
|
||||||
#include "QList"
|
#include "QList"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -19,9 +18,8 @@ class CMasterCtrl;
|
|||||||
class CContactRepository;
|
class CContactRepository;
|
||||||
class CSprinklerMgr;
|
class CSprinklerMgr;
|
||||||
class CAVReceiverDevice;
|
class CAVReceiverDevice;
|
||||||
class CChaletDevice;
|
class CChaletLoraDevice;
|
||||||
class CIspindelDevice;
|
class CIspindelDevice;
|
||||||
class CLoraModuleInterface;
|
|
||||||
|
|
||||||
class CNetworkDevicesMgr: public QObject
|
class CNetworkDevicesMgr: public QObject
|
||||||
{
|
{
|
||||||
@ -39,22 +37,18 @@ public:
|
|||||||
int CreateNewAvReceiverInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
|
int CreateNewAvReceiverInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
|
||||||
int CreateNewChaletInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
|
int CreateNewChaletInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
|
||||||
int CreateNewIspindleInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
|
int CreateNewIspindleInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
|
||||||
int CreateNewLoraInterfaceInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
|
|
||||||
int BindNetworkChaletDevice(int Address, CAbstractNetworkCommIF *NetworkIF);
|
|
||||||
|
|
||||||
int FindDeviceByPtr(CNetworkDevice *Device);
|
int FindDeviceByPtr(CNetworkDevice *Device);
|
||||||
CNetworkDevice *GetDevice(int DeviceID, int Address);
|
CNetworkDevice *GetDevice(int DeviceID, int Address);
|
||||||
QList<CNetworkDevice*> GetDevices(int DeviceID);
|
QList<CNetworkDevice*> GetDevices(int DeviceID);
|
||||||
|
|
||||||
CAVReceiverDevice *mAvReceiverDevice;
|
CAVReceiverDevice *mAvReceiverDevice;
|
||||||
CChaletDevice *mChaletLoraDevice;
|
CChaletLoraDevice *mChaletLoraDevice;
|
||||||
CIspindelDevice *mIspindelDevice;
|
CIspindelDevice *mIspindelDevice;
|
||||||
CVoipMsSMSClient *mVoipMSInterfaceHandle;
|
CVoipMsSMSClient *mVoipMSInterfaceHandle;
|
||||||
CContactRepository *mContactRepositoryHandle;
|
CContactRepository *mContactRepositoryHandle;
|
||||||
CMasterCtrl *mProgramHandle;
|
CMasterCtrl *mProgramHandle;
|
||||||
CSprinklerMgr *mSprinklerMgrHandle;
|
CSprinklerMgr *mSprinklerMgrHandle;
|
||||||
CLoraModuleInterface *mLoraModuleInterfaceDevice;
|
|
||||||
CChaletDevice *mChaletLTEDevice;
|
|
||||||
|
|
||||||
int NewSMSMessagesReceived(QList<CSMSMessage> NewMessages);
|
int NewSMSMessagesReceived(QList<CSMSMessage> NewMessages);
|
||||||
|
|
||||||
|
|||||||
@ -8,9 +8,6 @@ CNetworkProtocol::CNetworkProtocol()
|
|||||||
mIsResetManual = false;
|
mIsResetManual = false;
|
||||||
ResetRxStateMachine();
|
ResetRxStateMachine();
|
||||||
|
|
||||||
mMyNetworkAddress = 1;
|
|
||||||
mMyNetworkID = ID_MASTER;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CNetworkProtocol::~CNetworkProtocol()
|
CNetworkProtocol::~CNetworkProtocol()
|
||||||
@ -158,7 +155,7 @@ QByteArray CNetworkProtocol::GetTxPacket(unsigned char MessageID, unsigned char
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
int CNetworkProtocol::RxStateMachine(unsigned char Data, bool DoStaticAnalysis)
|
int CNetworkProtocol::RxStateMachine(unsigned char Data)
|
||||||
{
|
{
|
||||||
int ret = PROTOCOL_RET_OK_PACKET_INCOMPLETE;
|
int ret = PROTOCOL_RET_OK_PACKET_INCOMPLETE;
|
||||||
|
|
||||||
@ -175,7 +172,7 @@ int CNetworkProtocol::RxStateMachine(unsigned char Data, bool DoStaticAnalysis)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ResetRxStateMachine();
|
ResetRxStateMachine();
|
||||||
ret = PROTOCOL_RET_ERROR_BAD_HEADER;
|
ret = PROTOCOL_RET_OK_BAD_HEADER;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -199,7 +196,7 @@ int CNetworkProtocol::RxStateMachine(unsigned char Data, bool DoStaticAnalysis)
|
|||||||
case RxMyID:
|
case RxMyID:
|
||||||
{
|
{
|
||||||
|
|
||||||
if(Data != mMyNetworkID && Data != 0xFF) //Message is not for Master and it's not a broadcast
|
if(Data != ID_MASTER && Data != 0xFF) //Message is not for Master and it's not a broadcast
|
||||||
{
|
{
|
||||||
ResetRxStateMachine();
|
ResetRxStateMachine();
|
||||||
ret = PROTOCOL_RET_ERROR_INVALID_TARGET_DEVICE;
|
ret = PROTOCOL_RET_ERROR_INVALID_TARGET_DEVICE;
|
||||||
@ -213,7 +210,7 @@ int CNetworkProtocol::RxStateMachine(unsigned char Data, bool DoStaticAnalysis)
|
|||||||
}
|
}
|
||||||
case RxMyAddress:
|
case RxMyAddress:
|
||||||
{
|
{
|
||||||
if(Data != mMyNetworkAddress && Data != 0xFF) //Message is not for us and it's not a broadcast
|
if(Data != 1 && Data != 0xFF) //Message is not for us and it's not a broadcast
|
||||||
{
|
{
|
||||||
ResetRxStateMachine();
|
ResetRxStateMachine();
|
||||||
ret = PROTOCOL_RET_ERROR_INVALID_TARGET_ADDRESS;
|
ret = PROTOCOL_RET_ERROR_INVALID_TARGET_ADDRESS;
|
||||||
@ -307,20 +304,16 @@ int CNetworkProtocol::RxStateMachine(unsigned char Data, bool DoStaticAnalysis)
|
|||||||
{
|
{
|
||||||
ResetRxStateMachine();
|
ResetRxStateMachine();
|
||||||
ret = PROTOCOL_RET_ERROR_BAD_CRC;
|
ret = PROTOCOL_RET_ERROR_BAD_CRC;
|
||||||
qDebug("LORA: Bad CRC");
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// mDataBuffer = QByteArray(&mRxData[DATA_START],RxSize);
|
// mDataBuffer = QByteArray(&mRxData[DATA_START],RxSize);
|
||||||
ret = PROTOCOL_RET_OK_PACKET_COMPLETE;
|
|
||||||
if(DoStaticAnalysis == false)
|
|
||||||
{
|
|
||||||
NewFrameReceived(SenderID,SenderAddress,RxCmd,RxSize,mDataBuffer);
|
NewFrameReceived(SenderID,SenderAddress,RxCmd,RxSize,mDataBuffer);
|
||||||
|
ret = PROTOCOL_RET_OK_PACKET_COMPLETE;
|
||||||
if(mIsResetManual == false)
|
if(mIsResetManual == false)
|
||||||
{
|
{
|
||||||
ResetRxStateMachine();
|
ResetRxStateMachine();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -364,7 +357,7 @@ int CNetworkProtocol::AnalyzeRxBuffer(QByteArray Buffer)
|
|||||||
ret = RxStateMachine(Buffer.at(i));
|
ret = RxStateMachine(Buffer.at(i));
|
||||||
if(ret != PROTOCOL_RET_OK_PACKET_INCOMPLETE)
|
if(ret != PROTOCOL_RET_OK_PACKET_INCOMPLETE)
|
||||||
{
|
{
|
||||||
if(ret == PROTOCOL_RET_ERROR_BAD_HEADER)
|
if(ret == PROTOCOL_RET_OK_BAD_HEADER)
|
||||||
{
|
{
|
||||||
qDebug("Protocol Bad header");
|
qDebug("Protocol Bad header");
|
||||||
}
|
}
|
||||||
@ -382,47 +375,3 @@ void CNetworkProtocol::SetManualPacketReset(bool Manual)
|
|||||||
{
|
{
|
||||||
mIsResetManual = Manual;
|
mIsResetManual = Manual;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CNetworkProtocol::ProtocolAnalyseBufferStatically(QByteArray InputBuffer, int &BufDeviceID, int &BufDeviceAddress, int &BufMessageID, int &BufDataSize, QByteArray &BufData)
|
|
||||||
{
|
|
||||||
int ret = PROTOCOL_RET_ERROR_EMPTY_BUFFER;
|
|
||||||
for(int i = 0; i < InputBuffer.size(); i++)
|
|
||||||
{
|
|
||||||
ret = RxStateMachine(InputBuffer.at(i));
|
|
||||||
if(ret != PROTOCOL_RET_OK_PACKET_INCOMPLETE)
|
|
||||||
{
|
|
||||||
if(ret == PROTOCOL_RET_ERROR_BAD_HEADER)
|
|
||||||
{
|
|
||||||
qDebug("Protocol Bad header");
|
|
||||||
}
|
|
||||||
if(ret == PROTOCOL_RET_OK_PACKET_COMPLETE)
|
|
||||||
{
|
|
||||||
BufDeviceID = SenderID;
|
|
||||||
BufDeviceAddress = SenderAddress;
|
|
||||||
BufMessageID = RxCmd;
|
|
||||||
BufDataSize = RxSize;
|
|
||||||
BufData = mDataBuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
ResetRxStateMachine();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ResetRxStateMachine();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CNetworkProtocol::ProtocolIsBusyReceiving()
|
|
||||||
{
|
|
||||||
if(RxState == RxHeader)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CNetworkProtocol::NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data)
|
|
||||||
{
|
|
||||||
return RET_ERROR;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -18,16 +18,13 @@ public:
|
|||||||
void PrepareForNewPacket();
|
void PrepareForNewPacket();
|
||||||
void SetManualPacketReset(bool Manual);
|
void SetManualPacketReset(bool Manual);
|
||||||
|
|
||||||
virtual int NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);// = 0;
|
virtual int NewFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data) = 0;
|
||||||
|
|
||||||
unsigned char mMyNetworkAddress;
|
|
||||||
unsigned char mMyNetworkID;
|
|
||||||
|
|
||||||
enum ProtocolRetValues
|
enum ProtocolRetValues
|
||||||
{
|
{
|
||||||
PROTOCOL_RET_OK_PACKET_COMPLETE,
|
PROTOCOL_RET_OK_PACKET_COMPLETE,
|
||||||
PROTOCOL_RET_OK_PACKET_INCOMPLETE,
|
PROTOCOL_RET_OK_PACKET_INCOMPLETE,
|
||||||
PROTOCOL_RET_ERROR_BAD_HEADER,
|
PROTOCOL_RET_OK_BAD_HEADER,
|
||||||
PROTOCOL_RET_ERROR_INVALID_TARGET_DEVICE,
|
PROTOCOL_RET_ERROR_INVALID_TARGET_DEVICE,
|
||||||
PROTOCOL_RET_ERROR_INVALID_TARGET_ADDRESS,
|
PROTOCOL_RET_ERROR_INVALID_TARGET_ADDRESS,
|
||||||
PROTOCOL_RET_ERROR_BAD_CRC,
|
PROTOCOL_RET_ERROR_BAD_CRC,
|
||||||
@ -40,8 +37,6 @@ public:
|
|||||||
int ProtocolGetCmd(){return RxCmd;}
|
int ProtocolGetCmd(){return RxCmd;}
|
||||||
int ProtocolGetDataSize(){return RxSize;}
|
int ProtocolGetDataSize(){return RxSize;}
|
||||||
QByteArray ProtocolGetData(){return mDataBuffer;}
|
QByteArray ProtocolGetData(){return mDataBuffer;}
|
||||||
int ProtocolAnalyseBufferStatically(QByteArray InputBuffer, int &BufDeviceID, int &BufDeviceAddress, int &BufMessageID, int &BufDataSize, QByteArray &BufData);
|
|
||||||
bool ProtocolIsBusyReceiving();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -49,7 +44,7 @@ private:
|
|||||||
unsigned char CalcCRC(char *Buffer, int Size);
|
unsigned char CalcCRC(char *Buffer, int Size);
|
||||||
// int TxData(unsigned char MessageID,unsigned char Flags,unsigned char *Data,int Size, unsigned char Address,unsigned char ID);
|
// int TxData(unsigned char MessageID,unsigned char Flags,unsigned char *Data,int Size, unsigned char Address,unsigned char ID);
|
||||||
|
|
||||||
int RxStateMachine(unsigned char Data, bool DoStaticAnalysis = false);
|
int RxStateMachine(unsigned char Data);
|
||||||
|
|
||||||
//State Machine states
|
//State Machine states
|
||||||
enum States
|
enum States
|
||||||
|
|||||||
@ -51,10 +51,6 @@ void CProgramSettings::LoadDefaultSettings(CSettings *Settings)
|
|||||||
Settings->mVoipMSSettings.mPassword = "Voip.ms Password";
|
Settings->mVoipMSSettings.mPassword = "Voip.ms Password";
|
||||||
Settings->mVoipMSSettings.mUsername = "Voip.ms Username";
|
Settings->mVoipMSSettings.mUsername = "Voip.ms Username";
|
||||||
Settings->mVoipMSSettings.mStartDate = QDate::currentDate();
|
Settings->mVoipMSSettings.mStartDate = QDate::currentDate();
|
||||||
Settings->mChaletComPort = "COM3";
|
|
||||||
Settings->mChaletLoraAddress = 6;
|
|
||||||
Settings->mChaletLoraChannel = 4;
|
|
||||||
Settings->mChaletUseLoraIF = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int CProgramSettings::SaveSettings(CSettings *SettingsData)
|
unsigned int CProgramSettings::SaveSettings(CSettings *SettingsData)
|
||||||
@ -93,10 +89,6 @@ unsigned int CProgramSettings::SaveSettings(CSettings *SettingsData)
|
|||||||
QDataStream &operator<<(QDataStream &out, const CSettings &source)
|
QDataStream &operator<<(QDataStream &out, const CSettings &source)
|
||||||
{
|
{
|
||||||
out << source.mVoipMSSettings;
|
out << source.mVoipMSSettings;
|
||||||
out << source.mChaletComPort;
|
|
||||||
out << source.mChaletLoraAddress;
|
|
||||||
out << source.mChaletLoraChannel;
|
|
||||||
out << source.mChaletUseLoraIF;
|
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
@ -104,10 +96,6 @@ QDataStream &operator<<(QDataStream &out, const CSettings &source)
|
|||||||
QDataStream &operator>>(QDataStream &in, CSettings &dest)
|
QDataStream &operator>>(QDataStream &in, CSettings &dest)
|
||||||
{
|
{
|
||||||
in >> dest.mVoipMSSettings;
|
in >> dest.mVoipMSSettings;
|
||||||
in >> dest.mChaletComPort;
|
|
||||||
in >> dest.mChaletLoraAddress;
|
|
||||||
in >> dest.mChaletLoraChannel;
|
|
||||||
in >> dest.mChaletUseLoraIF;
|
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
@ -154,9 +142,5 @@ CSettings& CSettings::operator =(const CSettings &source)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
this->mVoipMSSettings = source.mVoipMSSettings;
|
this->mVoipMSSettings = source.mVoipMSSettings;
|
||||||
this->mChaletComPort = source.mChaletComPort;
|
|
||||||
this->mChaletLoraAddress = source.mChaletLoraAddress;
|
|
||||||
this->mChaletLoraChannel = source.mChaletLoraChannel;
|
|
||||||
this->mChaletUseLoraIF = source.mChaletUseLoraIF;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,11 +27,6 @@ class CSettings
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CVoipMSSMSSettings mVoipMSSettings;
|
CVoipMSSMSSettings mVoipMSSettings;
|
||||||
QString mChaletComPort;
|
|
||||||
quint16 mChaletLoraAddress;
|
|
||||||
quint8 mChaletLoraChannel;
|
|
||||||
bool mChaletUseLoraIF;
|
|
||||||
|
|
||||||
|
|
||||||
CSettings &operator=(const CSettings &source);
|
CSettings &operator=(const CSettings &source);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -61,8 +61,6 @@ enum DEVICES_IDS
|
|||||||
ID_CHALET_INTERFACE,
|
ID_CHALET_INTERFACE,
|
||||||
ID_CHALET_DEVICE,
|
ID_CHALET_DEVICE,
|
||||||
ID_ISPINDEL_INTERFACE,
|
ID_ISPINDEL_INTERFACE,
|
||||||
ID_LORA_INTERFACE_DEVICE,
|
|
||||||
ID_LORA_INTERFACE_INTERFACE,
|
|
||||||
ID_NB_DEVICE_ID
|
ID_NB_DEVICE_ID
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -238,24 +236,14 @@ enum AV_RECEIVER_INTERFACE_CMDS
|
|||||||
AV_RECEIVER_INTERFACE_GENERAL_STATUS_RESPONSE,
|
AV_RECEIVER_INTERFACE_GENERAL_STATUS_RESPONSE,
|
||||||
AV_RECEIVER_INTERFACE_SET_MAIN_POWER_REQUEST,
|
AV_RECEIVER_INTERFACE_SET_MAIN_POWER_REQUEST,
|
||||||
AV_RECEIVER_INTERFACE_SET_MAIN_POWER_RESPONSE,
|
AV_RECEIVER_INTERFACE_SET_MAIN_POWER_RESPONSE,
|
||||||
AV_RECEIVER_INTERFACE_SET_ZONE2_REQUEST,
|
AV_RECEIVER_INTERFACE_SET_SPEAKERB_REQUEST,
|
||||||
AV_RECEIVER_INTERFACE_SET_ZONE2_RESPONSE,
|
AV_RECEIVER_INTERFACE_SET_SPEAKERB_RESPONSE,
|
||||||
AV_RECEIVER_INTERFACE_SET_MAIN_ZONE_REQUEST,
|
AV_RECEIVER_INTERFACE_SET_SPEAKERA_REQUEST,
|
||||||
AV_RECEIVER_INTERFACE_SET_MAIN_ZONE_RESPONSE,
|
AV_RECEIVER_INTERFACE_SET_SPEAKERA_RESPONSE,
|
||||||
AV_RECEIVER_INTERFACE_SET_SPEAKERS_REQUEST,
|
AV_RECEIVER_INTERFACE_SET_SPEAKERS_REQUEST,
|
||||||
AV_RECEIVER_INTERFACE_SET_SPEAKERS_RESPONSE,
|
AV_RECEIVER_INTERFACE_SET_SPEAKERS_RESPONSE,
|
||||||
AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_REQUEST,
|
AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_REQUEST,
|
||||||
AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_RESPONSE,
|
AV_RECEIVER_INTERFACE_SEND_DIRECT_CMD_RESPONSE,
|
||||||
AV_RECEIVER_INTERFACE_SELECT_SCENE_REQUEST,
|
|
||||||
AV_RECEIVER_INTERFACE_SELECT_SCENE_RESPONSE,
|
|
||||||
AV_RECEIVER_INTERFACE_SET_MAIN_VOLUME_REQUEST,
|
|
||||||
AV_RECEIVER_INTERFACE_SET_MAIN_VOLUME_RESPONSE,
|
|
||||||
AV_RECEIVER_INTERFACE_SET_ZONE2_VOLUME_REQUEST,
|
|
||||||
AV_RECEIVER_INTERFACE_SET_ZONE2_VOLUME_RESPONSE,
|
|
||||||
AV_RECEIVER_INTERFACE_SET_ZONE2_INPUT_REQUEST,
|
|
||||||
AV_RECEIVER_INTERFACE_SET_ZONE2_INPUT_RESPONSE,
|
|
||||||
AV_RECEIVER_INTERFACE_SET_SYNC_Z2_WITH_Z1_REQUEST,
|
|
||||||
AV_RECEIVER_INTERFACE_SET_SYNC_Z2_WITH_Z1_RESPONSE,
|
|
||||||
|
|
||||||
|
|
||||||
MAX_AV_RECEIVER_INTERFACE_CMD
|
MAX_AV_RECEIVER_INTERFACE_CMD
|
||||||
@ -291,8 +279,6 @@ enum CHALET_INTERFACE_CMDS
|
|||||||
CHALET_INTERFACE_GET_FIRMWARE_VERSION_RESPONSE,
|
CHALET_INTERFACE_GET_FIRMWARE_VERSION_RESPONSE,
|
||||||
CHALET_INTERFACE_CLEAR_COMMS_STATS_REQUEST,
|
CHALET_INTERFACE_CLEAR_COMMS_STATS_REQUEST,
|
||||||
CHALET_INTERFACE_CLEAR_COMMS_STATS_RESPONSE,
|
CHALET_INTERFACE_CLEAR_COMMS_STATS_RESPONSE,
|
||||||
CHALET_INTERFACE_GET_WIFI_STATUS_REQUEST,
|
|
||||||
CHALET_INTERFACE_GET_WIFI_STATUS_RESPONSE,
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -333,40 +319,6 @@ enum CHALET_CMDS
|
|||||||
MAX_CHALET_CMD
|
MAX_CHALET_CMD
|
||||||
};
|
};
|
||||||
|
|
||||||
enum BOOTLOADER_CMDS
|
|
||||||
{
|
|
||||||
BOOTLOADER_ACK = 1,
|
|
||||||
BOOTLOADER_HEARTBEAT_REQUEST,
|
|
||||||
BOOTLOADER_HEARTBEAT_RESPONSE,
|
|
||||||
BOOTLOADER_ERASE_BOOTLOADER_FLASH_REQUEST,
|
|
||||||
BOOTLOADER_ERASE_BOOTLOADER_FLASH_RESPONSE,
|
|
||||||
BOOTLOADER_ERASE_BOOTLOADER_FLASH_RESULT_RESPONSE,
|
|
||||||
BOOTLOADER_INIT_UPLOAD_REQUEST,
|
|
||||||
BOOTLOADER_INIT_UPLOAD_RESPONSE,
|
|
||||||
BOOTLOADER_GET_STATE_REQUEST,
|
|
||||||
BOOTLOADER_GET_STATE_RESPONSE,
|
|
||||||
BOOTLOADER_READY_FOR_DATA_RESPONSE,
|
|
||||||
BOOTLOADER_SEND_DATA_CHUNK_REQUEST,
|
|
||||||
BOOTLOADER_SEND_DATA_CHUNK_RESPONSE,
|
|
||||||
BOOTLOADER_UPLOAD_FINISHED_REQUEST,
|
|
||||||
BOOTLOADER_UPLOAD_FINISHED_RESPONSE,
|
|
||||||
BOOTLOADER_EXECUTE_UPGRAGE_REQUEST,
|
|
||||||
BOOTLOADER_EXECUTE_UPGRADE_RESPONSE,
|
|
||||||
BOOTLOADER_ABORT_OPERATION_REQUEST,
|
|
||||||
BOOTLOADER_ABORT_OPERATION_RESPONSE,
|
|
||||||
BOOTLOADER_SEND_FLASH_DATA_REQUEST,
|
|
||||||
BOOTLOADER_SEND_FLASH_DATA_RESPONSE,
|
|
||||||
BOOTLOADER_SEND_FLASH_DATA_CHUNK,
|
|
||||||
BOOTLOADER_SEND_FLASH_DATA_CHUNK_RESPONSE,
|
|
||||||
BOOTLOADER_CHECK_FLASH_FIRMW_INTEGRITY_REQUEST,
|
|
||||||
BOOTLOADER_CHECK_FLASH_FIRMW_INTEGRITY_RESPONSE,
|
|
||||||
BOOTLOADER_GET_STORED_FIRMWARE_INFO_REQUEST,
|
|
||||||
BOOTLOADER_GET_STORED_FIRMWARE_INFO_RESPONSE,
|
|
||||||
|
|
||||||
|
|
||||||
MAX_BOOTLOADER_CMD
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ISPINDLE_CMDS
|
enum ISPINDLE_CMDS
|
||||||
{
|
{
|
||||||
ISPINDLE_ACK = 1,
|
ISPINDLE_ACK = 1,
|
||||||
@ -380,32 +332,4 @@ enum ISPINDLE_CMDS
|
|||||||
MAX_ISPINDLE_CMDS
|
MAX_ISPINDLE_CMDS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LORA_INTERFACE_CMDS
|
|
||||||
{
|
|
||||||
LORA_IF_ACK = 1,
|
|
||||||
LORA_IF_GET_STATUS_REQUEST,
|
|
||||||
LORA_IF_GET_STATUS_RESPONSE,
|
|
||||||
LORA_IF_SEND_FRAME_REQUEST,
|
|
||||||
LORA_IF_SEND_FRAME_RESPONSE,
|
|
||||||
LORA_IF_NEW_FRAME_RESPONSE,
|
|
||||||
LORA_IF_GET_MODULE_CONFIG_REQUEST,
|
|
||||||
LORA_IF_GET_MODULE_CONFIG_RESPONSE,
|
|
||||||
LORA_IF_GET_RSSI_REQUEST,
|
|
||||||
LORA_IF_GET_RSSI_RESPONSE,
|
|
||||||
LORA_IF_SET_MODULE_CONFIG_REQUEST,
|
|
||||||
LORA_IF_SET_MODULE_CONFIG_RESPONSE,
|
|
||||||
|
|
||||||
MAX_LORA_IF_CMD
|
|
||||||
};
|
|
||||||
|
|
||||||
enum LORA_MODULE_IF_INTERFACE_CMDS
|
|
||||||
{
|
|
||||||
LORA_MODULE_IF_INTERFACE_ACK = 1,
|
|
||||||
LORA_MODULE_IF_INTERFACE_GENERAL_STATUS_REQUEST,
|
|
||||||
LORA_MODULE_IF_INTERFACE_GENERAL_STATUS_RESPONSE,
|
|
||||||
|
|
||||||
|
|
||||||
MAX_LORA_MODULE_IF_INTERFACE_CMD
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,139 +0,0 @@
|
|||||||
/********************************************************************************
|
|
||||||
** Form generated from reading UI file 'LoraSettingsGui.ui'
|
|
||||||
**
|
|
||||||
** Created by: Qt User Interface Compiler version 5.14.2
|
|
||||||
**
|
|
||||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
|
||||||
********************************************************************************/
|
|
||||||
|
|
||||||
#ifndef UI_LORASETTINGSGUI_H
|
|
||||||
#define UI_LORASETTINGSGUI_H
|
|
||||||
|
|
||||||
#include <QtCore/QVariant>
|
|
||||||
#include <QtWidgets/QApplication>
|
|
||||||
#include <QtWidgets/QCheckBox>
|
|
||||||
#include <QtWidgets/QComboBox>
|
|
||||||
#include <QtWidgets/QGroupBox>
|
|
||||||
#include <QtWidgets/QLabel>
|
|
||||||
#include <QtWidgets/QSpinBox>
|
|
||||||
#include <QtWidgets/QWidget>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
class Ui_CLoraSettingsGui
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QLabel *label;
|
|
||||||
QGroupBox *groupBox;
|
|
||||||
QLabel *label_2;
|
|
||||||
QLabel *label_3;
|
|
||||||
QSpinBox *mLoraAddressSpinBx;
|
|
||||||
QComboBox *mComportComboBox;
|
|
||||||
QLabel *label_5;
|
|
||||||
QLabel *label_6;
|
|
||||||
QCheckBox *mUseLoraIFCheckBx;
|
|
||||||
QSpinBox *mLoraChannelSpinBx;
|
|
||||||
QLabel *label_4;
|
|
||||||
QCheckBox *checkBox;
|
|
||||||
|
|
||||||
void setupUi(QWidget *CLoraSettingsGui)
|
|
||||||
{
|
|
||||||
if (CLoraSettingsGui->objectName().isEmpty())
|
|
||||||
CLoraSettingsGui->setObjectName(QString::fromUtf8("CLoraSettingsGui"));
|
|
||||||
CLoraSettingsGui->resize(553, 413);
|
|
||||||
label = new QLabel(CLoraSettingsGui);
|
|
||||||
label->setObjectName(QString::fromUtf8("label"));
|
|
||||||
label->setGeometry(QRect(100, 10, 151, 16));
|
|
||||||
QFont font;
|
|
||||||
font.setPointSize(12);
|
|
||||||
label->setFont(font);
|
|
||||||
groupBox = new QGroupBox(CLoraSettingsGui);
|
|
||||||
groupBox->setObjectName(QString::fromUtf8("groupBox"));
|
|
||||||
groupBox->setGeometry(QRect(110, 170, 221, 191));
|
|
||||||
label_2 = new QLabel(groupBox);
|
|
||||||
label_2->setObjectName(QString::fromUtf8("label_2"));
|
|
||||||
label_2->setGeometry(QRect(10, 40, 71, 16));
|
|
||||||
label_3 = new QLabel(groupBox);
|
|
||||||
label_3->setObjectName(QString::fromUtf8("label_3"));
|
|
||||||
label_3->setGeometry(QRect(10, 20, 71, 16));
|
|
||||||
mLoraAddressSpinBx = new QSpinBox(groupBox);
|
|
||||||
mLoraAddressSpinBx->setObjectName(QString::fromUtf8("mLoraAddressSpinBx"));
|
|
||||||
mLoraAddressSpinBx->setGeometry(QRect(90, 40, 71, 22));
|
|
||||||
mLoraAddressSpinBx->setMinimum(1);
|
|
||||||
mLoraAddressSpinBx->setMaximum(65535);
|
|
||||||
mLoraAddressSpinBx->setValue(6);
|
|
||||||
mComportComboBox = new QComboBox(groupBox);
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->addItem(QString());
|
|
||||||
mComportComboBox->setObjectName(QString::fromUtf8("mComportComboBox"));
|
|
||||||
mComportComboBox->setGeometry(QRect(80, 80, 69, 22));
|
|
||||||
label_5 = new QLabel(groupBox);
|
|
||||||
label_5->setObjectName(QString::fromUtf8("label_5"));
|
|
||||||
label_5->setGeometry(QRect(20, 80, 51, 16));
|
|
||||||
label_6 = new QLabel(groupBox);
|
|
||||||
label_6->setObjectName(QString::fromUtf8("label_6"));
|
|
||||||
label_6->setGeometry(QRect(20, 110, 91, 31));
|
|
||||||
mUseLoraIFCheckBx = new QCheckBox(groupBox);
|
|
||||||
mUseLoraIFCheckBx->setObjectName(QString::fromUtf8("mUseLoraIFCheckBx"));
|
|
||||||
mUseLoraIFCheckBx->setGeometry(QRect(20, 160, 191, 20));
|
|
||||||
mLoraChannelSpinBx = new QSpinBox(groupBox);
|
|
||||||
mLoraChannelSpinBx->setObjectName(QString::fromUtf8("mLoraChannelSpinBx"));
|
|
||||||
mLoraChannelSpinBx->setGeometry(QRect(90, 20, 71, 22));
|
|
||||||
mLoraChannelSpinBx->setMinimum(1);
|
|
||||||
mLoraChannelSpinBx->setMaximum(65535);
|
|
||||||
mLoraChannelSpinBx->setValue(6);
|
|
||||||
label_4 = new QLabel(groupBox);
|
|
||||||
label_4->setObjectName(QString::fromUtf8("label_4"));
|
|
||||||
label_4->setGeometry(QRect(200, 30, 71, 16));
|
|
||||||
checkBox = new QCheckBox(CLoraSettingsGui);
|
|
||||||
checkBox->setObjectName(QString::fromUtf8("checkBox"));
|
|
||||||
checkBox->setGeometry(QRect(70, 60, 281, 20));
|
|
||||||
|
|
||||||
retranslateUi(CLoraSettingsGui);
|
|
||||||
|
|
||||||
QMetaObject::connectSlotsByName(CLoraSettingsGui);
|
|
||||||
} // setupUi
|
|
||||||
|
|
||||||
void retranslateUi(QWidget *CLoraSettingsGui)
|
|
||||||
{
|
|
||||||
CLoraSettingsGui->setWindowTitle(QCoreApplication::translate("CLoraSettingsGui", "Form", nullptr));
|
|
||||||
label->setText(QCoreApplication::translate("CLoraSettingsGui", "Chalet Settings", nullptr));
|
|
||||||
groupBox->setTitle(QCoreApplication::translate("CLoraSettingsGui", "LoRa", nullptr));
|
|
||||||
label_2->setText(QCoreApplication::translate("CLoraSettingsGui", "Lora Address:", nullptr));
|
|
||||||
label_3->setText(QCoreApplication::translate("CLoraSettingsGui", "Lora Channel:", nullptr));
|
|
||||||
mComportComboBox->setItemText(0, QCoreApplication::translate("CLoraSettingsGui", "COM1", nullptr));
|
|
||||||
mComportComboBox->setItemText(1, QCoreApplication::translate("CLoraSettingsGui", "COM2", nullptr));
|
|
||||||
mComportComboBox->setItemText(2, QCoreApplication::translate("CLoraSettingsGui", "COM3", nullptr));
|
|
||||||
mComportComboBox->setItemText(3, QCoreApplication::translate("CLoraSettingsGui", "COM4", nullptr));
|
|
||||||
mComportComboBox->setItemText(4, QCoreApplication::translate("CLoraSettingsGui", "COM5", nullptr));
|
|
||||||
mComportComboBox->setItemText(5, QCoreApplication::translate("CLoraSettingsGui", "COM6", nullptr));
|
|
||||||
mComportComboBox->setItemText(6, QCoreApplication::translate("CLoraSettingsGui", "COM7", nullptr));
|
|
||||||
mComportComboBox->setItemText(7, QCoreApplication::translate("CLoraSettingsGui", "COM8", nullptr));
|
|
||||||
mComportComboBox->setItemText(8, QCoreApplication::translate("CLoraSettingsGui", "COM9", nullptr));
|
|
||||||
mComportComboBox->setItemText(9, QCoreApplication::translate("CLoraSettingsGui", "COM10", nullptr));
|
|
||||||
|
|
||||||
label_5->setText(QCoreApplication::translate("CLoraSettingsGui", "Com Port:", nullptr));
|
|
||||||
label_6->setText(QCoreApplication::translate("CLoraSettingsGui", "Chalet = 7\n"
|
|
||||||
"Chaloupe = 8", nullptr));
|
|
||||||
mUseLoraIFCheckBx->setText(QCoreApplication::translate("CLoraSettingsGui", "Use LoraInterface (restart needed)", nullptr));
|
|
||||||
label_4->setText(QCoreApplication::translate("CLoraSettingsGui", "4", nullptr));
|
|
||||||
checkBox->setText(QCoreApplication::translate("CLoraSettingsGui", "Use LTE interface (restart needed)", nullptr));
|
|
||||||
} // retranslateUi
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class CLoraSettingsGui: public Ui_CLoraSettingsGui {};
|
|
||||||
} // namespace Ui
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // UI_LORASETTINGSGUI_H
|
|
||||||
Loading…
x
Reference in New Issue
Block a user