|
automotive-message-broker
0.14.803
|
Wrapper around different implementations of SocketCAN. More...
#include <cansocket.h>
Public Types | |
| enum | CANSocketReadSuccess { READING_FAILED = -1, READING_TIMED_OUT, READING_SUCCEEDED } |
Public Member Functions | |
| virtual bool | start (const char *ifName)=0 |
| virtual void | stop () |
| virtual bool | write (const struct CANFrameInfo &message) |
| virtual CANSocket::CANSocketReadSuccess | read (struct CANFrameInfo &message, unsigned int timeout=1000) |
| virtual bool | registerCyclicMessageForReceive (int canId, double minCycleTime, double maxCycleTime) |
| virtual bool | unregisterMessageForReceive (int canId) |
Wrapper around different implementations of SocketCAN.
CAN Socket wrapper.
CAN bus socket error.
|
virtual |
Try to read CAN frame
| message | Buffer for CAN frame with additional information |
| timeout | Timeout for reading in [ms]. |
Reimplemented in CANSocketBCM, and CANSocketRaw.
|
virtual |
Registers CAN ID of a cyclic message for receiving
| canId | CAN ID of the message. |
| minCycleTime | Minimal interval between messages in seconds. Set to 0 if not used. |
| maxCycleTime | Maximum interval between messages for timeout detection in seconds. Set to 0 if no timeout detection is necessary. |
Reimplemented in CANSocketBCM.
|
pure virtual |
Opens and initializes CAN socket
| ifName | Name of the CAN bus network interface. |
Implemented in CANSocketBCM, and CANSocketRaw.
|
virtual |
Closes the socket
Reimplemented in CANSocketBCM, and CANSocketRaw.
|
virtual |
Un-registers CAN ID of a message used of receiving. Valid for cyclic and sporadic messages.
| canId | CAN ID of the message. |
Reimplemented in CANSocketBCM.
|
virtual |
Writes CAN frame using the socket
| message | CAN frame with additional information |
| bytesWritten | Number of written bytes. |
Reimplemented in CANSocketBCM, and CANSocketRaw.
1.8.2