Merge branch 'master' into ModbusCore

This commit is contained in:
Charl Wentzel
2019-07-10 19:50:26 +02:00
21 changed files with 1110 additions and 972 deletions

View File

@@ -121,11 +121,10 @@ class CDeviceCore : public CFunctionCore
{
protected:
// Configuration
CDataMember * Config = NULL;
CDataMember * ConfigTypes = NULL;
CDataMember * ValueTree = NULL;
CJSONparse * JSONparse = NULL;
bool DeviceInit = false;
CDataMember * ConfigTypes = NULL;
CDataMember * ValueTree = NULL;
CJSONparse * JSONparse = NULL;
bool DeviceInit = false; // Initialise device on start
// Devices & Type
TDevice * FirstDeviceType = NULL;
@@ -133,24 +132,25 @@ protected:
TDevice * ActiveDevice = NULL;
// Standard channels
TChannel * DeviceChannel = NULL;
TChannel * CmdChannel = NULL;
TChannel * EventChannel = NULL;
TChannel * DeviceChannel = NULL;
TChannel * CmdChannel = NULL;
TChannel * EventChannel = NULL;
// Poll
int PollCycle; // Device Polling state, e.g. Init, Connect, Run, Disonnect, Shutdown
int PollStep; // Position in polling sequence
timeval PollWait; // Time at which last poll was done
long PollInterval; // Minimum delay between polls
int PollCycle = 0; // Device Polling state, e.g. Init, Connect, Run, Disonnect, Shutdown
int PollStep = 0; // Position in polling sequence
timeval PollWait = {0,0}; // Time at which last poll was done
long PollInterval = 250; // Minimum delay between polls
// Reply
bool WaitingForReply; // Command sent, waiting for reply
bool InvalidReply; // Invalid reply received
long ReplyTimeout; // Max waiting time for reply
bool WaitingForReply = false; // Command sent, waiting for reply
bool InvalidReply = false; // Invalid reply received
long DefReplyTimeout = 500; // Default Max waiting time for reply
long ReplyTimeout = 500; // Max waiting time for reply
// Retry
int PollRetry; // No of polling retries that has timed out
int MaxRetries; // Max allowed retries
int PollRetry = 0; // No of polling retries that has timed out
int MaxRetries = 3; // Max allowed retries
// Manage Devices
bool DestroyDevice( TDevice ** Device );
@@ -309,7 +309,7 @@ protected:
virtual bool DeviceOnline( TDevice * Device, bool Online );
// Handle Reply Timing
virtual void SetWaitForReply();
virtual void SetWaitForReply( int CustomTimeout = -1 );
virtual void ValidReplyReceived();
virtual bool CheckReplyTimeout();
@@ -389,7 +389,7 @@ public:
// Handle Interface Commands
bool GetCmdParam( const char * Start, char * Param, char ** NextParam );
int HandleCommand( const char *ChannelName, const char * Data, const int MaxLen );
int HandleCommand( const char *ChannelName, const char * SourceRef, const char * Data, const int MaxLen );
// Command Text Interfaces
bool SetValue( TDeviceParam * Param, const char * Value, const int Len, bool Force );