Public Member Functions | Static Protected Member Functions | Private Attributes
CCdlSocket Class Reference

Encapsulates the socket communication device. More...

#include <cdlSocket.h>

Inheritance diagram for CCdlSocket:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CCdlSocket (char *adress, int port)
 Constructs a CCdlSocket object.
virtual int disconnect ()
 Terminates the socket connection.
virtual int recv (void *_buf, int _size)
 Receives data from the socket.
virtual int send (const void *_buf, int _size)
 Sends data to the socket.
virtual ~CCdlSocket ()
 Destructs the object.

Static Protected Member Functions

static char digit (const int _val)
 Converts an integer to a char.

Private Attributes

char * _ipAddr
 IP Address of the Robot or simulation environment.
int _len
 Length of the message.
int _port
 Port number of the KNI communication socket.
struct sockaddr_in _socketAddr
 Structure to fill in the socket communication parameteres.
int _socketfd
 File handler for the socket.

Detailed Description

Encapsulates the socket communication device.

This class is responsible for direct communication with the Katana robot or its simulation environment through sockets. It builds the lowest layer for KNI communication and uses the system API functions to get access to the socket.

Definition at line 65 of file cdlSocket.h.


Constructor & Destructor Documentation

CCdlSocket::CCdlSocket ( char *  adress,
int  port 
)

Constructs a CCdlSocket object.

To this constructor the socket's AF_INET address (for platform independence) and port number have to be given as parameters. An attempt to open a connection to the desired device will be tried and if successful, 'lastOP()' will return 'lopDONE', otherwise 'lopFAIL'.

Definition at line 89 of file cdlSocket.cpp.

CCdlSocket::~CCdlSocket ( ) [virtual]

Destructs the object.

Definition at line 120 of file cdlSocket.cpp.


Member Function Documentation

static char CCdlSocket::digit ( const int  _val) [inline, static, protected]

Converts an integer to a char.

Definition at line 97 of file cdlSocket.h.

int CCdlSocket::disconnect ( ) [virtual]

Terminates the socket connection.

Definition at line 156 of file cdlSocket.cpp.

int CCdlSocket::recv ( void *  _buf,
int  _size 
) [virtual]

Receives data from the socket.

Implements CCdlBase.

Definition at line 142 of file cdlSocket.cpp.

int CCdlSocket::send ( const void *  _buf,
int  _size 
) [virtual]

Sends data to the socket.

Implements CCdlBase.

Definition at line 125 of file cdlSocket.cpp.


Member Data Documentation

char* CCdlSocket::_ipAddr [private]

IP Address of the Robot or simulation environment.

Set to localhost or 127.0.0.1 if the simulation runs on the same machine

Definition at line 69 of file cdlSocket.h.

int CCdlSocket::_len [private]

Length of the message.

Definition at line 73 of file cdlSocket.h.

int CCdlSocket::_port [private]

Port number of the KNI communication socket.

Definition at line 71 of file cdlSocket.h.

struct sockaddr_in CCdlSocket::_socketAddr [private]

Structure to fill in the socket communication parameteres.

Definition at line 88 of file cdlSocket.h.

int CCdlSocket::_socketfd [private]

File handler for the socket.

Definition at line 86 of file cdlSocket.h.


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


kni
Author(s): Martin Günther
autogenerated on Thu Aug 27 2015 13:40:08