CmdMessenger  3.0
CmdMessenger is a serial port messaging library for the Arduino
Public Member Functions | Properties | List of all members
CommandMessenger.SendCommand Class Reference

A command to be send by CmdMessenger More...

Public Member Functions

 SendCommand (int cmdId)
 Constructor. More...
 
 SendCommand (int cmdId, string argument)
 Constructor. More...
 
 SendCommand (int cmdId, string[] arguments)
 Constructor. More...
 
 SendCommand (int cmdId, float argument)
 Constructor. More...
 
 SendCommand (int cmdId, double argument)
 Constructor. More...
 
 SendCommand (int cmdId, UInt16 argument)
 Constructor. More...
 
 SendCommand (int cmdId, Int16 argument)
 Constructor. More...
 
 SendCommand (int cmdId, UInt32 argument)
 Constructor. More...
 
 SendCommand (int cmdId, Int32 argument)
 Constructor. More...
 
 SendCommand (int cmdId, bool argument)
 Constructor. More...
 
 SendCommand (int cmdId, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, string argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, string[] arguments, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, float argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, double argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, Int16 argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, UInt16 argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, Int32 argument, int ackCmdId, int timeout)
 Constructor. More...
 
 SendCommand (int cmdId, UInt32 argument, int ackCmdId, int timeout)
 Constructor. More...
 
void AddArgument (string argument)
 Adds a command argument. More...
 
void AddArguments (string[] arguments)
 Adds command arguments. More...
 
void AddArgument (Single argument)
 Adds a command argument. More...
 
void AddArgument (Double argument)
 Adds a command argument. More...
 
void AddArgument (Int16 argument)
 Adds a command argument. More...
 
void AddArgument (UInt16 argument)
 Adds a command argument. More...
 
void AddArgument (Int32 argument)
 Adds a command argument. More...
 
void AddArgument (UInt32 argument)
 Adds a command argument. More...
 
void AddArgument (bool argument)
 Adds a command argument. More...
 
void AddBinArgument (string argument)
 Adds a binary command argument. More...
 
void AddBinArgument (Single argument)
 Adds a binary command argument. More...
 
void AddBinArgument (Double argument)
 Adds a binary command argument. More...
 
void AddBinArgument (Int16 argument)
 Adds a binary command argument. More...
 
void AddBinArgument (UInt16 argument)
 Adds a binary command argument. More...
 
void AddBinArgument (Int32 argument)
 Adds a binary command argument. More...
 
void AddBinArgument (UInt32 argument)
 Adds a binary command argument. More...
 
void AddBinArgument (bool argument)
 Adds a binary command argument. More...
 

Properties

int CmdId [get, set]
 Gets or sets the command ID. More...
 
bool ReqAc [get, set]
 Indicates if we want to wait for an acknowlegde command. More...
 
int AckCmdId [get, set]
 Gets or sets the acknowledge command ID. More...
 
int Timeout [get, set]
 Gets or sets the time we want to wait for the acknowledgde command. More...
 
String[] Arguments [get]
 Gets the command arguments. More...
 

Detailed Description

A command to be send by CmdMessenger

Constructor & Destructor Documentation

CommandMessenger.SendCommand.SendCommand ( int  cmdId)
inline

Constructor.

Parameters
cmdIdthe command ID.
59  {
60  Init(cmdId, false, 0, 0);
61  }
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
string  argument 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

67  {
68  Init(cmdId, false, 0, 0);
69  AddArgument(argument);
70  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
string[]  arguments 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentsThe arguments.

References CommandMessenger.SendCommand.AddArguments().

76  {
77  Init(cmdId, false, 0, 0);
78  AddArguments(arguments);
79  }
void AddArguments(string[] arguments)
Adds command arguments.
Definition: SendCommand.cs:267
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
float  argument 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

85  {
86  Init(cmdId, false, 0, 0);
87  AddArgument(argument);
88  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
double  argument 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

94  {
95  Init(cmdId, false, 0, 0);
96  AddArgument(argument);
97  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
UInt16  argument 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

103  {
104  Init(cmdId, false, 0, 0);
105  AddArgument(argument);
106  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
Int16  argument 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

112  {
113  Init(cmdId, false, 0, 0);
114  AddArgument(argument);
115  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
UInt32  argument 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

121  {
122  Init(cmdId, false, 0, 0);
123  AddArgument(argument);
124  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
Int32  argument 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

130  {
131  Init(cmdId, false, 0, 0);
132  AddArgument(argument);
133  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
bool  argument 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

139  {
140  Init(cmdId, false, 0, 0);
141  AddArgument(argument);
142  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde
149  {
150  Init(cmdId, true, ackCmdId, timeout);
151  }
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
string  argument,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde

References CommandMessenger.SendCommand.AddArgument().

159  {
160  Init(cmdId, true, ackCmdId, timeout);
161  AddArgument(argument);
162  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
string[]  arguments,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentsThe arguments.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde

References CommandMessenger.SendCommand.AddArguments().

170  {
171  Init(cmdId, true, ackCmdId, timeout);
172  AddArguments(arguments);
173  }
void AddArguments(string[] arguments)
Adds command arguments.
Definition: SendCommand.cs:267
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
float  argument,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde

References CommandMessenger.SendCommand.AddArgument().

181  {
182  Init(cmdId, true, ackCmdId, timeout);
183  AddArgument(argument);
184  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
double  argument,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde

References CommandMessenger.SendCommand.AddArgument().

192  {
193  Init(cmdId, true, ackCmdId, timeout);
194  AddArgument(argument);
195  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
Int16  argument,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde

References CommandMessenger.SendCommand.AddArgument().

203  {
204  Init(cmdId, true, ackCmdId, timeout);
205  AddArgument(argument);
206  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
UInt16  argument,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde

References CommandMessenger.SendCommand.AddArgument().

214  {
215  Init(cmdId, true, ackCmdId, timeout);
216  AddArgument(argument);
217  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
Int32  argument,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde

References CommandMessenger.SendCommand.AddArgument().

225  {
226  Init(cmdId, true, ackCmdId, timeout);
227  AddArgument(argument);
228  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
CommandMessenger.SendCommand.SendCommand ( int  cmdId,
UInt32  argument,
int  ackCmdId,
int  timeout 
)
inline

Constructor.

Parameters
cmdIdCommand ID
argumentThe argument.
ackCmdIdAcknowlegde command ID.
timeoutThe timeout on waiting for an acknowlegde

References CommandMessenger.SendCommand.AddArgument().

236  {
237  Init(cmdId, true, ackCmdId, timeout);
238  AddArgument(argument);
239  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259

Member Function Documentation

void CommandMessenger.SendCommand.AddArgument ( string  argument)
inline

Adds a command argument.

Parameters
argumentThe argument.

Referenced by CommandMessenger.SendCommand.AddArgument(), and CommandMessenger.SendCommand.SendCommand().

260  {
261  if (argument != null)
262  _arguments.Add(argument);
263  }
void CommandMessenger.SendCommand.AddArgument ( Single  argument)
inline

Adds a command argument.

Parameters
argumentThe argument.
276  {
277  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
278  }
void CommandMessenger.SendCommand.AddArgument ( Double  argument)
inline

Adds a command argument.

Parameters
argumentThe argument.
283  {
284  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
285  }
void CommandMessenger.SendCommand.AddArgument ( Int16  argument)
inline

Adds a command argument.

Parameters
argumentThe argument.
290  {
291  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
292  }
void CommandMessenger.SendCommand.AddArgument ( UInt16  argument)
inline

Adds a command argument.

Parameters
argumentThe argument.
297  {
298  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
299  }
void CommandMessenger.SendCommand.AddArgument ( Int32  argument)
inline

Adds a command argument.

Parameters
argumentThe argument.
304  {
305  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
306  }
void CommandMessenger.SendCommand.AddArgument ( UInt32  argument)
inline

Adds a command argument.

Parameters
argumentThe argument.
311  {
312  _arguments.Add(argument.ToString(CultureInfo.InvariantCulture));
313  }
void CommandMessenger.SendCommand.AddArgument ( bool  argument)
inline

Adds a command argument.

Parameters
argumentThe argument.

References CommandMessenger.SendCommand.AddArgument().

318  {
319  AddArgument((Int32) (argument ? 1 : 0));
320  }
void AddArgument(string argument)
Adds a command argument.
Definition: SendCommand.cs:259
void CommandMessenger.SendCommand.AddArguments ( string[]  arguments)
inline

Adds command arguments.

Parameters
argumentsThe arguments.

Referenced by CommandMessenger.SendCommand.SendCommand().

268  {
269  if (arguments != null)
270  _arguments.AddRange(arguments);
271  }
void CommandMessenger.SendCommand.AddBinArgument ( string  argument)
inline

Adds a binary command argument.

Parameters
argumentThe argument.
327  {
328  _arguments.Add(Escaping.Escape(argument));
329  }
void CommandMessenger.SendCommand.AddBinArgument ( Single  argument)
inline

Adds a binary command argument.

Parameters
argumentThe argument.
334  {
335  _arguments.Add(BinaryConverter.ToString(argument));
336  }
void CommandMessenger.SendCommand.AddBinArgument ( Double  argument)
inline

Adds a binary command argument.

Parameters
argumentThe argument.
341  {
342  _arguments.Add(BinaryConverter.ToString(argument));
343  }
void CommandMessenger.SendCommand.AddBinArgument ( Int16  argument)
inline

Adds a binary command argument.

Parameters
argumentThe argument.
348  {
349  _arguments.Add(BinaryConverter.ToString(argument));
350  }
void CommandMessenger.SendCommand.AddBinArgument ( UInt16  argument)
inline

Adds a binary command argument.

Parameters
argumentThe argument.
355  {
356  _arguments.Add(BinaryConverter.ToString(argument));
357  }
void CommandMessenger.SendCommand.AddBinArgument ( Int32  argument)
inline

Adds a binary command argument.

Parameters
argumentThe argument.
362  {
363  _arguments.Add(BinaryConverter.ToString(argument));
364  }
void CommandMessenger.SendCommand.AddBinArgument ( UInt32  argument)
inline

Adds a binary command argument.

Parameters
argumentThe argument.
369  {
370  _arguments.Add(BinaryConverter.ToString(argument));
371  }
void CommandMessenger.SendCommand.AddBinArgument ( bool  argument)
inline

Adds a binary command argument.

Parameters
argumentThe argument.
376  {
377  _arguments.Add(BinaryConverter.ToString(argument ? (byte) 1 : (byte) 0));
378  }

Property Documentation

int CommandMessenger.SendCommand.AckCmdId
getset

Gets or sets the acknowledge command ID.

the acknowledge command ID.

Referenced by CommandMessenger.CmdMessenger.SendCommand().

String [] CommandMessenger.SendCommand.Arguments
get

Gets the command arguments.

The arguments, first one is the command ID

Referenced by CommandMessenger.CmdMessenger.SendCommand().

int CommandMessenger.SendCommand.CmdId
getset

Gets or sets the command ID.

The command ID.

Referenced by CommandMessenger.CmdMessenger.SendCommand().

bool CommandMessenger.SendCommand.ReqAc
getset

Indicates if we want to wait for an acknowlegde command.

true if request acknowledge, false if not.

Referenced by CommandMessenger.CmdMessenger.SendCommand().

int CommandMessenger.SendCommand.Timeout
getset

Gets or sets the time we want to wait for the acknowledgde command.

The timeout on waiting for an acknowlegde

Referenced by CommandMessenger.CmdMessenger.SendCommand().


The documentation for this class was generated from the following file: