diff --git a/Configuration/Settings.mcs b/Configuration/Settings.mcs
index 93f7ef7..6feb94e 100644
Binary files a/Configuration/Settings.mcs and b/Configuration/Settings.mcs differ
diff --git a/MasterCtrl.pro.user.5a351af b/MasterCtrl.pro.user.5a351af
new file mode 100644
index 0000000..18619b5
--- /dev/null
+++ b/MasterCtrl.pro.user.5a351af
@@ -0,0 +1,264 @@
+
+
+
+
+
+ EnvironmentId
+ {5a351af6-dc3b-4afc-af92-7da5e3a5cd12}
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ true
+ false
+ 0
+ true
+ true
+ 0
+ 8
+ true
+ 1
+ true
+ true
+ true
+ false
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Qt 5.14.2
+ Qt 5.14.2
+ {dc2b548b-27bc-4e25-8500-cc36640735d8}
+ 0
+ 0
+ 0
+
+ D:/Main/PicDev/Projets/MasterCtrl/Masterctrl
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ true
+
+ false
+ false
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ false
+
+
+
+ 2
+ Build
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ true
+ clean
+
+
+ 1
+ Clean
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Debug
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+ true
+
+
+ D:/Main/PicDev/Projets/MasterCtrl/Masterctrl/release
+
+
+ true
+ qmake
+
+ QtProjectManager.QMakeBuildStep
+ false
+
+ false
+ false
+ false
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ false
+
+
+
+ 2
+ Build
+
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Make
+
+ Qt4ProjectManager.MakeStep
+
+ true
+ clean
+
+
+ 1
+ Clean
+
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Release
+
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ true
+
+ 2
+
+
+ 0
+ Deploy
+
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+ Deploy locally
+
+ ProjectExplorer.DefaultDeployConfiguration
+
+ 1
+
+
+ false
+ false
+ 1000
+
+ true
+
+ false
+ false
+ false
+ false
+ true
+ 0.01
+ 10
+ true
+ 1
+ 25
+
+ 1
+ true
+ false
+ true
+ valgrind
+
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+
+ 2
+
+ MasterCtrl
+
+ Qt4ProjectManager.Qt4RunConfiguration:D:/Main/PicDev/Projets/MasterCtrl/Masterctrl/MasterCtrl.pro
+ true
+
+ MasterCtrl.pro
+ false
+
+ D:/Main/PicDev/Projets/MasterCtrl/Masterctrl
+ 3768
+ false
+ true
+ false
+ false
+ true
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 18
+
+
+ Version
+ 18
+
+
diff --git a/Sources/Gui/LoraSettingsGui.cpp b/Sources/Gui/LoraSettingsGui.cpp
index af3aa74..950253d 100644
--- a/Sources/Gui/LoraSettingsGui.cpp
+++ b/Sources/Gui/LoraSettingsGui.cpp
@@ -18,6 +18,7 @@ CLoraSettingsGui::SetSettings(CSettings *settings)
{
ui->mLoraAddressSpinBx->setValue(settings->mChaletLoraAddress);
ui->mComportComboBox->setCurrentText(settings->mChaletComPort);
+ ui->mUseLoraIFCheckBx->setChecked(settings->mChaletUseLoraIF);
return RET_OK;
}
@@ -36,3 +37,8 @@ QString CLoraSettingsGui::GetChaletLoraComPort()
{
return ui->mComportComboBox->currentText();
}
+
+bool CLoraSettingsGui::GetChaletUseLoraIF()
+{
+ return ui->mUseLoraIFCheckBx->isChecked();
+}
diff --git a/Sources/Gui/LoraSettingsGui.h b/Sources/Gui/LoraSettingsGui.h
index 79c3f9e..fbc5a53 100644
--- a/Sources/Gui/LoraSettingsGui.h
+++ b/Sources/Gui/LoraSettingsGui.h
@@ -20,6 +20,7 @@ public:
QString GetChaletLoraComPort();
quint8 GetChaletLoraChannel();
quint16 GetChaletLoraAddress();
+ bool GetChaletUseLoraIF();
private:
Ui::CLoraSettingsGui *ui;
diff --git a/Sources/Gui/LoraSettingsGui.ui b/Sources/Gui/LoraSettingsGui.ui
index b318871..f2ed8b5 100644
--- a/Sources/Gui/LoraSettingsGui.ui
+++ b/Sources/Gui/LoraSettingsGui.ui
@@ -188,6 +188,19 @@
Chaloupe = 8
+
+
+
+ 20
+ 160
+ 191
+ 20
+
+
+
+ Use LoraInterface (restart needed)
+
+
diff --git a/Sources/Gui/SettingsWindow.cpp b/Sources/Gui/SettingsWindow.cpp
index d27d565..51938f5 100644
--- a/Sources/Gui/SettingsWindow.cpp
+++ b/Sources/Gui/SettingsWindow.cpp
@@ -235,6 +235,7 @@ void CSettingsWindow::DoneButtonClicked(bool checked)
Settings->mChaletComPort = mLoraSettingsPage->GetChaletLoraComPort();
Settings->mChaletLoraAddress = mLoraSettingsPage->GetChaletLoraAddress();
Settings->mChaletLoraChannel = mLoraSettingsPage->GetChaletLoraChannel();
+ Settings->mChaletUseLoraIF = mLoraSettingsPage->GetChaletUseLoraIF();
mProgramHandle->SaveSettings(Settings);
mProgramHandle->SettingsWindowClosed();
diff --git a/Sources/LoraModuleInterface/LoraModuleInterface.cpp b/Sources/LoraModuleInterface/LoraModuleInterface.cpp
index aa4907b..e495cdf 100644
--- a/Sources/LoraModuleInterface/LoraModuleInterface.cpp
+++ b/Sources/LoraModuleInterface/LoraModuleInterface.cpp
@@ -21,12 +21,71 @@ CLoraModuleInterface::~CLoraModuleInterface()
//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:
+ {
+ unsigned char model = Data.at(0);
+ qDebug("LoraModuleInterface status received : %d",model);
+ 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
+ {
+ 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 to answer to CChaletDevice requests
+//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");
return RET_OK;
}
@@ -34,7 +93,9 @@ int CLoraModuleInterface::SendNetworkMessage(int DeviceID, int DeviceAddress, in
void CLoraModuleInterface::LoraModuleStatusTimerExpired()
{
-
+ QByteArray Packet = GetTxPacket(LORA_IF_GET_STATUS_REQUEST,0,0,0,1,ID_LORA_INTERFACE);
+ mLoraModuleIFSerialPort.write(Packet);
+ mLoraModuleIFSerialPort.waitForBytesWritten(500);
}
int CLoraModuleInterface::SetLoraModuleInterfaceParameters(QString ComPort, qint32 BaudRate)
@@ -61,7 +122,7 @@ int CLoraModuleInterface::SetLoraModuleInterfaceParameters(QString ComPort, qint
return RET_ERROR;
}
- qDebug("Lora serial port opened");
+ qDebug("LoraModuleInterface serial port opened");
return RET_OK;
diff --git a/Sources/LoraModuleInterface/LoraModuleInterface.h b/Sources/LoraModuleInterface/LoraModuleInterface.h
index 2659b64..60a141c 100644
--- a/Sources/LoraModuleInterface/LoraModuleInterface.h
+++ b/Sources/LoraModuleInterface/LoraModuleInterface.h
@@ -9,6 +9,7 @@
#include "NetworkDevice.h"
#include
#include
+#include
class CLoraModuleInterface : public QObject, public CNetworkProtocol, public CAbstractNetworkCommIF
{
@@ -16,7 +17,7 @@ class CLoraModuleInterface : public QObject, public CNetworkProtocol, public CAb
public:
CLoraModuleInterface();
- ~CLoraModuleInterface();
+ virtual ~CLoraModuleInterface();
int SetLoraModuleInterfaceParameters(QString ComPort,qint32 BaudRate);
diff --git a/Sources/LoraNetworkCommIF.cpp b/Sources/LoraNetworkCommIF.cpp
index 81b4160..e897b51 100644
--- a/Sources/LoraNetworkCommIF.cpp
+++ b/Sources/LoraNetworkCommIF.cpp
@@ -66,7 +66,7 @@ int CLoraNetworkCommIF::SendLoraFrame(unsigned short DestAddress, unsigned char
{
mLoraDeviceSerialPort.write(GetLoraFrame(DestAddress,DestChannel,Payload));
- mLoraDeviceSerialPort.write(Payload);
+ // mLoraDeviceSerialPort.write(Payload);
mLoraDeviceSerialPort.waitForBytesWritten(500);
return RET_OK;
@@ -77,7 +77,7 @@ void CLoraNetworkCommIF::LoraDeviceNewDataReady()
{
QByteArray NewData = mLoraDeviceSerialPort.readAll();
- // QString Printf = "New Lora Data: ";
+// QString Printf = "New Lora Data: ";
AnalyzeRxBuffer(NewData);
diff --git a/Sources/MasterCtrl.cpp b/Sources/MasterCtrl.cpp
index 5e1da92..474a0d2 100644
--- a/Sources/MasterCtrl.cpp
+++ b/Sources/MasterCtrl.cpp
@@ -7,6 +7,10 @@
CMasterCtrl::CMasterCtrl()
{
qDebug("Creation...");
+
+ mChaletLoraModuleInterface = 0;
+ mChaletLoraNetworkCommInterface = 0;
+
// mDeadBoltDevice = new CDeadboltDevice(1);
mAVReceiverDevice = new CAVReceiverDevice();
mVoipMsSMSClient = new CVoipMsSMSClient;
@@ -15,12 +19,24 @@ CMasterCtrl::CMasterCtrl()
mSettingsWindow = new CSettingsWindow();
mSettingsWindow->mProgramHandle = this;
+ mSettingsManager.LoadSettings(&mMasterCtrlSettings);
+
+
+
+
+
+ if(mMasterCtrlSettings.mChaletUseLoraIF == true)
+ {
+ mChaletLoraModuleInterface = new CLoraModuleInterface(); //JFM LoraInterface Dev
+ mChaletLoraDevice = new CChaletLoraDevice(1,mChaletLoraModuleInterface); //JFM LoraInterface Dev
+ }
+ else
+ {
+ mChaletLoraNetworkCommInterface = new CLoraNetworkCommIF();//JFM LoraInterface Dev
+ mChaletLoraDevice = new CChaletLoraDevice(1,mChaletLoraNetworkCommInterface);//JFM LoraInterface Dev
+ }
-// mChaletLoraNetworkCommInterface = new CLoraNetworkCommIF();//JFM LoraInterface Dev
- mChaletLoraModuleInterface = new CLoraModuleInterface();
-// mChaletLoraDevice = new CChaletLoraDevice(1,mChaletLoraNetworkCommInterface);//JFM LoraInterface Dev
- mChaletLoraDevice = new CChaletLoraDevice(1,mChaletLoraModuleInterface);
// mChaletLoraInterface = new CChaletLoraInterface(mRooftopTowerLoraDevice);
@@ -45,8 +61,10 @@ CMasterCtrl::~CMasterCtrl()
delete mEthernetNetworkServer;
delete mContactsRepository;
delete mSprinklerManager;
- //delete mChaletLoraNetworkCommInterface; //JFM LoraInterface Dev
- delete mChaletLoraModuleInterface;
+ if(mChaletLoraNetworkCommInterface != 0)
+ delete mChaletLoraNetworkCommInterface; //JFM LoraInterface Dev
+ if(mChaletLoraModuleInterface != 0)
+ delete mChaletLoraModuleInterface;
delete mChaletLoraDevice;
delete mIspindelDevice;
// delete mMasterCtrlSettings;
@@ -89,7 +107,7 @@ void CMasterCtrl::Start()
connect(mVoipMsSMSClient,SIGNAL(DIDSFetched(QStringList)),mSettingsWindow,SLOT(DIDsListFetched(QStringList)));
- mSettingsManager.LoadSettings(&mMasterCtrlSettings);
+
mSettingsWindow->SetSettingsData(&mMasterCtrlSettings);
mVoipMsSMSClient->SetVOIPMsSettings(&mMasterCtrlSettings.mVoipMSSettings);
mVoipMsSMSClient->DownloadSMSFromServer();
@@ -99,12 +117,21 @@ void CMasterCtrl::Start()
mAVReceiverDevice->Start();
- /* //JFM LoraInterface Dev
- mChaletLoraNetworkCommInterface->mMyLoraAddress = 5;
- mChaletLoraNetworkCommInterface->mMyLoraChannel = 4;
- mChaletLoraNetworkCommInterface->SetLoraDestinationAddress(mMasterCtrlSettings.mChaletLoraAddress,mMasterCtrlSettings.mChaletLoraChannel);
- mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600);
- */ //JFM LoraInterface Dev
+ //JFM LoraInterface Dev
+ if(mMasterCtrlSettings.mChaletUseLoraIF)
+ {
+ mChaletLoraModuleInterface->SetLoraModuleInterfaceParameters(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600);
+ }
+ else
+ {
+ mChaletLoraNetworkCommInterface->mMyLoraAddress = 5;
+ mChaletLoraNetworkCommInterface->mMyLoraChannel = 4;
+ mChaletLoraNetworkCommInterface->SetLoraDestinationAddress(mMasterCtrlSettings.mChaletLoraAddress,mMasterCtrlSettings.mChaletLoraChannel);
+ mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600);
+ }
+ //JFM LoraInterface Dev
+
+
// mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings("COM5",QSerialPort::Baud9600);
mChaletLoraDevice->Start();
@@ -152,8 +179,16 @@ unsigned int CMasterCtrl::SettingsWindowClosed()
{
mVoipMsSMSClient->SetVOIPMsSettings(&mMasterCtrlSettings.mVoipMSSettings);
mVoipMsSMSClient->DownloadSMSFromServer();
- //mChaletLoraNetworkCommInterface->SetLoraDestinationAddress(mMasterCtrlSettings.mChaletLoraAddress,mMasterCtrlSettings.mChaletLoraChannel); //JFM LoraInterface Dev
- //mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600); //JFM LoraInterface Dev
+
+ if(mChaletLoraModuleInterface != 0)
+ {
+ mChaletLoraModuleInterface->SetLoraModuleInterfaceParameters(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600);
+ }
+ if(mChaletLoraNetworkCommInterface != 0)
+ {
+ mChaletLoraNetworkCommInterface->SetLoraDestinationAddress(mMasterCtrlSettings.mChaletLoraAddress,mMasterCtrlSettings.mChaletLoraChannel); //JFM LoraInterface Dev
+ mChaletLoraNetworkCommInterface->SetLoraSerialPortSettings(mMasterCtrlSettings.mChaletComPort,QSerialPort::Baud9600); //JFM LoraInterface Dev
+ }
return RET_OK;
}
diff --git a/Sources/MasterCtrl.h b/Sources/MasterCtrl.h
index 34259e6..ee7cc30 100644
--- a/Sources/MasterCtrl.h
+++ b/Sources/MasterCtrl.h
@@ -43,7 +43,7 @@ public:
CChaletLoraDevice *mChaletLoraDevice;
// CChaletLoraInterface *mChaletLoraInterface;
-// CLoraNetworkCommIF *mChaletLoraNetworkCommInterface;
+ CLoraNetworkCommIF *mChaletLoraNetworkCommInterface;
CLoraModuleInterface *mChaletLoraModuleInterface;
// CAppIconWidget mAppWidget;
diff --git a/Sources/NetworkProtocol.cpp b/Sources/NetworkProtocol.cpp
index e226fdd..0a09511 100644
--- a/Sources/NetworkProtocol.cpp
+++ b/Sources/NetworkProtocol.cpp
@@ -155,7 +155,7 @@ QByteArray CNetworkProtocol::GetTxPacket(unsigned char MessageID, unsigned char
// }
//}
-int CNetworkProtocol::RxStateMachine(unsigned char Data)
+int CNetworkProtocol::RxStateMachine(unsigned char Data, bool DoStaticAnalysis)
{
int ret = PROTOCOL_RET_OK_PACKET_INCOMPLETE;
@@ -310,11 +310,14 @@ int CNetworkProtocol::RxStateMachine(unsigned char Data)
}
// mDataBuffer = QByteArray(&mRxData[DATA_START],RxSize);
- NewFrameReceived(SenderID,SenderAddress,RxCmd,RxSize,mDataBuffer);
ret = PROTOCOL_RET_OK_PACKET_COMPLETE;
- if(mIsResetManual == false)
+ if(DoStaticAnalysis == false)
{
- ResetRxStateMachine();
+ NewFrameReceived(SenderID,SenderAddress,RxCmd,RxSize,mDataBuffer);
+ if(mIsResetManual == false)
+ {
+ ResetRxStateMachine();
+ }
}
break;
}
@@ -360,7 +363,7 @@ int CNetworkProtocol::AnalyzeRxBuffer(QByteArray Buffer)
{
if(ret == PROTOCOL_RET_OK_BAD_HEADER)
{
- qDebug("Protocol Bad header");
+ // qDebug("Protocol Bad header");
}
else
{
@@ -376,3 +379,47 @@ void CNetworkProtocol::SetManualPacketReset(bool 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_OK_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;
+}
diff --git a/Sources/NetworkProtocol.h b/Sources/NetworkProtocol.h
index 8e1858f..6d5272b 100644
--- a/Sources/NetworkProtocol.h
+++ b/Sources/NetworkProtocol.h
@@ -18,7 +18,7 @@ public:
void PrepareForNewPacket();
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;
enum ProtocolRetValues
{
@@ -37,6 +37,8 @@ public:
int ProtocolGetCmd(){return RxCmd;}
int ProtocolGetDataSize(){return RxSize;}
QByteArray ProtocolGetData(){return mDataBuffer;}
+ int ProtocolAnalyseBufferStatically(QByteArray InputBuffer, int &BufDeviceID, int &BufDeviceAddress, int &BufMessageID, int &BufDataSize, QByteArray &BufData);
+ bool ProtocolIsBusyReceiving();
private:
@@ -44,7 +46,7 @@ private:
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 RxStateMachine(unsigned char Data);
+ int RxStateMachine(unsigned char Data, bool DoStaticAnalysis = false);
//State Machine states
enum States
diff --git a/Sources/ProgramSettings.cpp b/Sources/ProgramSettings.cpp
index 596f232..dfb9767 100644
--- a/Sources/ProgramSettings.cpp
+++ b/Sources/ProgramSettings.cpp
@@ -54,6 +54,7 @@ void CProgramSettings::LoadDefaultSettings(CSettings *Settings)
Settings->mChaletComPort = "COM3";
Settings->mChaletLoraAddress = 6;
Settings->mChaletLoraChannel = 4;
+ Settings->mChaletUseLoraIF = true;
}
unsigned int CProgramSettings::SaveSettings(CSettings *SettingsData)
@@ -95,6 +96,7 @@ QDataStream &operator<<(QDataStream &out, const CSettings &source)
out << source.mChaletComPort;
out << source.mChaletLoraAddress;
out << source.mChaletLoraChannel;
+ out << source.mChaletUseLoraIF;
return out;
}
@@ -105,6 +107,7 @@ QDataStream &operator>>(QDataStream &in, CSettings &dest)
in >> dest.mChaletComPort;
in >> dest.mChaletLoraAddress;
in >> dest.mChaletLoraChannel;
+ in >> dest.mChaletUseLoraIF;
return in;
}
@@ -154,5 +157,6 @@ CSettings& CSettings::operator =(const CSettings &source)
this->mChaletComPort = source.mChaletComPort;
this->mChaletLoraAddress = source.mChaletLoraAddress;
this->mChaletLoraChannel = source.mChaletLoraChannel;
+ this->mChaletUseLoraIF = source.mChaletUseLoraIF;
return *this;
}
diff --git a/Sources/ProgramSettings.h b/Sources/ProgramSettings.h
index c6b9ed0..f100f9a 100644
--- a/Sources/ProgramSettings.h
+++ b/Sources/ProgramSettings.h
@@ -30,6 +30,7 @@ public:
QString mChaletComPort;
quint16 mChaletLoraAddress;
quint8 mChaletLoraChannel;
+ bool mChaletUseLoraIF;
CSettings &operator=(const CSettings &source);
diff --git a/ui_LoraSettingsGui.h b/ui_LoraSettingsGui.h
index 88520f4..1ec4f4c 100644
--- a/ui_LoraSettingsGui.h
+++ b/ui_LoraSettingsGui.h
@@ -11,6 +11,7 @@
#include
#include
+#include
#include
#include
#include
@@ -31,6 +32,7 @@ public:
QComboBox *mComportComboBox;
QLabel *label_5;
QLabel *label_6;
+ QCheckBox *mUseLoraIFCheckBx;
void setupUi(QWidget *CLoraSettingsGui)
{
@@ -80,6 +82,9 @@ public:
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));
retranslateUi(CLoraSettingsGui);
@@ -108,6 +113,7 @@ public:
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));
} // retranslateUi
};