CANpie FD
CAN programming interface environment - Version 3.08
|
The QCanInterface class describes one physical CAN interface. The CAN interface is typically implemented inside a CAN plug-in (see QCanPlugin). After connection to the CAN interface (see connect()) the use can read and write CAN frames via this hardware.
If the QCanInterface class is used for console applications, (i.e. no Qt GUI support), the definition QCAN_NO_QT_GUI must be set.
Inherits QObject.
Public Types | |
enum | InterfaceError_e { , eERROR_LIBRARY = -3, eERROR_DEVICE = -2, eERROR_UNKNOWN = -1, eERROR_NONE, eERROR_BITRATE , eERROR_USED, eERROR_FIFO_RCV_EMPTY, eERROR_FIFO_TRM_FULL } |
enum | ConnectionState_e { UnconnectedState = 0, ConnectingState, ConnectedState, ClosingState, FailureState } |
Signals | |
void | addLogMessage (const QString &clMessageR, const LogLevel_e &teLogLevelR=eLOG_LEVEL_WARN) |
void | connectionChanged (const QCanInterface::ConnectionState_e &teConnectionStateR) |
void | readyRead (void) |
void | stateChanged (const CAN_State_e &teCanStateR) |
Public Member Functions | |
virtual bool | configureDevice (void) |
virtual InterfaceError_e | connect (void)=0 |
virtual ConnectionState_e | connectionState (void)=0 |
virtual InterfaceError_e | disconnect (void)=0 |
virtual QIcon | icon (void)=0 |
virtual QString | name (void)=0 |
virtual InterfaceError_e | read (QCanFrame &clFrameR)=0 |
virtual InterfaceError_e | reset (void)=0 |
virtual InterfaceError_e | setBitrate (int32_t slNomBitRateV, int32_t slDatBitRateV=eCAN_BITRATE_NONE)=0 |
virtual InterfaceError_e | setMode (const CAN_Mode_e teModeV)=0 |
virtual uint32_t | supportedFeatures (void)=0 |
virtual QString | version (void) |
virtual InterfaceError_e | write (const QCanFrame &clFrameR)=0 |
This enumeration describes the state of a CAN interface connection.
This enumeration describes possible error conditions.
|
signal |
[in] | clMessageR | - Logging message |
[in] | teLogLevelR | - Logging level |
This signal is emitted by the CAN interface to inform the application about status changes or error conditions.
|
inlinevirtual |
This method is used to initiate a device specific configuration which is out of scope of this interface class. A return value of true means the interface settings have been changed.
|
pure virtual |
Connect to the physical CAN interface.
|
signal |
[in] | teConnectionStateR | - CAN interface connection state |
This signal is emitted once when the connection state of the interface changes.
|
pure virtual |
true
if connection is possible The function returns true
if the interface is connected.
|
pure virtual |
Disconnect from the physical CAN interface.
|
pure virtual |
The function returns an icon for the physical CAN interface. In case an application is compiled without Qt GUI support, the definition QCAN_NO_QT_GUI must be set.
|
pure virtual |
The function returns a name for the physical CAN interface.
|
pure virtual |
[out] | clFrameR | CAN frame |
The functions reads a CAN message (data or error frame) from the CAN interface. The data is copied to the QByteArray clDataR. If no message is available, the function will return the value eERROR_FIFO_RCV_EMPTY. On success the function returns eERROR_NONE.
|
signal |
This signal is emitted once every time new data is available for reading from the device's current read channel. It will only be emitted again once new data is available.
|
pure virtual |
The functions resets a CAN a physical CAN interface. All statistic information will be reset also. On success the function returns eERROR_NONE.
|
pure virtual |
[in] | slNomBitRateV | Nominal Bit-rate value |
[in] | slDatBitRateV | Data Bit-rate value |
This function sets the bit-rate of the CAN interface. If the physical CAN interface does not support CAN FD, the parameter slDatBitRateV
is not evaluated.
|
pure virtual |
[in] | teModeV | CAN mode |
Set mode of the physical CAN interface.
|
signal |
[in] | teCanStateR | - CAN state |
This signal is emitted by the CAN interface to inform the application about state changes of the CAN controller.
|
pure virtual |
The functions returns information about the supported features of a CAN interface. Possible features are CAN FD support, Listen-Only support or detection of Error Frames. The return value is a bit-mask using values defined inside the header file qcan_defs.hpp.
|
inlinevirtual |
The function returns version information of the physical CAN interface.
|
pure virtual |
[in] | clFrameR | CAN frame |
The functions writes a CAN message (data frame) to the CAN interface. The CAN frame data is defined by the parameter clFrameR. On success the function returns eERROR_NONE.