#include "rec/robotino/com/c/globals.h"
#include "rec/robotino/com/c/AnalogInput.h"
#include "rec/robotino/com/c/Bumper.h"
#include "rec/robotino/com/c/Camera.h"
#include "rec/robotino/com/c/DigitalInput.h"
#include "rec/robotino/com/c/DigitalOutput.h"
#include "rec/robotino/com/c/DistanceSensor.h"
#include "rec/robotino/com/c/EncoderInput.h"
#include "rec/robotino/com/c/Gripper.h"
#include "rec/robotino/com/c/Info.h"
#include "rec/robotino/com/c/Motor.h"
#include "rec/robotino/com/c/NorthStar.h"
#include "rec/robotino/com/c/Odometry.h"
#include "rec/robotino/com/c/OmniDrive.h"
#include "rec/robotino/com/c/PowerManagement.h"
#include "rec/robotino/com/c/PowerOutput.h"
#include "rec/robotino/com/c/Relay.h"
#include "rec/robotino/com/c/LaserRangeFinder.h"
#include "rec/robotino/com/c/Manipulator.h"
Go to the source code of this file.
Defines | |
#define | INVALID_COMID -1 |
Typedefs | |
typedef int | ComId |
Functions | |
DLLEXPORT ComId | Com_construct () |
DLLEXPORT BOOL | Com_destroy (ComId id) |
DLLEXPORT BOOL | Com_setAddress (ComId id, const char *address) |
DLLEXPORT BOOL | Com_address (ComId id, char *addressBuffer, unsigned int addressBuffersSize) |
DLLEXPORT BOOL | Com_setImageServerPort (ComId id, int port) |
DLLEXPORT BOOL | Com_connect (ComId id) |
DLLEXPORT BOOL | Com_disconnect (ComId id) |
DLLEXPORT BOOL | Com_isConnected (ComId id) |
Use Com_construct() to create a new com object. Set the IP-address of Robotino with Com_setAddress(). Com_connect() establishes the connection.
include "rec/robotino/com/c/Com.h"
ComId com;
int main( int argc, char **argv ) { com = Com_construct();
if( argc > 1 ) { Com_setAddress( com, argv[1] ); } else { Com_setAddress( com, "172.26.1.1" ); }
if( FALSE == Com_connect( com ) ) { exit( 1 ); } else { char addressBuffer[256]; Com_address( com, addressBuffer, 256 ); printf( "Connected to %s\n", addressBuffer ); }
Com_destroy( com );
return 0; }
DLLEXPORT BOOL Com_address | ( | ComId | id, | |
char * | addressBuffer, | |||
unsigned int | addressBuffersSize | |||
) |
id | The ComId returned by Com_construct(). | |
addressBuffer | Will contain the currently active server address set with Com_setAddress() as '' terminated string. | |
addressBuffersSize | The size of addressBuffer. |
DLLEXPORT BOOL Com_connect | ( | ComId | id | ) |
Establish the communication. Call Com_setAddress() first.
id | The ComId returned by Com_construct(). |
DLLEXPORT ComId Com_construct | ( | ) |
Construct an interface for communicating to one Robotino
DLLEXPORT BOOL Com_destroy | ( | ComId | id | ) |
Destroy the communication interface assigned to id
id | The id of the communication interface to be destroyed |
DLLEXPORT BOOL Com_disconnect | ( | ComId | id | ) |
Stop communication.
id | The ComId returned by Com_construct(). |
DLLEXPORT BOOL Com_isConnected | ( | ComId | id | ) |
Check if the communication is established.
id | The ComId returned by Com_construct(). |
DLLEXPORT BOOL Com_setAddress | ( | ComId | id, | |
const char * | address | |||
) |
id | The ComId returned by Com_construct(). | |
address | A null terminated string containing the (IP)-address (plus port) of Robotino. The default to connect to Robotino is 172.26.1.1 (port can be omitted. To connect to RobotinoSim running at localhost use 127.0.0.1:8080 (or higher ports). |
DLLEXPORT BOOL Com_setImageServerPort | ( | ComId | id, | |
int | port | |||
) |
id | The ComId returned by Com_construct(). | |
port | The image server port. To be able to receive images from Robotino there is a UDP server running on your machine. The default port is 8080, but you might change this. |