diff options
Diffstat (limited to 'src/plugins/canbus/systeccan/systeccan_symbols_p.h')
-rw-r--r-- | src/plugins/canbus/systeccan/systeccan_symbols_p.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/canbus/systeccan/systeccan_symbols_p.h b/src/plugins/canbus/systeccan/systeccan_symbols_p.h index 7fe98ad..ce32422 100644 --- a/src/plugins/canbus/systeccan/systeccan_symbols_p.h +++ b/src/plugins/canbus/systeccan/systeccan_symbols_p.h @@ -81,6 +81,20 @@ typedef void (DRV_CALLBACK_TYPE *tCallbackFktEx) (tUcanHandle handle, quint32 ev #define USBCAN_EVENT_FATALDISCON 8 // a USB-CANmodul has been disconnected during operation #define USBCAN_EVENT_RESERVED1 0x80 +// CAN status flags (is returned with function UcanGetStatus() or UcanGetStatusEx() ) +#define USBCAN_CANERR_OK 0x0000 // no error +#define USBCAN_CANERR_XMTFULL 0x0001 // Tx-buffer of the CAN controller is full +#define USBCAN_CANERR_OVERRUN 0x0002 // Rx-buffer of the CAN controller is full +#define USBCAN_CANERR_BUSLIGHT 0x0004 // Bus error: Error Limit 1 exceeded (refer to SJA1000 manual) +#define USBCAN_CANERR_BUSHEAVY 0x0008 // Bus error: Error Limit 2 exceeded (refer to SJA1000 manual) +#define USBCAN_CANERR_BUSOFF 0x0010 // Bus error: CAN controller has gone into Bus-Off state +#define USBCAN_CANERR_QRCVEMPTY 0x0020 // RcvQueue is empty +#define USBCAN_CANERR_QOVERRUN 0x0040 // RcvQueue overrun +#define USBCAN_CANERR_QXMTFULL 0x0080 // transmit queue is full +#define USBCAN_CANERR_REGTEST 0x0100 // Register test of the SJA1000 failed +#define USBCAN_CANERR_MEMTEST 0x0200 // Memory test failed +#define USBCAN_CANERR_TXMSGLOST 0x0400 // transmit CAN message was automatically deleted by firmware + #define kUcanModeNormal 0x00 // normal mode (send and receive) #define kUcanModeListenOnly 0x01 // listen only mode (only receive) #define kUcanModeTxEcho 0x02 // CAN messages which was sent will be received at UcanReadCanMsg.. @@ -143,6 +157,11 @@ typedef struct _tCanMsgStruct { quint32 m_dwTime; // Time in ms } tCanMsgStruct; +typedef struct _tStatusStruct { + quint16 m_wCanStatus; // current CAN status + quint16 m_wUsbStatus; // current USB status +} tStatusStruct; + // Function return codes (encoding) #define USBCAN_SUCCESSFUL 0x00 // no error #define USBCAN_ERR 0x01 // error in library; function has not been executed @@ -282,6 +301,7 @@ GENERATE_SYMBOL_VARIABLE(UCANRET, UcanDeinitCanEx, tUcanHandle, quint8 /* channe GENERATE_SYMBOL_VARIABLE(UCANRET, UcanReadCanMsgEx, tUcanHandle, quint8 *, tCanMsgStruct *, quint32 *) GENERATE_SYMBOL_VARIABLE(UCANRET, UcanResetCan, tUcanHandle) GENERATE_SYMBOL_VARIABLE(UCANRET, UcanWriteCanMsgEx, tUcanHandle, quint8, tCanMsgStruct *, quint32 *) +GENERATE_SYMBOL_VARIABLE(UCANRET, UcanGetStatus, tUcanHandle, tStatusStruct *) inline bool resolveSymbols(QLibrary *systecLibrary) { @@ -303,6 +323,7 @@ inline bool resolveSymbols(QLibrary *systecLibrary) RESOLVE_SYMBOL(UcanReadCanMsgEx); RESOLVE_SYMBOL(UcanResetCan); RESOLVE_SYMBOL(UcanWriteCanMsgEx); + RESOLVE_SYMBOL(UcanGetStatus); return true; } |