Masterctrl/Sources/Sprinkler/SprinklerInterface.cpp
2017-04-13 10:42:39 -04:00

74 lines
1.8 KiB
C++

#include "SprinklerInterface.h"
#include "ProtocolDefs.h"
#include <QDebug>
#include "SprinklerMgr.h"
CSprinklerInterface::CSprinklerInterface(int Address, CAbstractNetworkCommIF *NetworkInterface, CSprinklerMgr *SprinklerMgr):
CNetworkDevice(ID_SPRINKLER_INTERFACE,Address,NetworkInterface)
{
mSprinklerMgr = SprinklerMgr;
}
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;
}