#include <URG04LXmm.h>
Public Member Functions | |
URG04LXmmCommand () | |
Default constructor. | |
~URG04LXmmCommand () | |
Destructor. | |
string | getObjectName () const |
Gets the name for debugging purposes. | |
void | setDevice (const char *device) |
Change device path, FILE*, file descriptor. | |
int | writeCmd (char *s) |
Send a command contained in an appropriate ExtString. | |
int | readCmd (char *s) |
Receive the answer of the sensor to a command. | |
ExtString | int2string (int bytes, int value) |
Converts an int into a strig made of a fixed number of characters. | |
bool | checkEcho (ExtString command, ExtString response) |
Verifies that the echo of the responses is equal to the commad sent to URG. | |
bool | checkStatus (ExtString command, ExtString response) |
Compare the STATUS camp of the response with status param. | |
void | changeProtocol () |
Changes protocol to SCIP2.0. | |
void | on () |
Turn on laser for scanning. | |
void | off () |
Turn off laser for scanning. | |
void | reset () |
Reset sensor switching off laser and resetting all parameters to default values. | |
Time | timeMatch (ExtString testString) |
Useful to match host and sensor time and to evaluate avg data TX time. | |
bool | localFSM (char *_command, ExtString &_output) |
Implements a FSM locally called for I/O opeations. | |
void | setSCIP2 () |
Set _SCIP2 flag. | |
void | unsetSCIP2 () |
Unset _SCIP2 flag. | |
void | setFirstBlock () |
Set _isReceiving flag. | |
void | setVerboseOn () |
Set _verboseOn flag. | |
void | setLog () |
Set _log flag. | |
void | setfdBad () |
Set _fdBad flag. | |
void | unsetFirstBlock () |
Unset _isReceiving flag. | |
void | setIsFinished () |
Set _isFinished flag. | |
void | unsetIsFinished () |
Unset _isFinished flag. | |
void | unsetVerboseOn () |
Unset _verboseOn flag. | |
void | unsetLog () |
Unset _log flag. | |
void | unsetfdBad () |
Unset _fdBad flag. | |
const char * | device () |
get device path | |
FILE * | laserPort () |
get FILE* of device | |
int | fd () |
get file descriptor of device | |
bool | SCIP2 () |
get _SCIP2 flag | |
bool | firstBlock () |
get _isReceiving flag | |
bool | isFinished () |
get _isFinished flag | |
bool | verboseOn () |
return _verboseOn flag | |
bool | log () |
return _log flag | |
bool | fdBad () |
return _fdBad flag |
Contains those methods that perform (or are usueful to perform) communication with real sensor. Communication is actually realized by localFSM. There are also some get and set functions for private attributes Scan operations are not implemented here.
MipResources::URG04LXmmCommand::URG04LXmmCommand | ( | ) |
Default constructor.
MipResources::URG04LXmmCommand::~URG04LXmmCommand | ( | ) |
Destructor.
string MipResources::URG04LXmmCommand::getObjectName | ( | ) | const [inline, virtual] |
Gets the name for debugging purposes.
Implements MIPObject.
void MipResources::URG04LXmmCommand::setDevice | ( | const char * | device | ) |
Change device path, FILE*, file descriptor.
[in] | *device | New device path. |
int MipResources::URG04LXmmCommand::writeCmd | ( | char * | s | ) |
int MipResources::URG04LXmmCommand::readCmd | ( | char * | s | ) |
Receive the answer of the sensor to a command.
[in] | *s | Pointer to the first character of the ExtString containing the answer of the sensor. |
ExtString MipResources::URG04LXmmCommand::int2string | ( | int | bytes, | |
int | value | |||
) |
Converts an int into a strig made of a fixed number of characters.
[in] | bytes | Number of characters of the string. |
[in] | value | Int value to convert. |
Verifies that the echo of the responses is equal to the commad sent to URG.
[in] | command | Command sent. |
[out] | response | Response received. |
Compare the STATUS camp of the response with status param.
[in] | command | Command sent. |
[out] | response | Response received. |
void MipResources::URG04LXmmCommand::changeProtocol | ( | ) |
Changes protocol to SCIP2.0.
void MipResources::URG04LXmmCommand::on | ( | ) |
Turn on laser for scanning.
void MipResources::URG04LXmmCommand::off | ( | ) |
Turn off laser for scanning.
void MipResources::URG04LXmmCommand::reset | ( | void | ) |
Reset sensor switching off laser and resetting all parameters to default values.
Useful to match host and sensor time and to evaluate avg data TX time.
[in] | testString | Parameter for avg data TX time evaluation. |
bool MipResources::URG04LXmmCommand::localFSM | ( | char * | _command, | |
ExtString & | _output | |||
) |
Implements a FSM locally called for I/O opeations.
[in] | *_command | Command to send. |
[out] | &_output | Response received. |
void MipResources::URG04LXmmCommand::setSCIP2 | ( | ) | [inline] |
Set _SCIP2 flag.
void MipResources::URG04LXmmCommand::unsetSCIP2 | ( | ) | [inline] |
Unset _SCIP2 flag.
void MipResources::URG04LXmmCommand::setFirstBlock | ( | ) | [inline] |
Set _isReceiving flag.
void MipResources::URG04LXmmCommand::setVerboseOn | ( | ) | [inline] |
Set _verboseOn flag.
void MipResources::URG04LXmmCommand::setLog | ( | ) | [inline] |
Set _log flag.
void MipResources::URG04LXmmCommand::setfdBad | ( | ) | [inline] |
Set _fdBad flag.
void MipResources::URG04LXmmCommand::unsetFirstBlock | ( | ) | [inline] |
Unset _isReceiving flag.
void MipResources::URG04LXmmCommand::setIsFinished | ( | ) | [inline] |
Set _isFinished flag.
void MipResources::URG04LXmmCommand::unsetIsFinished | ( | ) | [inline] |
Unset _isFinished flag.
void MipResources::URG04LXmmCommand::unsetVerboseOn | ( | ) | [inline] |
Unset _verboseOn flag.
void MipResources::URG04LXmmCommand::unsetLog | ( | ) | [inline] |
Unset _log flag.
void MipResources::URG04LXmmCommand::unsetfdBad | ( | ) | [inline] |
Unset _fdBad flag.
const char* MipResources::URG04LXmmCommand::device | ( | ) | [inline] |
get device path
FILE* MipResources::URG04LXmmCommand::laserPort | ( | ) | [inline] |
get FILE* of device
int MipResources::URG04LXmmCommand::fd | ( | ) | [inline] |
get file descriptor of device
bool MipResources::URG04LXmmCommand::SCIP2 | ( | ) | [inline] |
get _SCIP2 flag
bool MipResources::URG04LXmmCommand::firstBlock | ( | ) | [inline] |
get _isReceiving flag
bool MipResources::URG04LXmmCommand::isFinished | ( | ) | [inline] |
get _isFinished flag
bool MipResources::URG04LXmmCommand::verboseOn | ( | ) | [inline] |
return _verboseOn flag
bool MipResources::URG04LXmmCommand::log | ( | ) | [inline] |
return _log flag
bool MipResources::URG04LXmmCommand::fdBad | ( | ) | [inline] |
return _fdBad flag