Monitor
monitor.DestijlCommandManager Class Reference

Specialization class for command manager, which implemnent destijl protocol between monitor and server More...

Collaboration diagram for monitor.DestijlCommandManager:

Public Types

enum  CommandStatus {
  CommandStatus.Success, CommandStatus.Rejected, CommandStatus.InvalidAnswer, CommandStatus.Busy,
  CommandStatus.CommunicationLostWithRobot, CommandStatus.CommunicationLostWithServer
}
 List of available return status More...
 

Public Member Functions

delegate void CommandReceivedEvent (string header, string data, byte[] buffer)
 Callback for sending received data to application level More...
 
 DestijlCommandManager (CommandReceivedEvent callback)
 Initializes a new instance of the monitor.DestijlCommandManager class. More...
 
bool Open (string hostname)
 Open the specified hostname server, using default port number. More...
 
bool Open (string hostname, int port)
 Open connection to server "host", with port number "port" More...
 
void Close ()
 Close connection to server More...
 
CommandStatus RobotOpenCom ()
 Open communication with robot and wait acknowledge More...
 
CommandStatus RobotCloseCom ()
 Close communication with robot and wait acknowledge More...
 
CommandStatus RobotPing ()
 Ping the robot. More...
 
CommandStatus RobotReset ()
 Reset robot and let it in idle mode More...
 
CommandStatus RobotStartWithWatchdog ()
 Start robot, enabling watchdog More...
 
CommandStatus RobotStartWithoutWatchdog ()
 Start robot, without enabling watchdog More...
 
CommandStatus RobotMove (int distance)
 Move robot forward or backward, for a distance expressed in millimeter More...
 
CommandStatus RobotTurn (int angle)
 Make robot turn left or right, for a given angle More...
 
CommandStatus RobotGetBattery ()
 Request robot battery level More...
 
CommandStatus RobotGetVersion (out string version)
 Request robot firmware version More...
 
CommandStatus RobotPowerOff ()
 Power off robot More...
 
CommandStatus CameraOpen ()
 Open camera on remote device More...
 
CommandStatus CameraClose ()
 Close camera on remote device More...
 
CommandStatus CameraAskArena ()
 Request still image of detected arena More...
 
CommandStatus CameraArenaConfirm ()
 Confirm arena detection (after requesting image of detected arena, using CameraAskArena More...
 
CommandStatus CameraArenaInfirm ()
 Reject arena detected (after requesting image of detected arena, using CameraAskArena More...
 
CommandStatus CameraComputePosition ()
 Request robot position computing More...
 
CommandStatus CameraStopComputePosition ()
 Stop robot position computing More...
 

Public Attributes

CommandReceivedEvent commandReceivedEvent = null
 
double timeout = 100
 Timeout used for command with acknowledge More...
 

Private Member Functions

 ~DestijlCommandManager ()
 Releases unmanaged resources and performs other cleanup operations before the monitor.DestijlCommandManager is reclaimed by garbage collection. More...
 
void OnCommandReceived (string msg, byte[] buffer)
 Callback used for receiving data from lower layer (CommandManager class) More...
 
string CreateCommand (string header, string data)
 Creates the command to send to server, based on header and data provided More...
 
CommandStatus DecodeStatus (CommandManager.CommandManagerStatus localStatus, string answer)
 Provide DestijlCommandManager.CommandStatus based on status received by CommandManager.SendCommand and answer string More...
 

Private Attributes

CommandManager commandManager = null
 Command Manager object More...
 
string receivedHeader = null
 Part of received message corresponding to command header More...
 
string receivedData = null
 Part of received message corresponding to command data More...
 

Detailed Description

Specialization class for command manager, which implemnent destijl protocol between monitor and server

Definition at line 76 of file DestijlCommandManager.cs.

Member Enumeration Documentation

◆ CommandStatus

List of available return status

Enumerator
Success 
Rejected 
InvalidAnswer 
Busy 
CommunicationLostWithRobot 
CommunicationLostWithServer 

Definition at line 107 of file DestijlCommandManager.cs.

Constructor & Destructor Documentation

◆ DestijlCommandManager()

monitor.DestijlCommandManager.DestijlCommandManager ( CommandReceivedEvent  callback)

Initializes a new instance of the monitor.DestijlCommandManager class.

Parameters
callbackCallback reference for reception of data

Definition at line 121 of file DestijlCommandManager.cs.

◆ ~DestijlCommandManager()

monitor.DestijlCommandManager.~DestijlCommandManager ( )
private

Releases unmanaged resources and performs other cleanup operations before the monitor.DestijlCommandManager is reclaimed by garbage collection.

Definition at line 131 of file DestijlCommandManager.cs.

Member Function Documentation

◆ CameraArenaConfirm()

CommandStatus monitor.DestijlCommandManager.CameraArenaConfirm ( )

Confirm arena detection (after requesting image of detected arena, using CameraAskArena

Returns
Command status (see DecodeStatus)

Definition at line 492 of file DestijlCommandManager.cs.

◆ CameraArenaInfirm()

CommandStatus monitor.DestijlCommandManager.CameraArenaInfirm ( )

Reject arena detected (after requesting image of detected arena, using CameraAskArena

Returns
Command status (see DecodeStatus)

Definition at line 509 of file DestijlCommandManager.cs.

◆ CameraAskArena()

CommandStatus monitor.DestijlCommandManager.CameraAskArena ( )

Request still image of detected arena

Returns
Command status (see DecodeStatus)

Definition at line 475 of file DestijlCommandManager.cs.

◆ CameraClose()

CommandStatus monitor.DestijlCommandManager.CameraClose ( )

Close camera on remote device

Returns
Command status (see DecodeStatus)

Definition at line 458 of file DestijlCommandManager.cs.

◆ CameraComputePosition()

CommandStatus monitor.DestijlCommandManager.CameraComputePosition ( )

Request robot position computing

Returns
Command status (see DecodeStatus)

Definition at line 526 of file DestijlCommandManager.cs.

◆ CameraOpen()

CommandStatus monitor.DestijlCommandManager.CameraOpen ( )

Open camera on remote device

Returns
Command status (see DecodeStatus)

Definition at line 441 of file DestijlCommandManager.cs.

◆ CameraStopComputePosition()

CommandStatus monitor.DestijlCommandManager.CameraStopComputePosition ( )

Stop robot position computing

Returns
Command status (see DecodeStatus)

Definition at line 543 of file DestijlCommandManager.cs.

◆ Close()

void monitor.DestijlCommandManager.Close ( )

Close connection to server

Definition at line 183 of file DestijlCommandManager.cs.

◆ CommandReceivedEvent()

delegate void monitor.DestijlCommandManager.CommandReceivedEvent ( string  header,
string  data,
byte []  buffer 
)

Callback for sending received data to application level

◆ CreateCommand()

string monitor.DestijlCommandManager.CreateCommand ( string  header,
string  data 
)
private

Creates the command to send to server, based on header and data provided

Returns
The command string
Parameters
headerHeader part of the command
dataData part of the command

Definition at line 194 of file DestijlCommandManager.cs.

◆ DecodeStatus()

CommandStatus monitor.DestijlCommandManager.DecodeStatus ( CommandManager.CommandManagerStatus  localStatus,
string  answer 
)
private

Provide DestijlCommandManager.CommandStatus based on status received by CommandManager.SendCommand and answer string

Returns
Status compatible with DestijlCommandManager.CommandStatus type
Parameters
localStatusStatus provided by CommandManager.SendCommand
answerAnswer provided by CommandManager.SendCommand

Definition at line 205 of file DestijlCommandManager.cs.

◆ OnCommandReceived()

void monitor.DestijlCommandManager.OnCommandReceived ( string  msg,
byte []  buffer 
)
private

Callback used for receiving data from lower layer (CommandManager class)

Parameters
msgString containing received message
bufferRaw buffer to be used when data are not in ascii format (image for example)

Definition at line 141 of file DestijlCommandManager.cs.

◆ Open() [1/2]

bool monitor.DestijlCommandManager.Open ( string  hostname)

Open the specified hostname server, using default port number.

Returns
true if connection succeded, false otherwise
Parameters
hostnameHostname to connect to

Definition at line 163 of file DestijlCommandManager.cs.

◆ Open() [2/2]

bool monitor.DestijlCommandManager.Open ( string  hostname,
int  port 
)

Open connection to server "host", with port number "port"

Returns
true if connection succeded, false otherwise
Parameters
hostnameHostname to connect to
portPort number for connection

Definition at line 174 of file DestijlCommandManager.cs.

◆ RobotCloseCom()

CommandStatus monitor.DestijlCommandManager.RobotCloseCom ( )

Close communication with robot and wait acknowledge

Returns
Command status (see DecodeStatus)

Definition at line 251 of file DestijlCommandManager.cs.

◆ RobotGetBattery()

CommandStatus monitor.DestijlCommandManager.RobotGetBattery ( )

Request robot battery level

Returns
Command status (see DecodeStatus)

Definition at line 372 of file DestijlCommandManager.cs.

◆ RobotGetVersion()

CommandStatus monitor.DestijlCommandManager.RobotGetVersion ( out string  version)

Request robot firmware version

Returns
Command status (see DecodeStatus)
Parameters
versiontodo

Definition at line 390 of file DestijlCommandManager.cs.

◆ RobotMove()

CommandStatus monitor.DestijlCommandManager.RobotMove ( int  distance)

Move robot forward or backward, for a distance expressed in millimeter

Returns
Command status (see DecodeStatus)
Parameters
distanceDistance of mouvment, in millimeter

Definition at line 337 of file DestijlCommandManager.cs.

◆ RobotOpenCom()

CommandStatus monitor.DestijlCommandManager.RobotOpenCom ( )

Open communication with robot and wait acknowledge

Returns
Command status (see DecodeStatus)

Definition at line 234 of file DestijlCommandManager.cs.

◆ RobotPing()

CommandStatus monitor.DestijlCommandManager.RobotPing ( )

Ping the robot.

Returns
Command status (see DecodeStatus)

Definition at line 268 of file DestijlCommandManager.cs.

◆ RobotPowerOff()

CommandStatus monitor.DestijlCommandManager.RobotPowerOff ( )

Power off robot

Returns
Command status (see DecodeStatus)

Definition at line 424 of file DestijlCommandManager.cs.

◆ RobotReset()

CommandStatus monitor.DestijlCommandManager.RobotReset ( )

Reset robot and let it in idle mode

Returns
Command status (see DecodeStatus)

Definition at line 285 of file DestijlCommandManager.cs.

◆ RobotStartWithoutWatchdog()

CommandStatus monitor.DestijlCommandManager.RobotStartWithoutWatchdog ( )

Start robot, without enabling watchdog

Returns
Command status (see DecodeStatus)

Definition at line 319 of file DestijlCommandManager.cs.

◆ RobotStartWithWatchdog()

CommandStatus monitor.DestijlCommandManager.RobotStartWithWatchdog ( )

Start robot, enabling watchdog

Returns
Command status (see DecodeStatus)

Definition at line 302 of file DestijlCommandManager.cs.

◆ RobotTurn()

CommandStatus monitor.DestijlCommandManager.RobotTurn ( int  angle)

Make robot turn left or right, for a given angle

Returns
Command status (see DecodeStatus)
Parameters
angleAngle of turn, in degree (negative for left, positive for right)

Definition at line 355 of file DestijlCommandManager.cs.

Member Data Documentation

◆ commandManager

CommandManager monitor.DestijlCommandManager.commandManager = null
private

Command Manager object

Definition at line 81 of file DestijlCommandManager.cs.

◆ commandReceivedEvent

CommandReceivedEvent monitor.DestijlCommandManager.commandReceivedEvent = null

Definition at line 97 of file DestijlCommandManager.cs.

◆ receivedData

string monitor.DestijlCommandManager.receivedData = null
private

Part of received message corresponding to command data

Definition at line 91 of file DestijlCommandManager.cs.

◆ receivedHeader

string monitor.DestijlCommandManager.receivedHeader = null
private

Part of received message corresponding to command header

Definition at line 86 of file DestijlCommandManager.cs.

◆ timeout

double monitor.DestijlCommandManager.timeout = 100

Timeout used for command with acknowledge

Definition at line 102 of file DestijlCommandManager.cs.


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