rllib  1
Public Member Functions | Public Attributes | Private Attributes | List of all members
rlCanOpenDaemon Class Reference

canopen tcp/ip interface for concurrent device-access of multiple clientprocesses More...

#include <rlcanopendaemon.h>

Collaboration diagram for rlCanOpenDaemon:
Collaboration graph
[legend]

Public Member Functions

 rlCanOpenDaemon ()
 empty constructor initializes on port 5000. More...
 
 rlCanOpenDaemon (int _port, char *_iniFileName=0)
 main constructor sets port and inifilename. More...
 
 ~rlCanOpenDaemon ()
 destructor destroys rlcanopen object More...
 
int getPort ()
 returns value of current port More...
 
void start ()
 runs service in endless loop More...
 

Public Attributes

rlCanOpennodes
 
rlThread daemon_thread
 

Private Attributes

int port
 

Detailed Description

canopen tcp/ip interface for concurrent device-access of multiple clientprocesses

this is a multi threaded server process, which listens on a tcp port for incomming connections. It runs the only recommended instance of rlcanopen class for beeing the very only process accessing the device. Different processes who concurrently try to access the device will be queued autmaticly by daemonprocess. These processes are inteded to communicate through rlcanopenclient.

Definition at line 51 of file rlcanopendaemon.h.

Constructor & Destructor Documentation

◆ rlCanOpenDaemon() [1/2]

rlCanOpenDaemon::rlCanOpenDaemon ( )

empty constructor initializes on port 5000.

empty constructor initializes on port 5000. creates a new rlCanOpen Object which performs all access to canopen device

Definition at line 253 of file rlcanopendaemon.cpp.

253  {
254  nodes = new rlCanOpen();
255  port = 5000;
256 }
main class which provides canopen API functions and manages all nodes.
Definition: rlcanopen.h:55
rlCanOpen * nodes

◆ rlCanOpenDaemon() [2/2]

rlCanOpenDaemon::rlCanOpenDaemon ( int  _port,
char *  _iniFileName = 0 
)

main constructor sets port and inifilename.

main constructor sets port and inifilename.
creates a new rlCanOpen Object which performs all access to canopen device

Definition at line 259 of file rlcanopendaemon.cpp.

259  {
260  if (_iniFileName!=0){
261  nodes = new rlCanOpen(_iniFileName);
262  }
263  else{
264  nodes = new rlCanOpen();
265  }
266  port = _port;
267 
268 
269 }
main class which provides canopen API functions and manages all nodes.
Definition: rlcanopen.h:55
rlCanOpen * nodes

◆ ~rlCanOpenDaemon()

rlCanOpenDaemon::~rlCanOpenDaemon ( )

destructor destroys rlcanopen object

destructor destroys rlcanopen object

Definition at line 272 of file rlcanopendaemon.cpp.

272  {
273  rlDebugPrintf("destruktor rlCanOpenDaemon\n");
274  if (nodes!=0){
275  delete nodes;
276  }
277 }
int rlDebugPrintf(const char *format,...)
Definition: rlcutil.cpp:61
rlCanOpen * nodes

Member Function Documentation

◆ getPort()

int rlCanOpenDaemon::getPort ( )

returns value of current port

returns value of current port

Definition at line 280 of file rlcanopendaemon.cpp.

280  {
281  return port;
282 }

◆ start()

void rlCanOpenDaemon::start ( )

runs service in endless loop

daemon creates a listener thread which handels incoming connections by himself creating clientconnection threads for each client connecting to the daemon.

Definition at line 288 of file rlcanopendaemon.cpp.

288  {
290  /* NO NO this has to be done by the user RL 17.06.2004
291  while(1){
292  rlsleep(100);
293  }
294  */
295 }
rlThread daemon_thread
int create(void *(*func)(void *), void *argument)
Definition: rlthread.cpp:35
static void * listenerthread(void *arg)

Member Data Documentation

◆ daemon_thread

rlThread rlCanOpenDaemon::daemon_thread

rlThread object which manages basic thread functionality e.g. locking to prevent threads from concurrently accessing the canopen device

Definition at line 81 of file rlcanopendaemon.h.

◆ nodes

rlCanOpen* rlCanOpenDaemon::nodes

pointer to rlCanOpen Object which performs all access to canopen device

Definition at line 76 of file rlcanopendaemon.h.

◆ port

int rlCanOpenDaemon::port
private

Definition at line 84 of file rlcanopendaemon.h.


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