143 printf(
"no connection to server!\n");
146 cout<<
"connection established...\n";
154 printf(
"disconnection...\n");
258 message.
pdoid=_pdonr;
286 int ret =
pdo_receive(_boardnr, _nodeid, _pdonr, -1, _pdo_data);
309 message.
pdoid=_pdonr;
338 return pdo_transmit(_boardnr, _nodeid, _pdonr, -1, _pdo_data);
349 message.
mtext[0] = _cmd;
387 message.
mtext[0] = (char) _restarttype;
int pdo_transmit(int _boardnr, int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
sends a single mapped pdo object to daemon.
int sendNMTCommand(int _nodeid, unsigned char _cmd, bool &returnstate)
int write(const void *buf, int len)
the IPCMSGSTRUCT is the transfer buffer which is send trough TCP sockets
void setActive(int active)
int disconnect()
disconnects from daemon
void getIpcMsg(IPCMSGSTRUCT _myIpcMsg)
overwrites all data with IPCMSGSTRUCT data
char remoteadress[40]
string of remoteadress
class to handle CANopen types
Class performs API rlcanopen functions remotely through tcp sockets.
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 restartBoard(int _restarttype, bool &returnstate)
int pdo_receive(int _boardnr, int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
receives single mapped pdo object from daemon.
rlCanOpenClient()
initializes the client on localhost port 5000
rlCanClient(int _port, char *_remoteadress, int _boardnr)
int pdo_receive(int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
int restartBoard(int _boardnr, int _restarttype, bool &returnstate)
forces daemon to restart canopen device.
int pdo_transmit(int _nodeid, int _pdonr, int _mappingnr, rlCanOpenTypes &_pdo_data)
int read(void *buf, int len, int timeout=0)
int sdo_write(int _nodeid, int _objectindex, int _subindex, rlCanOpenTypes &_sdo_data)
int sendNMTCommand(int _boardnr, int _nodeid, unsigned char _cmd, bool &returnstate)
sends a NMT command to daemon.
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
rlSocket * socket
pointer to socket object
int getNodeState(int _nodeid, rlCanOpenTypes &_data)
int pid
variable contains process id
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.
bool connected
flag indicates connection status
int port
variable contains port
IPCMSGSTRUCT createIpcMsg()
returns a IPCMSGSTRUCT filled with current object data
int sdo_read(int _nodeid, int _objectindex, int _subindex, rlCanOpenTypes &_sdo_data)
~rlCanOpenClient()
destructor disconnects client
void setAdr(const char *adr)
int client_timeout
timeout in ms
void setPort(int _port)
setter for private port variable
void setAdr(char *_adr)
setter for private remoteadress variable