![]() |
Monitor
|
Specialization class for command manager, which implemnent destijl protocol between monitor and server More...
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... | |
Specialization class for command manager, which implemnent destijl protocol between monitor and server
Definition at line 76 of file DestijlCommandManager.cs.
|
strong |
List of available return status
Enumerator | |
---|---|
Success | |
Rejected | |
InvalidAnswer | |
Busy | |
CommunicationLostWithRobot | |
CommunicationLostWithServer |
Definition at line 107 of file DestijlCommandManager.cs.
monitor.DestijlCommandManager.DestijlCommandManager | ( | CommandReceivedEvent | callback | ) |
Initializes a new instance of the monitor.DestijlCommandManager class.
callback | Callback reference for reception of data |
Definition at line 121 of file DestijlCommandManager.cs.
|
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.
CommandStatus monitor.DestijlCommandManager.CameraArenaConfirm | ( | ) |
Confirm arena detection (after requesting image of detected arena, using CameraAskArena
Definition at line 492 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.CameraArenaInfirm | ( | ) |
Reject arena detected (after requesting image of detected arena, using CameraAskArena
Definition at line 509 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.CameraAskArena | ( | ) |
Request still image of detected arena
Definition at line 475 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.CameraClose | ( | ) |
Close camera on remote device
Definition at line 458 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.CameraComputePosition | ( | ) |
Request robot position computing
Definition at line 526 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.CameraOpen | ( | ) |
Open camera on remote device
Definition at line 441 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.CameraStopComputePosition | ( | ) |
Stop robot position computing
Definition at line 543 of file DestijlCommandManager.cs.
void monitor.DestijlCommandManager.Close | ( | ) |
Close connection to server
Definition at line 183 of file DestijlCommandManager.cs.
delegate void monitor.DestijlCommandManager.CommandReceivedEvent | ( | string | header, |
string | data, | ||
byte [] | buffer | ||
) |
Callback for sending received data to application level
|
private |
Creates the command to send to server, based on header and data provided
header | Header part of the command |
data | Data part of the command |
Definition at line 194 of file DestijlCommandManager.cs.
|
private |
Provide DestijlCommandManager.CommandStatus based on status received by CommandManager.SendCommand and answer string
localStatus | Status provided by CommandManager.SendCommand |
answer | Answer provided by CommandManager.SendCommand |
Definition at line 205 of file DestijlCommandManager.cs.
|
private |
Callback used for receiving data from lower layer (CommandManager class)
msg | String containing received message |
buffer | Raw buffer to be used when data are not in ascii format (image for example) |
Definition at line 141 of file DestijlCommandManager.cs.
bool monitor.DestijlCommandManager.Open | ( | string | hostname | ) |
Open the specified hostname server, using default port number.
hostname | Hostname to connect to |
Definition at line 163 of file DestijlCommandManager.cs.
bool monitor.DestijlCommandManager.Open | ( | string | hostname, |
int | port | ||
) |
Open connection to server "host", with port number "port"
hostname | Hostname to connect to |
port | Port number for connection |
Definition at line 174 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotCloseCom | ( | ) |
Close communication with robot and wait acknowledge
Definition at line 251 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotGetBattery | ( | ) |
Request robot battery level
Definition at line 372 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotGetVersion | ( | out string | version | ) |
Request robot firmware version
version | todo |
Definition at line 390 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotMove | ( | int | distance | ) |
Move robot forward or backward, for a distance expressed in millimeter
distance | Distance of mouvment, in millimeter |
Definition at line 337 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotOpenCom | ( | ) |
Open communication with robot and wait acknowledge
Definition at line 234 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotPing | ( | ) |
Ping the robot.
Definition at line 268 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotPowerOff | ( | ) |
Power off robot
Definition at line 424 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotReset | ( | ) |
Reset robot and let it in idle mode
Definition at line 285 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotStartWithoutWatchdog | ( | ) |
Start robot, without enabling watchdog
Definition at line 319 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotStartWithWatchdog | ( | ) |
Start robot, enabling watchdog
Definition at line 302 of file DestijlCommandManager.cs.
CommandStatus monitor.DestijlCommandManager.RobotTurn | ( | int | angle | ) |
Make robot turn left or right, for a given angle
angle | Angle of turn, in degree (negative for left, positive for right) |
Definition at line 355 of file DestijlCommandManager.cs.
|
private |
Command Manager object
Definition at line 81 of file DestijlCommandManager.cs.
CommandReceivedEvent monitor.DestijlCommandManager.commandReceivedEvent = null |
Definition at line 97 of file DestijlCommandManager.cs.
|
private |
Part of received message corresponding to command data
Definition at line 91 of file DestijlCommandManager.cs.
|
private |
Part of received message corresponding to command header
Definition at line 86 of file DestijlCommandManager.cs.
double monitor.DestijlCommandManager.timeout = 100 |
Timeout used for command with acknowledge
Definition at line 102 of file DestijlCommandManager.cs.