Represents a communication device.
More...
#include <Com.h>
Represents a communication device.
rec::robotino::api2::Com::Com |
( |
| ) |
|
Construct the Com object.
- Exceptions
-
rec::robotino::api2::Com::Com |
( |
const char * |
name | ) |
|
Construct the Com object.
- Parameters
-
name | A custom name for the client. If NULL, a default name will be used. |
- Exceptions
-
rec::robotino::api2::Com::Com |
( |
const char * |
name, |
|
|
bool |
multiThreadedSerialization |
|
) |
| |
Construct the Com object.
- Parameters
-
name | A custom name for the client. If NULL, a default name will be used. |
multiThreadedSerialization | If true, (de)serialization tasks will be performed by multiple threads. This should perform better on multi core CPUs. |
- Exceptions
-
rec::robotino::api2::Com::Com |
( |
const char * |
name, |
|
|
bool |
multiThreadedSerialization, |
|
|
bool |
localIPCEnabled |
|
) |
| |
Construct the Com object.
- Parameters
-
name | A custom name for the client. If NULL, a default name will be used. |
multiThreadedSerialization | If true, (de)serialization tasks will be performed by multiple threads. This should perform better on multi core CPUs. |
localIPCEnabled | If true, local sockets and shared memory is used for communication. This can lead to problems due to different privileges of the server and the client. But is of course much faster than TCP sockets. If false TCP sockets are used only. |
- Exceptions
-
virtual rec::robotino::api2::Com::~Com |
( |
| ) |
|
|
virtual |
const char* rec::robotino::api2::Com::address |
( |
| ) |
const |
Returns the currently active server address.
- Returns
- Address set with setAddress
- See also
- setAddress
- Exceptions
-
virtual void rec::robotino::api2::Com::connectedEvent |
( |
| ) |
|
|
virtual |
This function is called if a connection to Robotino has been established. Note: This function is called from outside the applications main thread. This is extremely important particularly with regard to GUI applications.
- Exceptions
-
- See also
- processEvents
virtual void rec::robotino::api2::Com::connectionClosedEvent |
( |
| ) |
|
|
virtual |
This function is called when a connection is closed. Note: This function is called from outside the applications main thread. This is extremely important particularly with regard to GUI applications.
- Exceptions
-
- See also
- processEvents
void rec::robotino::api2::Com::connectToServer |
( |
bool |
isBlocking = true | ) |
|
Connects to the server. This function blocks until the connection is established or an error occurs.
- Parameters
-
isBlocking | If true, this function blocks until the connection is established or an error occurs. Otherwise the function is non blocking and you have to wait for error or connected callbacks. |
- Exceptions
-
In | blocking mode a ComException is thrown if the client couldn't connect. In non blocking mode throws nothing. |
void rec::robotino::api2::Com::disconnectFromServer |
( |
| ) |
|
Disconnects from the server and disables autoupdating.
- Exceptions
-
virtual void rec::robotino::api2::Com::errorEvent |
( |
const char * |
errorString | ) |
|
|
virtual |
This function is called on errors.
- Parameters
-
errorString | A human readable error description. |
- Exceptions
-
- See also
- processEvents
ComId rec::robotino::api2::Com::id |
( |
| ) |
const |
The unique identifier of this communication object.
- Returns
- The identifier.
- Exceptions
-
bool rec::robotino::api2::Com::isConnected |
( |
| ) |
const |
Test wether the client is connected to the server.
- Returns
- TRUE if connected, FALSE otherwise.
- Exceptions
-
bool rec::robotino::api2::Com::isLocalConnection |
( |
| ) |
const |
- Returns
- Returns true if the connection is a local connection. Otherwise returns false.
virtual void rec::robotino::api2::Com::logEvent |
( |
const char * |
message, |
|
|
int |
level |
|
) |
| |
|
virtual |
This function is called when a log message is posted. Note: This function is called from outside the applications main thread. This is extremely important particularly with regard to GUI applications.
- Parameters
-
message | The log message. |
level | The log level. |
- Exceptions
-
- See also
- processEvents
unsigned int rec::robotino::api2::Com::msecsElapsed |
( |
| ) |
const |
- Returns
- Milliseconds since connection to server had ben established.
void rec::robotino::api2::Com::processChargerEvents |
( |
| ) |
|
Call this function from your main thread to get the virtual Charger functions called. The virtual functions are called directly by a call of this function
- Exceptions
-
- See also
- Com::processEvents
void rec::robotino::api2::Com::processComEvents |
( |
| ) |
|
Call this function from your main thread to get the virtual functions of this Com object called. The virtual functions are called directly by a call of this function.
- Exceptions
-
void rec::robotino::api2::Com::processEvents |
( |
| ) |
|
Call this function from your main thread to get the virtual functions of all ComObjects called. The virtual functions are called directly by a call of this function.
- Exceptions
-
void rec::robotino::api2::Com::processFactory4Events |
( |
| ) |
|
Call this function from your main thread to get the virtual Factory4 functions called. The virtual functions are called directly by a call of this function
- Exceptions
-
- See also
- Com::processEvents
void rec::robotino::api2::Com::processPowerButtonEvents |
( |
| ) |
|
Call this function from your main thread to get the virtual PowerButton functions called. The virtual functions are called directly by a call of this function
- Exceptions
-
- See also
- Com::processEvents
void rec::robotino::api2::Com::setAddress |
( |
const char * |
address | ) |
|
Sets the address of the server.
- Parameters
-
address | The address of the server e.g. "172.26.1.1" or "127.0.0.1" To connect to Robotino Sim you also have to specify the server port. The first simulated Robotino listens at port 8080. The address is then "127.0.0.1:8080". Without port specification port 80 (Robotino's default port) is used. |
- See also
- address
- Exceptions
-
void rec::robotino::api2::Com::setAutoReconnectEnabled |
( |
bool |
enable | ) |
|
Enable/disable automatic reconnection
When enabled the client tries to reconnect automatically after the specified number of milliseconds.
- Parameters
-
enable | If true the automatic reconnect will be enabled. If false the client does not reconnect to the server automatically. |
- See also
- connected(), disconnected(), disconnectFromServer()
void rec::robotino::api2::Com::setMultiThreadedSerializationEnabled |
( |
bool |
enabled | ) |
|
Enable/disable multi-threaded serialization. Disabled by default.
- Parameters
-
enabled | If true, (de)serialization tasks will be performed by multiple threads. This should perform better on multi core CPUs. |
- Exceptions
-
void rec::robotino::api2::Com::setName |
( |
const char * |
name | ) |
|
Set the client's name
- Parameters
-
name | A custom name for the client. If NULL, a default name will be used. |
- Exceptions
-
The documentation for this class was generated from the following file:
- C:/srcs/git/openrobotino/api2/lib/rec/robotino/api2/Com.h