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

#include <rlcanopenclient.h>

Inheritance diagram for rlCanClient:
Inheritance graph
[legend]
Collaboration diagram for rlCanClient:
Collaboration graph
[legend]

Public Member Functions

 rlCanClient (int _port, char *_remoteadress, int _boardnr)
 
 ~rlCanClient ()
 
int sdo_read (int _nodeid, int _objectindex, int _subindex, rlCanOpenTypes &_sdo_data)
 
int sdo_write (int _nodeid, int _objectindex, int _subindex, rlCanOpenTypes &_sdo_data)
 
int pdo_receive (int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
 
int pdo_receive (int _nodeid, int _pdonr, rlCanOpenTypes &_pdo_data)
 
int pdo_transmit (int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
 
int pdo_transmit (int _nodeid, int _pdonr, rlCanOpenTypes &_pdo_data)
 
int sendNMTCommand (int _nodeid, unsigned char _cmd, bool &returnstate)
 
int restartBoard (int _restarttype, bool &returnstate)
 
int getNodeState (int _nodeid, rlCanOpenTypes &_data)
 
- Public Member Functions inherited from rlCanOpenClient
 rlCanOpenClient ()
 initializes the client on localhost port 5000 More...
 
 rlCanOpenClient (int _port, char *_remoteadress)
 initializes the client on given port and remove server adress More...
 
 ~rlCanOpenClient ()
 destructor disconnects client More...
 
int connect ()
 opens a new connection to a running rlCanOpenDaemon More...
 
int disconnect ()
 disconnects from daemon More...
 
int sdo_read (int _boardnr, int _nodeid, int _objectindex, int _subindex, rlCanOpenTypes &_sdo_data)
 remotely reads a certain object from the object dictionary of a node. More...
 
int sdo_write (int _boardnr, int _nodeid, int _objectindex, int _subindex, rlCanOpenTypes &_sdo_data)
 remotely writes data into a certain object from the object dictionary of a node More...
 
int pdo_receive (int _boardnr, int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
 receives single mapped pdo object from daemon. More...
 
int pdo_receive (int _boardnr, int _nodeid, int _pdonr, rlCanOpenTypes &_pdo_data)
 receives an 8 byte pdo from daemon. More...
 
int pdo_transmit (int _boardnr, int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
 sends a single mapped pdo object to daemon. More...
 
int pdo_transmit (int _boardnr, int _nodeid, int _pdonr, rlCanOpenTypes &_pdo_data)
 sends an 8 byte pdo to daemon. More...
 
int sendNMTCommand (int _boardnr, int _nodeid, unsigned char _cmd, bool &returnstate)
 sends a NMT command to daemon. More...
 
int restartBoard (int _boardnr, int _restarttype, bool &returnstate)
 forces daemon to restart canopen device. More...
 
int getNodeState (int _boardnr, int _nodeid, rlCanOpenTypes &_data)
 receives node state data of particular node from daemon. More...
 
void setPort (int _port)
 setter for private port variable More...
 
void setAdr (char *_adr)
 setter for private remoteadress variable More...
 

Private Attributes

int boardnr
 

Additional Inherited Members

- Public Types inherited from rlCanOpenClient
enum  rl_msg {
  MSG_SEND = 0, MSG_RECEIVE = 1, MSG_SDO_READ = 0, MSG_SDO_WRITE = 1,
  MSG_PDO_RECEIVE = 3, MSG_CONNECT = 5, MSG_DISCONNECT = 6, MSG_PDO_TRANSMIT = 4,
  MSG_NMT_TRANSMIT = 7, MSG_RESTART_BOARD = 8, MSG_GET_NODE_STATE = 9
}
 

Detailed Description

Definition at line 158 of file rlcanopenclient.h.

Constructor & Destructor Documentation

◆ rlCanClient()

rlCanClient::rlCanClient ( int  _port,
char *  _remoteadress,
int  _boardnr 
)

Definition at line 18 of file rlcanopenclient.cpp.

19  :rlCanOpenClient(_port, _remoteadress)
20 {
21  boardnr = _boardnr;
23 }
rlCanOpenClient()
initializes the client on localhost port 5000
int connect()
opens a new connection to a running rlCanOpenDaemon

◆ ~rlCanClient()

rlCanClient::~rlCanClient ( )

Definition at line 25 of file rlcanopenclient.cpp.

26 {
28 }
int disconnect()
disconnects from daemon

Member Function Documentation

◆ getNodeState()

int rlCanClient::getNodeState ( int  _nodeid,
rlCanOpenTypes _data 
)

Definition at line 86 of file rlcanopenclient.cpp.

87 {
88  int ret = rlCanOpenClient::getNodeState(boardnr, _nodeid, _data);
89  if(ret != 1) rlCanOpenClient::connect();
90  return ret;
91 }
int connect()
opens a new connection to a running rlCanOpenDaemon
int getNodeState(int _boardnr, int _nodeid, rlCanOpenTypes &_data)
receives node state data of particular node from daemon.

◆ pdo_receive() [1/2]

int rlCanClient::pdo_receive ( int  _nodeid,
int  _pdonr,
int  _mappingnr,
rlCanOpenTypes _pdo_data 
)

Definition at line 44 of file rlcanopenclient.cpp.

45 {
46  int ret = rlCanOpenClient::pdo_receive(boardnr, _nodeid, _pdonr, _mappingnr, _pdo_data);
47  if(ret != 1) rlCanOpenClient::connect();
48  return ret;
49 }
int pdo_receive(int _boardnr, int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
receives single mapped pdo object from daemon.
int connect()
opens a new connection to a running rlCanOpenDaemon

◆ pdo_receive() [2/2]

int rlCanClient::pdo_receive ( int  _nodeid,
int  _pdonr,
rlCanOpenTypes _pdo_data 
)

Definition at line 51 of file rlcanopenclient.cpp.

52 {
53  int ret = rlCanOpenClient::pdo_receive(boardnr, _nodeid, _pdonr, _pdo_data);
54  if(ret != 1) rlCanOpenClient::connect();
55  return ret;
56 }
int pdo_receive(int _boardnr, int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
receives single mapped pdo object from daemon.
int connect()
opens a new connection to a running rlCanOpenDaemon

◆ pdo_transmit() [1/2]

int rlCanClient::pdo_transmit ( int  _nodeid,
int  _pdonr,
int  _mappingnr,
rlCanOpenTypes _pdo_data 
)

Definition at line 58 of file rlcanopenclient.cpp.

59 {
60  int ret = rlCanOpenClient::pdo_receive(boardnr, _nodeid, _pdonr, _mappingnr, _pdo_data);
61  if(ret != 1) rlCanOpenClient::connect();
62  return ret;
63 }
int pdo_receive(int _boardnr, int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
receives single mapped pdo object from daemon.
int connect()
opens a new connection to a running rlCanOpenDaemon

◆ pdo_transmit() [2/2]

int rlCanClient::pdo_transmit ( int  _nodeid,
int  _pdonr,
rlCanOpenTypes _pdo_data 
)

Definition at line 65 of file rlcanopenclient.cpp.

66 {
67  int ret = rlCanOpenClient::pdo_receive(boardnr, _nodeid, _pdonr, _pdo_data);
68  if(ret != 1) rlCanOpenClient::connect();
69  return ret;
70 }
int pdo_receive(int _boardnr, int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
receives single mapped pdo object from daemon.
int connect()
opens a new connection to a running rlCanOpenDaemon

◆ restartBoard()

int rlCanClient::restartBoard ( int  _restarttype,
bool &  returnstate 
)

Definition at line 79 of file rlcanopenclient.cpp.

80 {
81  int ret = rlCanOpenClient::restartBoard(boardnr, _restarttype, returnstate);
82  if(ret != 1) rlCanOpenClient::connect();
83  return ret;
84 }
int restartBoard(int _boardnr, int _restarttype, bool &returnstate)
forces daemon to restart canopen device.
int connect()
opens a new connection to a running rlCanOpenDaemon

◆ sdo_read()

int rlCanClient::sdo_read ( int  _nodeid,
int  _objectindex,
int  _subindex,
rlCanOpenTypes _sdo_data 
)

Definition at line 30 of file rlcanopenclient.cpp.

31 {
32  int ret = rlCanOpenClient::sdo_read(boardnr, _nodeid, _objectindex, _subindex, _sdo_data);
33  if(ret != 1) rlCanOpenClient::connect();
34  return ret;
35 }
int sdo_read(int _boardnr, int _nodeid, int _objectindex, int _subindex, rlCanOpenTypes &_sdo_data)
remotely reads a certain object from the object dictionary of a node.
int connect()
opens a new connection to a running rlCanOpenDaemon

◆ sdo_write()

int rlCanClient::sdo_write ( int  _nodeid,
int  _objectindex,
int  _subindex,
rlCanOpenTypes _sdo_data 
)

Definition at line 37 of file rlcanopenclient.cpp.

38 {
39  int ret = rlCanOpenClient::sdo_write(boardnr, _nodeid, _objectindex, _subindex, _sdo_data);
40  if(ret != 1) rlCanOpenClient::connect();
41  return ret;
42 }
int sdo_write(int _boardnr, int _nodeid, int _objectindex, int _subindex, rlCanOpenTypes &_sdo_data)
remotely writes data into a certain object from the object dictionary of a node
int connect()
opens a new connection to a running rlCanOpenDaemon

◆ sendNMTCommand()

int rlCanClient::sendNMTCommand ( int  _nodeid,
unsigned char  _cmd,
bool &  returnstate 
)

Definition at line 72 of file rlcanopenclient.cpp.

73 {
74  int ret = rlCanOpenClient::sendNMTCommand(boardnr, _nodeid, _cmd, returnstate);
75  if(ret != 1) rlCanOpenClient::connect();
76  return ret;
77 }
int sendNMTCommand(int _boardnr, int _nodeid, unsigned char _cmd, bool &returnstate)
sends a NMT command to daemon.
int connect()
opens a new connection to a running rlCanOpenDaemon

Member Data Documentation

◆ boardnr

int rlCanClient::boardnr
private

Definition at line 173 of file rlcanopenclient.h.


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