Moved sources to subdirs in project

Add sprinkler device
This commit is contained in:
J-F Martel
2017-04-12 13:23:46 -04:00
parent 2139293944
commit c7c015dab3
19 changed files with 471 additions and 67 deletions
+90
View File
@@ -0,0 +1,90 @@
#include "SprinklerDevice.h"
#include "ProtocolDefs.h"
#include <QDebug>
CSprinklerDevice::CSprinklerDevice(int Address, CAbstractNetworkCommIF *NetworkInterface):
CNetworkDevice(ID_SPRINKLER_DEVICE,Address,NetworkInterface)
{
}
CSprinklerDevice::~CSprinklerDevice()
{
}
int CSprinklerDevice::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data)
{
Q_UNUSED(DeviceID)
Q_UNUSED(DeviceAddress)
Q_UNUSED(DataSize)
Q_UNUSED(Data)
return RET_OK;
switch(MessageID)
{
case SPRINKLER_DEVICE_STATUS_RESPONSE:
{
break;
}
case SPRINKLER_DEVICE_ACK:
{
break;
}
case SPRINKLER_DEVICE_SET_SPRINKLER_STATE_ACK:
{
break;
}
case SPRINKLER_DEVICE_GET_SPRINKLER_STATE_RESPONSE:
{
break;
}
case SPRINKLER_DEVICE_GET_WATER_FLOW_RESPONSE:
{
break;
}
case SPRINKLER_DEVICE_GET_MOISTURE_RESPONSE:
{
break;
}
case SPRINKLER_DEVICE_SET_PROGRAM_ACK:
{
break;
}
case SPRINKLER_DEVICE_GET_PROGRAM_RESPONSE:
{
break;
}
case SPRINKLER_DEVICE_SET_PARAMETERS_ACK:
{
break;
}
case SPRINKLER_DEVICE_GET_PARAMETERS_RESPONSE:
{
break;
}
case SPRINKLER_DEVICE_SET_SPRINKLER_STATE_REQUEST:
case SPRINKLER_DEVICE_GET_SPRINKLER_STATE_REQUEST:
case SPRINKLER_DEVICE_GET_WATER_FLOW_REQUEST:
case SPRINKLER_DEVICE_GET_MOISTURE_REQUEST:
case SPRINKLER_DEVICE_SET_PROGRAM_REQUEST:
case SPRINKLER_DEVICE_GET_PROGRAM_REQUEST:
case SPRINKLER_DEVICE_SET_PARAMETERS_REQUEST:
case SPRINKLER_DEVICE_GET_PARAMETERS_REQUEST:
case SPRINKLER_DEVICE_STATUS_REQUEST:
default:
{
qDebug("Received invalid msg from Sprinkler Device");
break;
}
}
return 0;
}
+19
View File
@@ -0,0 +1,19 @@
#ifndef SPRINKLERDEVICE_H
#define SPRINKLERDEVICE_H
#include "GlobalDefine.h"
#include "NetworkDevice.h"
class CSprinklerDevice: public QObject, public CNetworkDevice
{
Q_OBJECT
public:
CSprinklerDevice(int Address, CAbstractNetworkCommIF *NetworkInterface);
virtual ~CSprinklerDevice();
virtual int NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
};
#endif // SPRINKLERDEVICE_H
+72
View File
@@ -0,0 +1,72 @@
#include "SprinklerInterface.h"
#include "ProtocolDefs.h"
#include <QDebug>
CSprinklerInterface::CSprinklerInterface(int Address, CAbstractNetworkCommIF *NetworkInterface):
CNetworkDevice(ID_SPRINKLER_DEVICE,Address,NetworkInterface)
{
}
CSprinklerInterface::~CSprinklerInterface()
{
}
int CSprinklerInterface::NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data)
{
Q_UNUSED(DeviceID)
Q_UNUSED(DeviceAddress)
Q_UNUSED(DataSize)
Q_UNUSED(Data)
return RET_OK;
switch(MessageID)
{
case SPRINKLER_INTERFACE_STATUS_RESPONSE:
{
break;
}
case SPRINKLER_INTERFACE_ACK:
{
break;
}
case SPRINKLER_INTERFACE_GET_SPRINKLERS_REQUEST:
{
break;
}
case SPRINKLER_INTERFACE_GET_SPRINKLER_DATA_REQUEST:
{
break;
}
case SPRINKLER_INTERFACE_GET_SPRINKLER_DATA_RESPONSE:
{
break;
}
case SPRINKLER_INTERFACE_GET_SPRINKLER_STATE_REQUEST:
{
break;
}
case SPRINKLER_INTERFACE_SET_SPRINKLER_STATE_REQUEST:
{
break;
}
case SPRINKLER_INTERFACE_SET_SPRINKLER_DATA_REQUEST:
case SPRINKLER_INTERFACE_GET_SPRINKLER_STATE_RESPONSE:
case SPRINKLER_INTERFACE_GET_SPRINKLERS_RESPONSE:
case SPRINKLER_INTERFACE_SET_SPRINKLER_DATA_ACK:
case SPRINKLER_INTERFACE_SET_SPRINKLER_STATE_ACK:
case SPRINKLER_INTERFACE_STATUS_REQUEST:
default:
{
qDebug("Received invalid msg from Sprinkler Interface");
break;
}
}
return 0;
}
+19
View File
@@ -0,0 +1,19 @@
#ifndef SPRINKLERINTERFACE_H
#define SPRINKLERINTERFACE_H
#include "GlobalDefine.h"
#include "NetworkDevice.h"
class CSprinklerInterface: public QObject, public CNetworkDevice
{
Q_OBJECT
public:
CSprinklerInterface(int Address, CAbstractNetworkCommIF *NetworkInterface);
virtual ~CSprinklerInterface();
virtual int NewDeviceFrameReceived(int DeviceID, int DeviceAddress, int MessageID, int DataSize, QByteArray Data);
};
#endif // SPRINKLERDEVICE_H
+6
View File
@@ -0,0 +1,6 @@
#include "SprinklerMgr.h"
CSprinklerMgr::CSprinklerMgr(QObject *parent) : QObject(parent)
{
}
+17
View File
@@ -0,0 +1,17 @@
#ifndef SPRINKLERMGR_H
#define SPRINKLERMGR_H
#include <QObject>
class CSprinklerMgr : public QObject
{
Q_OBJECT
public:
explicit CSprinklerMgr(QObject *parent = 0);
signals:
public slots:
};
#endif // SPRINKLERMGR_H