From cd29bb84b9fc56236a78c4e400ac35d0d93280e2 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Wed, 23 Aug 2017 14:01:48 +0000 Subject: [PATCH] Refs #316. Added Kvaser Leaf Light v2 CAN interface support to LibOpenBLT. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@352 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- Host/BootCommander.exe | Bin 123392 -> 152064 bytes .../port/windows/canif/kvaser/canevt.h | 249 + .../port/windows/canif/kvaser/canlib.h | 5488 +++++++++++++++++ .../port/windows/canif/kvaser/canstat.h | 497 ++ .../port/windows/canif/kvaser/leaflight.c | 995 ++- .../port/windows/canif/kvaser/obsolete.h | 304 + .../port/windows/canif/kvaser/predef.h | 103 + .../port/windows/canif/peak/pcanusb.c | 34 +- Host/libopenblt.dll | Bin 114688 -> 130048 bytes 9 files changed, 7647 insertions(+), 23 deletions(-) create mode 100644 Host/Source/LibOpenBLT/port/windows/canif/kvaser/canevt.h create mode 100644 Host/Source/LibOpenBLT/port/windows/canif/kvaser/canlib.h create mode 100644 Host/Source/LibOpenBLT/port/windows/canif/kvaser/canstat.h create mode 100644 Host/Source/LibOpenBLT/port/windows/canif/kvaser/obsolete.h create mode 100644 Host/Source/LibOpenBLT/port/windows/canif/kvaser/predef.h diff --git a/Host/BootCommander.exe b/Host/BootCommander.exe index 7fed9a2ea5bec191a5dcff4f52cecc5044fa510a..a4ba9e0d166e96df3bb7cf4f7e2640cfa30c4ce1 100644 GIT binary patch literal 152064 zcmeFa4SZD9wKqITCNRQ;88p#YQDOm0D=He=f+4*T85@<+NnnsFDwGco_(jPCs3kUW z5}V18mR7X1)m|vHrLDKc7BN_~0V6@h$Dp)wmA27RJ#lh1tx=;y=K25EKIhCiCkfi# z=Y8J$zQ4jRXZG29?X}llYwfl7Ui;&OuU+rS@pwF5{H4<#PYZteuS}jNe)J%D)YwNy zd3K!i?Aa|@vz|SBj<&3-XvNCgZ(6zV)}loVZ@caGSkaf46s@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-y# z@5z+wU56Y;v3AvAdvwZi#<44PZ|c6(gQ>Nthfqv_} f$&_MBGi8|OMdD^{8Mf2=OrYjGVwog=p~L?HtUU!# diff --git a/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canevt.h b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canevt.h new file mode 100644 index 00000000..cd151915 --- /dev/null +++ b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canevt.h @@ -0,0 +1,249 @@ +/* +** Copyright 1999 by KVASER AB +** P.O Box 4076 SE-51104 KINNAHULT, SWEDEN +** E-mail: staff@kvaser.se WWW: http://www.kvaser.se +** +** This software is furnished under a license and may be used and copied +** only in accordance with the terms of such license. +** +** +** Description: +** +** +** +** +** +** +** +** DO NOT USE THIS FILE. THE DATA STRUCTURES AND CONSTANTS HERE ARE +** NOT YET IMPLEMENTED AND WILL CHANGE IN A FUTURE RELEASE. +** +** +** +** +** +** +** +** +** +** +*/ +#ifndef _CANEVT_H_ +#define _CANEVT_H_ + +#include + +#define CANEVT_NO_COMMAND 0 + + // Events +#define CANEVT_RECEIVE_MSG 1 +#define CANEVT_STATISTIC_STD 2 +#define CANEVT_STATISTIC_EXT 3 +#define CANEVT_CHIP_STATE 4 +#define CANEVT_CLOCK_OVERFLOW 5 +#define CANEVT_TRIGGER 6 +#define CANEVT_ERROR 7 +#define CANEVT_TIMER 8 +#define CANEVT_TRANSCEIVER 9 + + // Commands +#define CANEVT_TRANSMIT_MSG 10 +#define CANEVT_SET_TIMER 11 +#define CANEVT_RESET_CLOCK 12 +#define CANEVT_INIT_CHIP 13 +#define CANEVT_START_CHIP 14 +#define CANEVT_STOP_CHIP 15 +#define CANEVT_RESET_CHIP 16 +#define CANEVT_SET_ACCEPTANCE 17 +//#define CANEVT_SET_DRIVERMODE 18 +#define CANEVT_GET_STATISTIC 19 +#define CANEVT_GET_CHIP_STATE 20 +#define CANEVT_SET_OUTPUT_MODE 21 +#define CANEVT_FUNCTION 22 +#define CANEVT_GET_TRANSCEIVER 23 +#define CANEVT_GET_TRANSCEIVER_RESP 24 +#define CANEVT_SET_TRANSCEIVER 25 +// 26, 27, 28 reserved +#define CANEVT_INIT_HARDWARE 29 +#define CANEVT_EXIT_HARDWARE 30 +#define CANEVT_READ_CLOCK 31 + + +#define MAX_MSG_LEN 8 +#define EXT_MSG 0x80000000 // signs an extended identifier + +#define MSGFLAG_ERROR_FRAME 0x01 // Msg is a bus error +#define MSGFLAG_OVERRUN 0x02 // Msgs following this has been lost +#define MSGFLAG_NERR 0x04 // NERR active during this msg +#define MSGFLAG_WAKEUP 0x08 // Msg rcv'd in wakeup mode +#define MSGFLAG_REMOTE_FRAME 0x10 // Msg is a remote frame +#define MSGFLAG_RESERVED_1 0x20 // Reserved for future usage +#define MSGFLAG_TX 0x40 // TX acknowledge +#define MSGFLAG_TXRQ 0x80 // TX request + +typedef struct { + unsigned long id; + unsigned char flags; + unsigned char dlc; + unsigned char data[MAX_MSG_LEN]; +} CanEventMessage; + + +#define CHIPSTAT_BUSOFF 0x01 +#define CHIPSTAT_ERROR_PASSIVE 0x02 +#define CHIPSTAT_ERROR_WARNING 0x04 +#define CHIPSTAT_ERROR_ACTIVE 0x08 + +typedef struct { + unsigned char busStatus; + unsigned char txErrorCounter; + unsigned char rxErrorCounter; +} CanEventChipState; + +typedef struct { + unsigned long stdData; + unsigned long stdRemote; + unsigned long errFrame; + unsigned short busLoad; // 0.00-100.00% +} CanEventStatisticsStd; + +typedef struct { + unsigned long extData; + unsigned long extRemote; + unsigned long ovrFrame; +} CanEventStatisticsExt; + +typedef struct { + unsigned char code; // qqq +} CanEventErrorCode; + +//------------------------------------------------------------------------------ +// commands +//------------------------------------------------------------------------------ + +typedef struct { + unsigned long code; + unsigned long mask; +} CanEventAcceptanceFilter; + +typedef struct { + unsigned char mode; +} CanEventDriverMode; + +typedef struct { + unsigned long rate; +} CanEventSetTimer; + +typedef struct { + unsigned char level; +} CanEventSetDebugLevel; + +#define OUTPUT_MODE_SILENT 0 +#define OUTPUT_MODE_NORMAL 1 + +typedef struct { + unsigned char mode; +} CanEventSetOutputMode; + +typedef struct { + unsigned char code; +} CanEventFunction; + +// The following definitions are copied from lapcmds.h !! +#if 0 +#define TRANSCEIVER_EVENT_ERROR 1 +#define TRANSCEIVER_EVENT_CHANGED 2 + +// event +#define TRANSCEIVER_EVENT_NONE 0 +#define TRANSCEIVER_EVENT_NERR 1 +#define TRANSCEIVER_EVENT_REMOVED 2 +#define TRANSCEIVER_EVENT_DETECTED 3 + +// type +#define TRANSCEIVER_TYPE_NONE 0 +#define TRANSCEIVER_TYPE_251 1 +#define TRANSCEIVER_TYPE_252 2 +#define TRANSCEIVER_TYPE_DNOPTO 3 +#define TRANSCEIVER_TYPE_W210 4 +#define TRANSCEIVER_TYPE_SWC_PROTO 5 // Prototype. Driver may latch-up. +#define TRANSCEIVER_TYPE_SWC 6 + + +// lineMode +#define TRANSCEIVER_LINEMODE_NA 0 +#define TRANSCEIVER_LINEMODE_TWO_LINE 1 +#define TRANSCEIVER_LINEMODE_CAN_H 2 +#define TRANSCEIVER_LINEMODE_CAN_L 3 +#define TRANSCEIVER_LINEMODE_SWC_SLEEP 4 // SWC Sleep Mode. +#define TRANSCEIVER_LINEMODE_SWC_NORMAL 5 // SWC Normal Mode. +#define TRANSCEIVER_LINEMODE_SWC_FAST 6 // SWC High-Speed Mode. +#define TRANSCEIVER_LINEMODE_SWC_WAKEUP 7 // SWC Wakeup Mode. +#define TRANSCEIVER_LINEMODE_SLEEP 8 +#define TRANSCEIVER_LINEMODE_NORMAL 9 +#define TRANSCEIVER_LINEMODE_STDBY 10 // Standby for those who support it +#define TRANSCEIVER_LINEMODE_TT_CAN_H 11 // Truck & Trailer: operating mode single wire using CAN high +#define TRANSCEIVER_LINEMODE_TT_CAN_L 12 // Truck & Trailer: operating mode single wire using CAN low +#define TRANSCEIVER_LINEMODE_OEM1 13 // Reserved for OEM apps +#define TRANSCEIVER_LINEMODE_OEM2 14 // Reserved for OEM apps +#define TRANSCEIVER_LINEMODE_OEM3 15 // Reserved for OEM apps +#define TRANSCEIVER_LINEMODE_OEM4 16 // Reserved for OEM apps + + +// resNet +#define TRANSCEIVER_RESNET_NA 0 +#define TRANSCEIVER_RESNET_MASTER 1 +#define TRANSCEIVER_RESNET_MASTER_STBY 2 +#define TRANSCEIVER_RESNET_SLAVE 3 + +#endif + +typedef struct { + unsigned char event; // TRANSCEIVER_EVENT_xxx +} CanEventTransceiver; + +typedef struct { + unsigned char type; // TRANSCEIVER_TYPE_xxx + unsigned char lineMode; // TRANSCEIVER_LINEMODE_xxx + unsigned char resNet; // TRANSCEIVER_RESNET_xxx +} CanEventGetTransceiverResponse; + +typedef struct { + unsigned char type; // TRANSCEIVER_TYPE_xxx + unsigned char lineMode; // TRANSCEIVER_LINEMODE_xxx + unsigned char resNet; // TRANSCEIVER_RESNET_xxx +} CanEventSetTransceiver; + + +typedef union { + CanEventMessage canEventMessage; + CanEventChipState canEventChipState; + CanEventStatisticsStd canEventStatisticsStd; + CanEventStatisticsExt canEventStatisticsExt; + CanEventErrorCode canEventErrorCode; + CanEventAcceptanceFilter canEventAcceptanceFilter; + CanEventDriverMode canEventDriverMode; + CanEventSetTimer canEventSetTimer; + CanEventSetDebugLevel canEventSetDebugLevel; + CanEventSetOutputMode canEventSetOutputMode; + CanEventFunction canEventFunction; + CanEventTransceiver canEventTransceiver; + CanEventGetTransceiverResponse canEventGetTransceiverResponse; + CanEventSetTransceiver canEventSetTransceiver; +} CanEventUnion; + + +typedef struct { + unsigned char tag; + unsigned char chanIndex; + unsigned char _internal1; + unsigned char _internal2; + unsigned long timeStamp; + CanEventUnion x; +} CanEvent, *PCanEvent; + + +#include + +#endif + diff --git a/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canlib.h b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canlib.h new file mode 100644 index 00000000..329b8dcc --- /dev/null +++ b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canlib.h @@ -0,0 +1,5488 @@ +/** + * \section LICENSE + * Copyright 1994-2015 by KVASER AB, SWEDEN + * + * WWW: http://www.kvaser.com + * + * This software is furnished under a license and may be used and copied + * only in accordance with the terms of such license. + * + * \section DESCRIPTION + * + * Definitions for the CANLIB API. + * + * \file canlib.h + * \author Kvaser AB + * + * \note MATLAB users on Windows: if you define WIN32_LEAN_AND_MEAN before + * including this file, you will see a lot less warnings. + * + * \defgroup General General + * \defgroup CAN CAN + * \defgroup ObjectBuffers Object buffers + * \win_start + * \defgroup TimeDomainHandling Time Domain Handling + * \defgroup NamedParameterSettings Named Parameter Settings + * \defgroup tScript t-script + * \win_end + */ + +#ifndef _CANLIB_H_ +#define _CANLIB_H_ + +#include +# include +# include "predef.h" +# include "canevt.h" +# define CANLIB_DECLARE_ALL +#include "canstat.h" + +/** Handle to an opened circuit. */ +typedef int canHandle; + +# define canINVALID_HANDLE (-1) + +/** Handle to an opened circuit, created with \ref canOpenChannel(). */ +# define CanHandle int +/** Denotes an invalid circuit handle. */ + +/** Notify message sent to the application window */ +# define WM__CANLIB (WM_USER+16354) + +/** + * \name canOPEN_xxx + * \anchor canOPEN_xxx + * + * These defines are used in \ref canOpenChannel(). + * + * @{ + */ + + +/** + * Don't allow sharing of this circuit between applications. + * + * This define is used in \ref canOpenChannel() + */ +#define canOPEN_EXCLUSIVE 0x0008 + +/** + * This flag causes two things to happen: + * + * \li The call will fail if the specified circuit doesn't allow extended CAN + * (CAN 2.0B). + * + * \li If no frame-type flag is specified in a call to \ref canWrite, it is assumed + * that extended CAN should be used. + * + * This define is used in \ref canOpenChannel(). + */ +#define canOPEN_REQUIRE_EXTENDED 0x0010 + +/** + * Allow opening of virtual channels as well as physical channels. + * + * This define is used in \ref canOpenChannel(). + * + * \sa \ref page_user_guide_virtual_info + */ +# define canOPEN_ACCEPT_VIRTUAL 0x0020 + +/** + * Open the channel even if it is opened for exclusive + * access already. + * + * \warning Use this flag with caution. + * + * This define is used in \ref canOpenChannel(). + */ +# define canOPEN_OVERRIDE_EXCLUSIVE 0x0040 + +/** + * Fail the call if the channel cannot be opened with init access. + * + * Init access means that the thread that owns the handle can set bit rate and + * CAN driver mode. Init access is the default. At most one thread can have + * init access to any given channel. If you try to set the bit rate or CAN + * driver mode for a handle to which you don't have init access, the call will + * silently fail (i.e. \ref canOK is returned although the call had no effect), + * unless you enable "access error reporting" by calling \ref canIoCtl(). Access + * error reporting is by default off. + * + * This define is used in \ref canOpenChannel(). + * + * \sa \ref canOPEN_NO_INIT_ACCESS + */ +# define canOPEN_REQUIRE_INIT_ACCESS 0x0080 + +/** + * Don't open the handle with init access. + * + * This define is used in \ref canOpenChannel(). + * + * \sa \ref canOPEN_REQUIRE_INIT_ACCESS + */ +# define canOPEN_NO_INIT_ACCESS 0x0100 + +/** + * The channel will accept messages with DLC (Data Length Code) greater than + * 8. If this flag is not used, a message with DLC > 8 will always be + * reported or transmitted as a message with DLC = 8. If the + * \ref canOPEN_ACCEPT_LARGE_DLC flag is used, the message will be sent and/or + * received with the true DLC, which can be at most 15. + * + * \note The length of the message is always at most 8. + * + * This define is used in \ref canOpenChannel(). + */ +# define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8 + +/** + * The channel will use the CAN FD protocol, ISO compliant. This also means that messages with + * \ref canFDMSG_xxx flags can now be used. + * + * This define is used in \ref canOpenChannel(). + */ +# define canOPEN_CAN_FD 0x0400 + +/** + * The channel will use the CAN FD NON-ISO protocol. + * Use this if you want to configure the can controller to be able to communicate with + * a can controller designed prior to the release of the CAN FD ISO specification. + * + * Non ISO mode implies: + * \li The stuff bit counter will not be included in the frame format. + * \li Initial value for CRC17 and CRC21 will be zero. + * + * This also means that messages with \ref canFDMSG_xxx flags can now be used. + * + * This define is used in \ref canOpenChannel(). + */ +# define canOPEN_CAN_FD_NONISO 0x0800 +/** @} */ + +/** + * \ingroup CAN + * \name canFILTER_xxx + * \anchor canFILTER_xxx + * + * Flags for \ref canAccept(). + * + * @{ + */ +#define canFILTER_ACCEPT 1 +#define canFILTER_REJECT 2 +/** Sets the code for standard (11-bit) identifiers. */ +#define canFILTER_SET_CODE_STD 3 +/** Sets the mask for standard (11-bit) identifiers. */ +#define canFILTER_SET_MASK_STD 4 +/** Sets the code for extended (29-bit) identifiers. */ +#define canFILTER_SET_CODE_EXT 5 +/** Sets the mask for extended (29-bit) identifiers. */ +#define canFILTER_SET_MASK_EXT 6 + +#define canFILTER_NULL_MASK 0L +/** @} */ + + +/** + * \ingroup CAN + * \name canDRIVER_xxx + * \anchor canDRIVER_xxx + * + * CAN driver types - not all are supported on all cards. + * + * @{ + */ + +/** + * The "normal" driver type (push-pull). This is the default. + */ +#define canDRIVER_NORMAL 4 + +/** + * Sets the CAN controller in Silent Mode; that is, it doesn't send anything, + * not even ACK bits, on the bus. Reception works as usual. + * + * \note The values 2,3,5,6,7 are reserved values for compatibility reasons. + */ +#define canDRIVER_SILENT 1 + +/** + * Self-reception. Not implemented. + */ +#define canDRIVER_SELFRECEPTION 8 + +/** + * The driver is turned off. Not implemented in all types of hardware. + */ +#define canDRIVER_OFF 0 + +/** @} */ + + +/** + * \ingroup CAN + * \anchor BAUD_xxx + * \anchor canBITRATE_xxx + * \anchor canFD_BITRATE_xxx + * \name canBITRATE_xxx + * + * Common bus speeds. Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). + * The values are translated in canlib, \ref canTranslateBaud(). + * + * \note The \ref BAUD_xxx names are only retained for compability. + * + * \sa \ref page_user_guide_misc_bitrate + * + * @{ + */ + + +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 1 Mbit/s. */ +#define canBITRATE_1M (-1) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 500 kbit/s. */ +#define canBITRATE_500K (-2) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 250 kbit/s. */ +#define canBITRATE_250K (-3) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 125 kbit/s. */ +#define canBITRATE_125K (-4) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 100 kbit/s. */ +#define canBITRATE_100K (-5) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 62 kbit/s. */ +#define canBITRATE_62K (-6) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 50 kbit/s. */ +#define canBITRATE_50K (-7) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 83 kbit/s. */ +#define canBITRATE_83K (-8) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsC200(). Indicate a bitrate of 10 kbit/s. */ +#define canBITRATE_10K (-9) + +// CAN FD Bit Rates +/** Used in \ref canSetBusParams() and \ref canSetBusParamsFd() when using the + CAN FD protocol. Indicates a bitrate of 0.5 Mbit/s and sampling point at + 80%. */ +#define canFD_BITRATE_500K_80P (-1000) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsFd() when using the + CAN FD protocol. Indicates a bitrate of 1.0 Mbit/s and sampling point at + 80%. */ +#define canFD_BITRATE_1M_80P (-1001) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsFd() when using the + CAN FD protocol. Indicates a bitrate of 2.0 Mbit/s and sampling point at + 80%. */ +#define canFD_BITRATE_2M_80P (-1002) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsFd() when using the + CAN FD protocol. Indicates a bitrate of 4.0 Mbit/s and sampling point at + 80%. */ +#define canFD_BITRATE_4M_80P (-1003) +/** Used in \ref canSetBusParams() and \ref canSetBusParamsFd() when using the + CAN FD protocol. Indicates a bitrate of 8.0 Mbit/s and sampling point at + 60%. */ +#define canFD_BITRATE_8M_60P (-1004) + +/** The \ref BAUD_xxx names are deprecated, use \ref canBITRATE_1M instead. */ +#define BAUD_1M (-1) +/** The \ref BAUD_xxx names are deprecated, use \ref canBITRATE_500K instead. */ +#define BAUD_500K (-2) +/** The \ref BAUD_xxx names are deprecated, use \ref canBITRATE_250K instead. */ +#define BAUD_250K (-3) +/** The \ref BAUD_xxx names are deprecated, use \ref canBITRATE_125K instead. */ +#define BAUD_125K (-4) +/** The \ref BAUD_xxx names are deprecated, use \ref canBITRATE_100K instead. */ +#define BAUD_100K (-5) +/** The \ref BAUD_xxx names are deprecated, use \ref canBITRATE_62K instead. */ +#define BAUD_62K (-6) +/** The \ref BAUD_xxx names are deprecated, use \ref canBITRATE_50K instead. */ +#define BAUD_50K (-7) +/** The \ref BAUD_xxx names are deprecated, use \ref canBITRATE_83K instead. */ +#define BAUD_83K (-8) +/** @} */ + + +// +// Define CANLIBAPI unless it's done already. +// (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT +// and DLLEXPORT before including this file.) +// +#ifndef CANLIBAPI +# define CANLIBAPI __stdcall +# define DLLIMPORT __declspec(dllimport) +# define DLLEXPORT __declspec(dllexport) +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup General + * + * \source_cs static void canInitializeLibrary(void); + * + * \source_delphi procedure canInitializeLibrary; + * \source_end + * This function must be called before any other functions is used. It will + * initialize the driver. + * + * You may call \ref canInitializeLibrary() more than once. The actual + * initialization will take place only once. + * + * Any errors encountered during library initialization will be "silent" and an + * appropriate \ref canERR_xxx error code will be returned later on when + * \ref canOpenChannel() (or any other API call that requires initialization) is + * called. + * + * \sa \ref page_code_snippets_examples + * + */ +void CANLIBAPI canInitializeLibrary (void); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canClose(int handle); + * + * \source_delphi function canClose(handle: canHandle): canStatus; + * \source_end + * + * Closes the channel associated with the handle. If no other threads + * are using the CAN circuit, it is taken off bus. The handle can not be + * used for further references to the channel, so any variable containing + * it should be zeroed. + * + * \ref canClose() will almost always return \ref canOK; the specified handle is closed + * on an best-effort basis. + * + * \param[in] hnd An open handle to a CAN channel. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref canOpenChannel(), \ref canBusOn(), \ref canBusOff() + */ +canStatus CANLIBAPI canClose (const CanHandle hnd); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canBusOn(int handle); + * + * \source_delphi function canBusOn(handle: canHandle): canStatus; + * \source_end + * + * Takes the specified channel on-bus. + * + * If you are using multiple handles to the same physical channel, for example + * if you are writing a threaded application, you must call \ref canBusOn() once for + * each handle. The same applies to \ref canBusOff() - the physical channel will not + * go off bus until the last handle to the channel goes off bus. + * + * \param[in] hnd An open handle to a CAN channel. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref canBusOff(), \ref canResetBus() + * + */ +canStatus CANLIBAPI canBusOn (const CanHandle hnd); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canBusOff(int handle); + * + * \source_delphi function canBusOff(handle: canHandle): canStatus; + * \source_end + * + * Takes the specified channel off-bus. + * + * \param[in] hnd An open handle to a CAN channel. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref canBusOn(), \ref canResetBus() + * + */ +canStatus CANLIBAPI canBusOff (const CanHandle hnd); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canSetBusParams(int handle, int freq, int tseg1, int tseg2, int sjw, int noSamp, int syncmode); + * + * \source_delphi function canSetBusParams(handle: canHandle; freq: Longint; tseg1, tseg2, sjw, noSamp, syncmode: Cardinal): canStatus; + * \source_end + * + * This function sets the nominal bus timing parameters for the specified CAN + * controller. + * + * The library provides default values for \a tseg1, \a tseg2, \a sjw and \a + * noSamp when \a freq is specified to one of the pre-defined constants, + * \ref canBITRATE_xxx for classic CAN and \ref canFD_BITRATE_xxx for CAN FD. + * + * If \a freq is any other value, no default values are supplied by the + * library. + * + * If you are using multiple handles to the same physical channel, for example + * if you are writing a threaded application, you must call \ref canBusOff() once + * for each handle. The same applies to \ref canBusOn() - the physical channel will + * not go off bus until the last handle to the channel goes off bus. + * + * \note Use \ref canSetBusParamsC200() to set the bus timing parameters in the + * ubiquitous 82c200 bit-timing register format. + * + * \param[in] hnd An open handle to a CAN controller. + * \param[in] freq Bit rate (measured in bits per second); or one of the + * predefined constants (\ref canBITRATE_xxx for classic + * CAN and \ref canFD_BITRATE_xxx for CAN FD). + * \param[in] tseg1 Time segment 1, that is, the number of quanta from (but not + * including) the Sync Segment to the sampling point. + * \param[in] tseg2 Time segment 2, that is, the number of quanta from the sampling + * point to the end of the bit. + * \param[in] sjw The Synchronization Jump Width. + * \param[in] noSamp The number of sampling points; can be 1 or 3. + * \param[in] syncmode Unsupported and ignored. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_bit_rate, \ref page_user_guide_misc_bitrate, + * \ref page_user_guide_init_bit_rate, \ref page_code_snippets_examples + * \sa \ref canSetBusParamsC200(), \ref canGetBusParams() + * + */ +canStatus CANLIBAPI canSetBusParams (const CanHandle hnd, + long freq, + unsigned int tseg1, + unsigned int tseg2, + unsigned int sjw, + unsigned int noSamp, + unsigned int syncmode); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canSetBusParamsFd(int hnd, int freq_brs, int tseg1_brs, int tseg2_brs, int sjw_brs); + * + * \source_delphi function canSetBusParamsFd(hnd: canHandle; freq_brs: Longint; tseg1_brs, tseg2_brs, sjw_brs): canStatus; + * \source_end + * + * This function sets the data phase bus timing parameters for the specified + * CAN controller. + * + * The library provides default values for \a tseg1_brs, \a tseg2_brs and + * \a sjw_brs when \a freq_brs is specified to one of the pre-defined + * constants, \ref canFD_BITRATE_xxx. + * + * If \a freq_brs is any other value, no default values are supplied + * by the library. + * + * \param[in] hnd An open handle to a CAN controller. + * \param[in] freq_brs CAN FD data bit rate (measured in bits per second); or + * one of the predefined constants \ref + * canFD_BITRATE_xxx. + * \param[in] tseg1_brs Time segment 1, that is, the number of quanta from (but not + * including) the Sync Segment to the sampling point. + * \param[in] tseg2_brs Time segment 2, that is, the number of quanta from the sampling + * point to the end of the bit. + * \param[in] sjw_brs The Synchronization Jump Width. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ +canStatus CANLIBAPI canSetBusParamsFd(const CanHandle hnd, + long freq_brs, + unsigned int tseg1_brs, + unsigned int tseg2_brs, + unsigned int sjw_brs); + + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canGetBusParams(int handle, out long freq, out int tseg1, out int tseg2, out int sjw, out int noSamp, out int syncmode); + * + * \source_delphi function canGetBusParams(handle: canHandle; var freq: Longint; var tseg1, tseg2, sjw, noSamp, syncmode: Cardinal): canStatus; + * \source_end + * + * This function retrieves the current nominal bus parameters for the specified + * channel. + * + * The anatomy of a CAN bit is discussed in detail at Kvaser's + * web site at www.kvaser.com. + * + * \param[in] hnd An open handle to a CAN controller. + * \param[out] freq Bit rate (bits per second). + * \param[out] tseg1 Time segment 1, that is, the number of quanta from (but not + * including) the Sync Segment to the sampling point. + * \param[out] tseg2 Time segment 2, that is, the number of quanta from the sampling + * point to the end of the bit. + * \param[out] sjw The Synchronization Jump Width. + * \param[out] noSamp The number of sampling points; can be 1 or 3. + * \param[out] syncmode Unsupported, always read as one. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_bit_rate, \ref page_user_guide_init_bit_rate + * \sa \ref canSetBusParams(), \ref canSetBusParamsC200() + * + */ +canStatus CANLIBAPI canGetBusParams (const CanHandle hnd, + long *freq, + unsigned int *tseg1, + unsigned int *tseg2, + unsigned int *sjw, + unsigned int *noSamp, + unsigned int *syncmode); + + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canGetBusParamsFd(int hnd, out long freq_brs, out int tseg1_brs, out int tseg2_brs, out int sjw_brs); + * + * \source_delphi function canGetBusParamsFd(hnd: canHandle; var freq_brs: Longint; var tseg1_brs, tseg2_brs, sjw_brs): canStatus; + * \source_end + * + * This function retrieves the current data bus parameters for the specified + * CAN FD channel. + * + * \param[in] hnd An open handle to a CAN FD controller. + * \param[out] freq_brs Bit rate (bits per second). + * \param[out] tseg1_brs Time segment 1, that is, the number of quanta from (but not + * including) the Sync Segment to the sampling point. + * \param[out] tseg2_brs Time segment 2, that is, the number of quanta from the sampling + * point to the end of the bit. + * \param[out] sjw_brs The Synchronization Jump Width. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ +canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd, + long *freq_brs, + unsigned int *tseg1_brs, + unsigned int *tseg2_brs, + unsigned int *sjw_brs); +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canSetBusOutputControl(int handle, int drivertype); + * + * \source_delphi function canSetBusOutputControl(handle: canHandle; drivertype: Cardinal): canStatus; + * \source_end + * + * This function sets the driver type for a CAN controller. This corresponds + * loosely to the bus output control register in the CAN controller, hence the + * name of this function. CANLIB does not allow for direct manipulation of the + * bus output control register; instead, symbolic constants are used to select + * the desired driver type. + * + * \note Not all CAN driver types are supported on all cards. + * + * \param[in] hnd A handle to an open circuit. + * \param[in] drivertype Can driver type, \ref canDRIVER_xxx) + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canGetBusOutputControl() + */ +canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd, + const unsigned int drivertype); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canGetBusOutputControl(int handle, out int drivertype); + * + * \source_delphi function canGetBusOutputControl(handle: canHandle; var drivertype: Cardinal): canStatus; + * \source_end + * + * This function retrieves the current CAN controller driver type. + * This corresponds loosely to the bus output control register in the + * CAN controller, hence the name of this function. CANLIB does not + * allow for direct manipulation of the bus output control register; + * instead, symbolic constants are used to select the desired driver + * type. + * + * \note Don't confuse the CAN controller driver type with the bus driver + * type. The CAN controller is not connected directly to the CAN bus; + * instead, it is connected to a bus transceiver circuit which interfaces + * directly to the bus. The "CAN controller driver type" we are talking + * about here refers to the mode which the CAN controller uses to drive + * the bus transceiver circuit. + * + * \note Silent Mode is not supported by all CAN controllers. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[out] drivertype A pointer to an unsigned int which receives the + * current driver type. The driver type can be either + * \ref canDRIVER_NORMAL or \ref canDRIVER_SILENT. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canSetBusOutputControl() + */ +canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd, + unsigned int *drivertype); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canAccept(int handle, int envelope, int flag); + * + * \source_delphi function canAccept(handle: canHandle; envelope: Longint; flag: Cardinal): canStatus; + * \source_end + * + * This routine sets the message acceptance filters on a CAN channel. + * + * On some boards the acceptance filtering is done by the CAN hardware; on + * other boards (typically those with an embedded CPU,) the acceptance + * filtering is done by software. \ref canAccept() behaves in the same way for all + * boards, however. + * + * \win_start \ref canSetAcceptanceFilter() and \win_end \ref canAccept() both serve the same purpose but the + * former can set the code and mask in just one call. + * + * If you want to remove a filter, call \ref canAccept() with the mask set to 0. + * + * \note You can set the extended code and mask only on CAN boards that support + * extended identifiers. + * + * \note Not all CAN boards support different masks for standard and extended + * CAN identifiers. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] envelope The mask or code to set. + * \param[in] flag Any of \ref canFILTER_SET_CODE_STD, + * \ref canFILTER_SET_MASK_STD, + * \ref canFILTER_SET_CODE_EXT or + * \ref canFILTER_SET_MASK_EXT + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_filters, +\win_start + * \ref page_user_guide_misc_code_and_mask, +\win_end + * \ref page_code_snippets_examples + */ +canStatus CANLIBAPI canAccept (const CanHandle hnd, + const long envelope, + const unsigned int flag); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canReadStatus(int handle, out long flags); + * + * \source_delphi function canReadStatus(handle: canHandle; var flags: Longint): canStatus; + * \source_end + * + * Returns the status for the specified circuit. flags points to a longword + * which receives a combination of the \ref canSTAT_xxx flags. + * + * \note \ref canReadStatus() returns the latest known status of the specified + * circuit. If a status change happens precisely when \ref canReadStatus() is + * called, it may not be reflected in the returned result. + * + * \param[in] hnd A handle to an open circuit. + * \param[out] flags Pointer to a \c DWORD which receives the status flags; + * this is a combination of any of the \ref canSTAT_xxx. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +canStatus CANLIBAPI canReadStatus (const CanHandle hnd, + unsigned long *const flags); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canReadErrorCounters(int handle, out int txErr, out int rxErr, out int ovErr); + * + * \source_delphi function canReadErrorCounters(handle: canHandle; var txErr, rxErr, ovErr: Cardinal): canStatus; + * \source_end + * + * Reads the error counters of the CAN controller. + * + * \ref canReadErrorCounters() returns the latest known values of the error counters + * in the specified circuit. If the error counters change values precisely when + * \ref canReadErrorCounters() is called, it may not be reflected in the returned + * result. + * + * It is allowed to pass \c NULL as the value of the \a txErr, \a rxErr, and \a + * ovErr parameters. + * + * Use \ref canIoCtl() to clear the counters. + * + * \note Not all CAN controllers provide access to the error counters; + * in this case, an educated guess is returned. + * + * \param[in] hnd A handle to an open circuit. + * \param[out] txErr A pointer to a \c DWORD which receives the transmit error + * counter. + * \param[out] rxErr A pointer to a \c DWORD which receives the receive error + * counter. + * \param[out] ovErr A pointer to a \c DWORD which receives the number of + * overrun errors. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canIoCtl() + */ +canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd, + unsigned int *txErr, + unsigned int *rxErr, + unsigned int *ovErr); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canWrite(int handle, int id, byte[] msg, int dlc, int flag); + * + * \source_delphi function canWrite(handle: canHandle; id: Longint; msg: Pointer; dlc: Cardinal; flag: Cardinal): canStatus; + * \source_end + * + * This function sends a CAN message. The call returns immediately after queuing + * the message to the driver. + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * \note The message has been queued for transmission when this calls return. + * It has not necessarily been sent. + * + * \param[in] hnd A handle to an open CAN circuit. + * \param[in] id The identifier of the CAN message to send. + * \param[in] msg A pointer to the message data, or \c NULL. + * \param[in] dlc The length of the message in bytes.
+ For Classic CAN dlc can be at most 8, unless \ref canOPEN_ACCEPT_LARGE_DLC is used.
+ For CAN FD dlc can be one of the following 0-8, 12, 16, 20, 24, 32, 48, 64. + * \param[in] flag A combination of message flags, \ref canMSG_xxx + * (including \ref canFDMSG_xxx if the CAN FD protocol is + * enabled). + * Use this parameter to send extended (29-bit) frames + * and/or remote frames. Use \ref canMSG_EXT and/or + * \ref canMSG_RTR for this purpose. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_sending, \ref page_code_snippets_examples + * \sa \ref canWriteSync(), \ref canWriteWait() + * + */ +canStatus CANLIBAPI canWrite (const CanHandle hnd, + long id, + void *msg, + unsigned int dlc, + unsigned int flag); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canWriteSync(int handle, long timeout); + * + * \source_delphi function canWriteSync(handle: canHandle; timeout: Longint): canStatus; + * \source_end + * + * Waits until all CAN messages for the specified handle are sent, or the + * timeout period expires. + * + * \param[in] hnd A handle to an open CAN circuit. + * \param[in] timeout The timeout in milliseconds. 0xFFFFFFFF gives an + * infinite timeout. + * + * \return \ref canOK (zero) if the queue emptied before the timeout period came to + * its end. + * \return \ref canERR_TIMEOUT (negative) not all messages were transmitted when + * the timeout occurred. + * \return \ref canERR_PARAM (negative) This could be caused by an erroneous + * parameter, or if you have turned TXACKs off (by using \ref canIoCtl()) + * because if you do you can't use this call. The driver simply doesn't + * know when all the messages are sent! + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canWrite(), \ref canWriteWait() + */ +canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canRead(int handle, out int id, byte[] msg, out int dlc, out int flag, out long time); + * + * \source_delphi function canRead(handle: canHandle; var id: Longint; msg: Pointer; var dlc: Cardinal; var flag: Cardinal; var time: Longint): canStatus; + * \source_end + * + * Reads a message from the receive buffer. If no message is available, the + * function returns immediately with return code \ref canERR_NOMSG. + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * It is allowed to pass \c NULL as the value of \a id, \a msg, \a dlc, \a + * flag, and \a time. + * + * \param[in] hnd A handle to an open circuit. + * \param[out] id Pointer to a buffer which receives the CAN identifier. + * This buffer will only get the identifier. To determine + * whether this identifier was standard (11-bit) or extended + * (29-bit), and/or whether it was remote or not, or if it + * was an error frame, examine the contents of the flag + * argument. + * \param[out] msg Pointer to the buffer which receives the message data. + * This buffer must be large enough (i.e. 8 bytes.) Only the + * message data is copied; the rest of the buffer is left + * as-is. + * \param[out] dlc Pointer to a buffer which receives the message length. + * \param[out] flag Pointer to a buffer which receives the message flags, + * which is a combination of the \ref canMSG_xxx and + * \ref canMSGERR_xxx values. + * \param[out] time Pointer to a buffer which receives the message time stamp. + * + * \return \ref canOK (zero) if a message was read. + * \return \ref canERR_NOMSG (negative) if there was no message available. + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_reading, +\win_start + * \ref page_user_guide_send_recv_mailboxes, +\win_end + * \ref page_code_snippets_examples, + * \ref page_user_guide_time_accuracy_and_resolution + * \sa \ref canReadSpecific(), \ref canReadSpecificSkip(), \ref canReadSync(), + * \ref canReadSyncSpecific(), \ref canReadWait() + * + */ +canStatus CANLIBAPI canRead (const CanHandle hnd, + long *id, + void *msg, + unsigned int *dlc, + unsigned int *flag, + unsigned long *time); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canReadWait(int handle, out int id, byte[] msg, out int dlc, out int flag, out long time, long timeout); + * + * \source_delphi function canReadWait(handle: canHandle; var id: Longint; msg: Pointer; var dlc: Cardinal; var flag: Cardinal; var time: Longint; timeout: Longint): canStatus; + * \source_end + * + * Reads a message from the receive buffer. If no message is available, the + * function waits until a message arrives or a timeout occurs. + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * It is allowed to pass \c NULL as the value of \a id, \a msg, \a dlc, \a + * flag, and \a time. + * + * \param[in] hnd A handle to an open circuit. + * \param[out] id Pointer to a buffer which receives the CAN identifier. + * This buffer will only get the identifier. To determine + * whether this identifier was standard (11-bit) or extended + * (29-bit), and/or whether it was remote or not, or if it + * was an error frame, examine the contents of the flag + * argument. + * \param[out] msg Pointer to the buffer which receives the message data. + * This buffer must be large enough (i.e. 8 bytes.). + * \param[out] dlc Pointer to a buffer which receives the message length. + * \param[out] flag Pointer to a buffer which receives the message flags, + * which is a combination of the \ref canMSG_xxx and + * \ref canMSGERR_xxx values. + * \param[out] time Pointer to a buffer which receives the message time stamp. + * \param[in] timeout If no message is immediately available, this parameter + * gives the number of milliseconds to wait for a message + * before returning. 0xFFFFFFFF gives an infinite timeout. + * + * \return \ref canOK (zero) if a message was read. + * \return \ref canERR_NOMSG (negative) if there was no message available. + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canRead(), \ref canReadSpecific(), \ref canReadSpecificSkip(), + * \ref canReadSyncSpecific(), \ref canReadSync() + * + * \sa \ref page_user_guide_time_accuracy_and_resolution + */ +canStatus CANLIBAPI canReadWait (const CanHandle hnd, + long *id, + void *msg, + unsigned int *dlc, + unsigned int *flag, + unsigned long *time, + unsigned long timeout); + +#if defined(CANLIB_DECLARE_ALL) +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canReadSpecific(int handle, int id, byte[] msg, out int dlc, out int flag, out long time); + * + * \source_delphi function canReadSpecific(handle: canHandle; id: Longint; msg: Pointer; var dlc: Cardinal; var flag: Cardinal; var time: Longint): canStatus; + * \source_end + * + * Reads a message with a specified identifier from the receive buffer. Any + * preceding message not matching the specified identifier will be kept + * in the receive buffer. If no message with the specified identifier is + * available, the function returns immediately with an error code. + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * It is allowed to pass \c NULL as the value of \a msg, \a dlc, \a + * flag, and \a time. + * + * \note Use \ref canReadSpecific only if you for some reason must keep the unread + * messages in the queue. If this is not the case, consider using + * \ref canReadSpecificSkip() or \ref canRead() for better performance. + * + * \param[in] hnd A handle to an open circuit. + * \param[in] id The desired CAN identifier. + * \param[out] msg Pointer to the buffer which receives the message data. + * This buffer must be large enough (i.e. 8 bytes.). + * \param[out] dlc Pointer to a buffer which receives the message length. + * \param[out] flag Pointer to a buffer which receives the message flags, + * which is a combination of the \ref canMSG_xxx and + * \ref canMSGERR_xxx values. + * \param[out] time Pointer to a buffer which receives the message time stamp. + * + * \return \ref canOK (zero) if a message was read. + * \return \ref canERR_NOMSG (negative) if a matching message was not found. + * There might be other messages in the queue, though. + * \return \ref canERR_xxx (negative) if failure + * +\win_start * \sa \ref page_user_guide_send_recv_mailboxes \ref \win_end + * page_user_guide_send_recv_reading \ref + * page_user_guide_time_accuracy_and_resolution + * \sa \ref canRead(), \ref canReadSpecificSkip(), \ref canReadSync(), \ref canReadSyncSpecific(), + * \ref canReadWait() + * + */ +canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg, + unsigned int * dlc, unsigned int * flag, + unsigned long * time); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canReadSync(int handle, long timeout); + * + * \source_delphi function canReadSync(handle: canHandle; timeout: Longint): canStatus; + * \source_end + * + * Waits until the receive buffer contains at least one message or a timeout + * occurs. + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * \param[in] hnd A handle to an open circuit. + * \param[in] timeout The timeout in milliseconds. 0xFFFFFFFF gives an + * infinite timeout. + * + * \return \ref canOK (zero) if the queue contains the desired message. + * \return \ref canERR_TIMEOUT (negative) if a timeout occurs before a message + * arrived. + * \return \ref canERR_xxx (negative) if the call fails. + * + * \sa \ref canRead(), \ref canReadSpecific(), \ref canReadSpecificSkip(), + * \ref canReadSyncSpecific(), \ref canReadWait() + */ +canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canReadSyncSpecific(int handle, int id, long timeout); + * + * \source_delphi function canReadSyncSpecific(handle: canHandle; id, timeout: Longint): canStatus; + * \source_end + * + * Waits until the receive queue contains a message with the specified id, or a + * timeout occurs.. + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * \param[in] hnd A handle to an open circuit. + * \param[in] id The desired message identifier. + * \param[in] timeout The timeout in milliseconds. 0xFFFFFFFF gives an + * infinite timeout. + * + * \return \ref canOK (zero) if the queue contains the desired message. + * \return \ref canERR_TIMEOUT (negative) if a timeout occurs before the specified + * message arrived. + * \return \ref canERR_xxx (negative) if the call fails. + * + * \sa \ref canRead(), \ref canReadSpecific(), \ref canReadSpecificSkip(), + * \ref canReadSync(), \ref canReadWait() + */ +canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd, + long id, + unsigned long timeout); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canReadSpecificSkip(int hnd, int id, byte[] msg, out int dlc, out int flag, out long time); + * + * \source_delphi function canReadSpecificSkip(handle: canHandle; id: Longint; msg: Pointer; var dlc: Cardinal; var flag: Cardinal; var time: Longint): canStatus; + * \source_end + * + * Reads a message with a specified identifier from the receive buffer. Any + * preceding message not matching the specified identifier will be removed + * in the receive buffer. If no message with the specified identifier is + * available, the function returns immediately with an error code. + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * It is allowed to pass \c NULL as the value of \a msg, \a dlc, \a + * flag, and \a time. + * + * \param[in] hnd A handle to an open circuit. + * \param[in] id The desired CAN identifier. + * \param[out] msg Pointer to the buffer which receives the message data. + * This buffer must be large enough (i.e. 8 bytes.). + * \param[out] dlc Pointer to a buffer which receives the message length. + * \param[out] flag Pointer to a buffer which receives the message flags, + * which is a combination of the \ref canMSG_xxx and + * \ref canMSGERR_xxx values. + * \param[out] time Pointer to a buffer which receives the message time stamp. + * + * \return \ref canOK (zero) if a matching message was found. + * \return \ref canERR_NOMSG if there was no matching message available. All other + messages (if any!) were discarded. + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_reading, \ref + * page_user_guide_time_accuracy_and_resolution + * \sa \ref canRead(), \ref canReadSpecific(), \ref canReadSync(), + * \ref canReadSyncSpecific(), \ref canReadWait() + */ +canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd, + long id, + void * msg, + unsigned int * dlc, + unsigned int * flag, + unsigned long * time); +#endif + + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canSetNotify(int handle, IntPtr win_handle, int aNotifyFlags); + * + * \source_delphi function canSetNotify(handle: canHandle; aHWnd: HWND; aNotifyFlags: Cardinal): canStatus; + * \source_end + * + * This function associates a window handle with the CAN circuit. A + * \c WM__CANLIB message is sent to that window when certain events + * (specified by the \ref canNOTIFY_xxx flags) occur. + * + * When an event take place, a \c WM__CANLIB message will be sent to the window + * whose handle is aHWnd. This \c WM__CANLIB message will have: + * + * \li \c WPARAM handle to the circuit where the event occurred + * \li \c HIWORD(LPARAM) 0 + * \li \c LOWORD(LPARAM) \ref canEVENT_xxx + * + * In the routine that handles \c WM__CANLIB, you can call the CANLIB API + * functions (for example, \ref canRead()) using the handle found in \c wParam. + * + * \param[in] hnd A handle to an open CAN circuit. + * \param[in] aHWnd Handle of the window which will receive the + * notification messages. + * \param[in] aNotifyFlags The events specified with \ref canNOTIFY_xxx, for + * which callback should be called. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \n In the routine that handles \c WM__CANLIB, you must call \ref canRead() repeatedly + * until it returns \ref canERR_NOMSG, regardless of the \c LPARAM value. This will + * flush the driver's internal event queues. If you fail to do this, no more + * events will be reported. + * + * \sa \ref page_code_snippets_examples + */ +canStatus CANLIBAPI canSetNotify (const CanHandle hnd, + HWND aHWnd, + unsigned int aNotifyFlags); + + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canTranslateBaud(ref int freq, out int tseg1, out int tseg2, out int sjw, out int nosamp, out int syncMode); + * + * \source_delphi function canTranslateBaud(var freq: longint; var tseg1, tseg2, sjw, noSamp, syncMode: Cardinal): canStatus; + * \source_end + * + * This function translates the \ref canBITRATE_xxx constants to their corresponding + * bus parameter values. At return, this \a freq contains the actual bit rate + * (in bits per second). \a TSeg1 is the number of quanta (less one) in a bit + * before the sampling point. \a TSeg2 is the number of quanta after the + * sampling point. + * + * \param[in,out] freq A pointer to a \c DWORD which contains the \ref canBITRATE_xxx + * constant to translate. The bitrate constant value is + * overwritten with the frequency value. + * \param[out] tseg1 A pointer to a buffer which receives the Time segment 1, + * that is, the number of quanta from (but not including) + * the Sync Segment to the sampling point. + * \param[out] tseg2 A pointer to a buffer which receives the Time segment 2, + * that is, the number of quanta from the sampling point to + * the end of the bit. + * \param[out] sjw A pointer to a buffer which receives the Synchronization + * Jump Width. + * \param[out] nosamp A pointer to a buffer which receives the number of + * sampling points. + * \param[out] syncMode Unsupported, always read as zero. May be set to NULL. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canSetBusParams() + */ +canStatus CANLIBAPI canTranslateBaud (long *const freq, + unsigned int *const tseg1, + unsigned int *const tseg2, + unsigned int *const sjw, + unsigned int *const nosamp, + unsigned int *const syncMode); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus canGetErrorText(Canlib.canStatus err, out string buf_str); + * + * \source_delphi function canGetErrorText(err: canStatus; buf: PChar; bufsiz: Cardinal): canStatus; + * \source_end + * + * This function translates an error code (\ref canERR_xxx) + * to a human-readable, English text. + * + * \param[in] err The error code. + * \param[out] buf The buffer which is to receive the text, which is a + * zero-terminated string (provided the buffer is large enough.) + * \param[in] bufsiz The length of the input buffer. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * + */ +canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz); + +/** + * \ingroup General + * + * \source_cs static short canGetVersion(); + * + * \source_delphi function canGetVersion: Word; + * \source_end + * + * \win_start + * This API call returns the version of the CANLIB API DLL (canlib32.dll). The + * most significant byte is the major version number and the least significant + * byte is the minor version number. + * + * The actual version of the different driver files can be obtained by studying + * the version resources in each of the files. + * + * \note The version number of the canlib32.dll file is not related to the + * product version of CANLIB you are using. CANLIB consists of several + * driver and DLL files. To obtain the product version, use + * \ref canGetVersionEx(). + * + * \return version number of canlib32.dll + * + * \sa \ref page_user_guide_build_driver_version + * \sa \ref canGetVersionEx(), \ref canProbeVersion() + * + * \win_end + * + * \linux_start + * This API call returns the version of the CANLIB API library (libcanlib.so.x.y). The + * most significant byte is the major version number and the least significant + * byte is the minor version number. + * + * \return version number of libcanlib.so.x.y + * + * \linux_end + * + * + */ +unsigned short CANLIBAPI canGetVersion (void); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus canIoCtl(int handle, int func, int val);
+ static Canlib.canStatus canIoCtl(int handle, int func, out int val);
+ static Canlib.canStatus canIoCtl(int handle, int func, out string str_buf);
+ static Canlib.canStatus canIoCtl(int handle, int func, ref object obj_buf);
+ * + * \source_delphi function canIoCtl(handle: canHandle; func: Cardinal; buf: Pointer; buflen: Cardinal): canStatus; + * \source_end + * + * This API call performs several different functions; these are described + * below. The functions are handle-specific unless otherwise noted; this means + * that they affect only the handle you pass to \ref canIoCtl(), whereas other open + * handles will remain unaffected. The contents of \a buf after the call is + * dependent on the function code you specified. + * + * \param[in] hnd A handle to an open circuit. + * \param[in] func A \ref canIOCTL_xxx function code + * \param[in,out] buf Pointer to a buffer containing function-dependent data; + or a \c NULL pointer for certain function codes. The + buffer can be used for both input and output + depending on the function code. See \ref canIOCTL_xxx. + * \param[in] buflen The length of the buffer. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +canStatus CANLIBAPI canIoCtl (const CanHandle hnd, + unsigned int func, + void *buf, + unsigned int buflen); + +/* Note the difference from the windows version */ + +/** + * \ingroup CAN + * + * \source_cs static long canReadTimer(int hnd); + * + * \source_delphi function canReadTimer(handle: canHandle): longint; + * \source_end + * + * Reads the current time from the clock used to timestamp the + * messages for the indicated circuit. + * + * This API may return \ref canERR_INVHANDLE and/or \ref canERR_NOTINITIALIZED! + * This happens if \a hnd is invalid, or if the library was not initialized. + * + * \note \ref kvReadTimer() should be used instead since it separates the returned + * time from the error code. + * + * \note The clock used to timestamp the messages may not be available for + * direct reading on all platforms. In such cases, the PC's clock is used + * to return an approximation of the current time. Note that clock drift might + * occur in this case. + * + * \param[in] hnd A handle to an open circuit. + * + * \return The current time, with the prevailing time resolution (milliseconds + * by default). + * + * \sa \ref page_user_guide_time_accuracy_and_resolution + * \win_start + * \sa \ref kvReadTimer() + * \win_end + */ +unsigned long CANLIBAPI canReadTimer (const CanHandle hnd); + +/** + * \ingroup CAN + * + * \source_cs static int canOpenChannel(int channel, int flags); + * + * \source_delphi function canOpenChannel(channel: Integer; flags: Integer): canHandle; + * \source_end + * + * Opens a CAN channel (circuit) and returns a handle which is used + * in subsequent calls to CANLIB. + * + * + * Channel numbering is dependent on the installed hardware. The first channel + * always has number 0. + * + * For example, + * + * \li If you have a single LAPcan, the channels are numbered 0 and 1. + * + * \li If you have a USBcan Professional, the channels are numbered 0-1 + * according to the labels on the cables. + * + * \li The virtual channels come after all physical channels. + * + * If you are using multiple threads, note that the returned handle is usable + * only in the context of the thread that created it. That is, you must call + * \ref canOpenChannel() in each of the threads in your application that uses the + * CAN bus. You can open the same channel from multiple threads, but you must + * call \ref canOpenChannel() once per thread. + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * \note The handle returned may be zero which is perfectly valid. + * + * \param[in] channel The number of the channel. Channel numbering is hardware + * dependent. + * \param[in] flags A combination of \ref canOPEN_xxx flags + * + * \return Returns a handle to the opened circuit, or \ref canERR_xxx + * (negative) if the call failed. + * + * \sa \ref page_code_snippets_examples, \ref page_user_guide_virtual_info + * \sa \ref canGetNumberOfChannels(), \ref canGetChannelData(), \ref canIoCtl() + * + */ +CanHandle CANLIBAPI canOpenChannel (int channel, int flags); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus canGetNumberOfChannels(out int channelCount); + * + * \source_delphi function canGetNumberOfChannels(var channelCount: Integer): canStatus; + * \source_end + * + * This function returns the number of available CAN channels in the + * computer. The virtual channels are included in this number. + * + * \param[out] channelCount A pointer to a \c DWORD which will receive the current + * number of channels. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples, \ref page_user_guide_virtual_info + * \sa \ref canGetChannelData() + */ +canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount); + + +/** + * \name kvREMOTE_TYPExxx + * \anchor kvREMOTE_TYPExxx + * + * Remote type, returned when using \ref canCHANNELDATA_REMOTE_TYPE + * @{ + */ +#define kvREMOTE_TYPE_NOT_REMOTE 0 ///< +#define kvREMOTE_TYPE_WLAN 1 ///< +#define kvREMOTE_TYPE_LAN 2 ///< +/** @} */ + +/** + * \name kvLOGGER_TYPE_xxx + * \anchor kvLOGGER_TYPE_xxx + * + * Logger type, returned when using \ref canCHANNELDATA_LOGGER_TYPE + * @{ + */ +#define kvLOGGER_TYPE_NOT_A_LOGGER 0 ///< +#define kvLOGGER_TYPE_V1 1 ///< +#define kvLOGGER_TYPE_V2 2 ///< +/** @} */ + + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus canGetChannelData(int channel, int item, out object buffer); + * + * \source_delphi function canGetChannelData(channel, item: Integer; var buffer; bufsize: Cardinal): canStatus; + * \source_end + * + * This function can be used to retrieve certain pieces of information about a channel. + * + * \note You must pass a channel number and not a channel handle. + * + * \param[in] channel The number of the channel you are interested in. Channel + * numbers are integers in the interval beginning at 0 + * (zero) and ending at the value returned by + * \ref canGetNumberOfChannels() minus 1. + * \param[in] item This parameter specifies what data to obtain for the + * specified channel. The value is one of the constants + * \ref canCHANNELDATA_xxx. + * \param[out] buffer The address of a buffer which is to receive the data. + * \param[in] bufsize The size of the buffer to which the buffer parameter + * points. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref canGetNumberOfChannels() + */ +canStatus CANLIBAPI canGetChannelData (int channel, + int item, + void *buffer, + size_t bufsize); + +/** + * \ingroup General + * \anchor canCHANNELDATA_xxx + * \name canCHANNELDATA_xxx + * + * These defines are used in \ref canGetChannelData(). + * + * @{ + */ + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that receives the + * capabilities of the CAN controller; this is a combination of the \ref + * canCHANNEL_CAP_xxx flags. + */ +#define canCHANNELDATA_CHANNEL_CAP 1 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that receives the + * capabilities of the CAN transceiver; this is a combination of the + * \ref canDRIVER_CAP_xxx flags. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +#define canCHANNELDATA_TRANS_CAP 2 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \note Currently not implemented + */ +#define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that receives the hardware + * type of the card. This value is any one of the \ref canHWTYPE_xxx + * constants. + */ +#define canCHANNELDATA_CARD_TYPE 4 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that receives the card's + * number in the computer. Each card type is numbered separately. For + * example, the first LAPcan card in a machine will have number 0, the second + * LAPcan number 1, etc. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +#define canCHANNELDATA_CARD_NUMBER 5 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer which receives the channel + * number on the card. + */ +#define canCHANNELDATA_CHAN_NO_ON_CARD 6 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 64-bit (8 bytes) area which receives the serial + * number of the card. If the card doesn't have a serial number, 0 is + * returned. The serial number is an 8-byte unsigned integer. Currently, no + * products are using all 8 bytes; at most 4 bytes are used. + */ +#define canCHANNELDATA_CARD_SERIAL_NO 7 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 64-bit (8 bytes) area which receives the serial + * number of the transceiver. The serial number is an 8-byte unsigned + * integer. If the transceiver doesn't have a serial number, 0 is returned. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +#define canCHANNELDATA_TRANS_SERIAL_NO 8 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 64-bit (8 bytes) area which receives the firmware + * revision number on the card. This number consists of four 16-bit words: + * the major revision, the minor revision, the release number and the build + * number, listed in order from the most significant to the least + * significant. + */ +#define canCHANNELDATA_CARD_FIRMWARE_REV 9 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 64-bit (8 bytes) area which receives the hardware + * revision number on the card. This number consists of four 16-bit words; + * the two most significant are always 0, and the two least significant are + * the major revision and the minor revision, listed in order from the most + * significant to the least significant. + */ +#define canCHANNELDATA_CARD_HARDWARE_REV 10 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 8-byte area which receives the UPC (EAN) number for + * the card. If there is no UPC number, the buffer is filled with zeros. The + * UPC (EAN) number is coded as a BCD string with the LSB first, so + * e.g. 733-0130-00122-0 is coded as 0x30001220 0x00073301. + */ +#define canCHANNELDATA_CARD_UPC_NO 11 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 8-byte area which receives the UPC (EAN) number for + * the transceiver. If there is no UPC number, the buffer is filled with + * zeros. The UPC (EAN) number is coded as a BCD string with the LSB first, + * so e.g. 733-0130-00122-0 is coded as 0x30001220 0x00073301. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +#define canCHANNELDATA_TRANS_UPC_NO 12 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to an area which receives a zero-terminated string with a + * clear-text name of the channel. + * + * \note Use of this item code is no longer recommended. The returned + * channel name doesn't contain the exact hardware type (it just contains + * the device family) and uses zero-based channel numbering, which is not + * user friendly. Instead, use e.g. \ref canCHANNELDATA_DEVDESCR_ASCII and + * \ref canCHANNELDATA_CHAN_NO_ON_CARD to build your own channel name. + * + *\win_start + * \sa \ref canCHANNELDATA_DEVNAME_ASCII + *\win_end + */ +#define canCHANNELDATA_CHANNEL_NAME 13 +#if defined(CANLIB_DECLARE_ALL) + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to an array of 4 16-bit unsigned integers which receives + * the file version number of the second-level DLL driver file, i.e. the DLL + * that interfaces between CANLIB32.DLL and the driver proper. + * + * Contents depening on index: + * + * \li 0: 0 + * \li 1: The build number + * \li 2: The minor revision number + * \li 3: The major revision number + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DLL_FILE_VERSION 14 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to an array of 4 16-bit unsigned integers which receives + * the product version number of the second-level DLL driver file, i.e. the + * DLL that interfaces between CANLIB32.DLL and the driver proper. + * + * Contents depening on index: + * + * \li 0: 0 + * \li 1: 1 + * \li 2: The minor revision number + * \li 3: The major revision number + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DLL_PRODUCT_VERSION 15 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer which receives a number that + * identifies the second-level DLL driver file, i.e. the DLL that interfaces + * between CANLIB32.DLL and the driver proper. + * + * Values: + * + * \li 1: kvalapw.dll - used with CANLIB up to 2.29. + * + * \li 2: kvalapw2.dll - used with CANLIB from 3.0 and on. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DLL_FILETYPE 16 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer which receives the CAN + * transceiver type of the specified channel. This value is one of the + * \ref canTRANSCEIVER_TYPE_xxx + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_TRANS_TYPE 17 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer which receives an address + * indicating where the device is located on its underlying bus. The + * interpretation of this number is bus-specific. If the address is unknown + * or the bus driver does not support an address, the bus driver leaves this + * member at its default value of 0xFFFFFFFF. + * + * The following list describes the information certain bus drivers store in + * the Address field for their child devices: + * + * \li ISA: Does not supply an address. Defaults to 0xFFFFFFFF. + * + * \li PC Card (PCMCIA): The socket number (typically 0x00 or 0x40) + * + * \li PCI: The device number in the high word and the function number in the + * low word. + * + * \li USB: The port number. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer which receives a number + * associated with the device that can be displayed in the user + * interface. This number is typically a user-perceived slot number, such as + * a number printed next to the slot on the board, or some other number that + * makes locating the physical device easier for the user. For buses with no + * such convention, or when the UI number is unknown, 0xFFFFFFFF is returned. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_UI_NUMBER 19 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer which is set to 0, if the + * legacy time synchronization is not currently enabled for the specified + * channel, and 1, if the legacy time synchronization is currently enabled + * for the specified channel. + * + * Legacy time synchronization is a mechanism that will keep the PC and CAN + * channel clocks in sync. The synchronization is done in the driver, which + * periodically calculates the difference between the PC clock and the CAN + * device clock and compensates for the clock drift by recalculating the CAN + * message time stamps. You need to enable clock synchronization in the + * Control Panel using the Kvaser Hardware applet. + * + * \note Legacy time synchronization is implemented only on LAPcan and LAPcan + * II. It is not related to Kvaser MagiSync&tm; which is implemented in the + * high-end members of the Kvaser Leaf family. Kvaser MagiSync&tm; is always + * enabled and allows for much more accurate time synchronization. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + * + */ +# define canCHANNELDATA_TIMESYNC_ENABLED 20 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to an array of four 16-bit unsigned integers which + * receives the file version number of the kernel-mode driver. + * + * Contents depening on index: + * + * \li 0: The build number + * \li 1: 0 + * \li 2: The minor revision number + * \li 3: The major revision number + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DRIVER_FILE_VERSION 21 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to an array of four 16-bit unsigned integers which + * receives the product version number of the kernel-mode driver. + * + * Contents depening on index: + * + * \li 0: 0 + * \li 1: 0 + * \li 2: The minor revision number + * \li 3: The major revision number + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a buffer which receives the device manufacturer's name + * as a zero-terminated Unicode string. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_MFGNAME_UNICODE 23 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a buffer which receives the device manufacturer's name + * as a zero-terminated ASCII string. + */ +# define canCHANNELDATA_MFGNAME_ASCII 24 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a buffer which receives the product name of the device + * as a zero-terminated Unicode string. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DEVDESCR_UNICODE 25 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a buffer which receives the product name of the device + * as a zero-terminated ASCII string. + */ +# define canCHANNELDATA_DEVDESCR_ASCII 26 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a buffer which receives the name of the device + * driver (e.g. "kcans") as a zero-terminated ASCII string. + * + * \note The device driver names have no special meanings and may change + * from a release to another. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DRIVER_NAME 27 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that receives the quality of + * the channel, where the quality is measured in percent of optimal quality. + * + * For WLAN, -90 dBm and -35 dBm are considered 0% and 100%, respectively. + * + * The quality is 100% for any directly connected channel (USB, PCI etc.). + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_CHANNEL_QUALITY 28 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer point to a 32-bit unsigned integer that receives the roundtrip + * time which is measured in milliseconds. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_ROUNDTRIP_TIME 29 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that receives the + * \ref kvBUSTYPE_GROUP_xxx bus type. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_BUS_TYPE 30 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a CHAR array of at least 32 characters which receives + * the current device name as a \c NULL terminated ASCII string. + * + * If device name is not set or the device does not support this + * functionality, an error will be returned. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_DEVNAME_ASCII 31 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that contains the time in + * milliseconds since the last communication occured. + * + * For WLAN devices, this is the time since the last keep-alive message. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that receives the + * current WLAN operational mode of the remote capable device; + * \ref canCHANNEL_OPMODE_xxx. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a buffer which receives the remote profile name + * of the device as a zero-terminated ASCII string. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_REMOTE_PROFILE_NAME 34 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a buffer which receives the remote host name + * of the device as a zero-terminated ASCII string. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_REMOTE_HOST_NAME 35 + + /** + * \win_start + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a buffer which receives the mac address + * of the device as a zero-terminated ASCII string. + * \win_end + * \linux_start + * Not implemented. + * \linux_end + */ +# define canCHANNELDATA_REMOTE_MAC 36 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer which receives + * maximum bitrate of the device. Zero value means no limit on + * bitrate. + */ +# define canCHANNELDATA_MAX_BITRATE 37 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that receives the + * capabilities mask of the CAN channel. This mask specifies + * which capabilities corresponding device is guaranteed + * to support/not support at the moment, see \ref canCHANNEL_CAP_xxx + * for info about flags. + */ +# define canCHANNELDATA_CHANNEL_CAP_MASK 38 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that is 1 if + * the channel(device) is currently connected as a remote device. 0 if it is not + * currenty a remote device. */ +# define canCHANNELDATA_IS_REMOTE 40 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that returns the type of remote connection. + * in mHz. See \ref kvREMOTE_TYPExxx for returned values. + */ +# define canCHANNELDATA_REMOTE_TYPE 41 + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer points to a 32-bit unsigned integer that returns the logger type of the device. + * See \ref kvLOGGER_TYPE_xxx for returned values. + */ +# define canCHANNELDATA_LOGGER_TYPE 42 + + + + +#endif + + /** + * This define is used in \ref canGetChannelData(), \a buffer + * mentioned below refers to this functions argument. + * + * \a buffer is a user supplied byte array of length 'bufsize' (at + * least one byte long) to which the null terminated UTF-8 coded + * channel name will be placed. + */ +#define canCHANNELDATA_CUST_CHANNEL_NAME 39 + + /** @} */ + + +/** + * \name canCHANNEL_IS_xxx + * \anchor canCHANNEL_IS_xxx + * + * These channelFlags are used in \ref canGetChannelData() and in conjunction with \ref + * canCHANNELDATA_CHANNEL_FLAGS. + * @{ + */ +/** Used with \ref canCHANNELDATA_CHANNEL_FLAGS, indicates that the channel is + opened exclusively. */ +#define canCHANNEL_IS_EXCLUSIVE 0x0001 +/** Used with \ref canCHANNELDATA_CHANNEL_FLAGS, indicates that the channel is + opened. */ +#define canCHANNEL_IS_OPEN 0x0002 + +/** Used with \ref canCHANNELDATA_CHANNEL_FLAGS, indicates that the channel is + * opened as CAN FD. */ + +#define canCHANNEL_IS_CANFD 0x0004 + +//#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed + + /** @} */ + + +/** + * \name canHWTYPE_xxx + * \anchor canHWTYPE_xxx + * + * The following constants can be returned from \ref canGetChannelData(), using the + * \ref canCHANNELDATA_CARD_TYPE item code. They identify the hardware type for + * the channel specified in the call to \ref canGetChannelData(). + * + * \note They indicate a hardware type, but not necessarily a specific + * product. For example, \ref canHWTYPE_LAPCAN is returned both for LAPcan and + * LAPcan II. (You can use \ref canGetChannelData() to obtain the UPC/EAN code for + * the device. This number uniquely identifies the product.) + * + * @{ + */ +#define canHWTYPE_NONE 0 ///< Unknown or undefined +#define canHWTYPE_VIRTUAL 1 ///< The virtual CAN bus +#define canHWTYPE_LAPCAN 2 ///< LAPcan Family +#define canHWTYPE_CANPARI 3 ///< CANpari (obsolete). +#define canHWTYPE_PCCAN 8 ///< PCcan Family +#define canHWTYPE_PCICAN 9 ///< PCIcan Family +#define canHWTYPE_USBCAN 11 ///< USBcan (obsolete). +#define canHWTYPE_PCICAN_II 40 ///< PCIcan II family +#define canHWTYPE_USBCAN_II 42 ///< USBcan II, USBcan Rugged, Kvaser Memorator +#define canHWTYPE_SIMULATED 44 ///< Simulated CAN bus for Kvaser Creator (obsolete). +#define canHWTYPE_ACQUISITOR 46 ///< Kvaser Acquisitor (obsolete). +#define canHWTYPE_LEAF 48 ///< Kvaser Leaf Family +#define canHWTYPE_PC104_PLUS 50 ///< Kvaser PC104+ +#define canHWTYPE_PCICANX_II 52 ///< Kvaser PCIcanx II +#define canHWTYPE_MEMORATOR_II 54 ///< Kvaser Memorator Professional family +#define canHWTYPE_MEMORATOR_PRO 54 ///< Kvaser Memorator Professional family +#define canHWTYPE_USBCAN_PRO 56 ///< Kvaser USBcan Professional +#define canHWTYPE_IRIS 58 ///< Obsolete name, use canHWTYPE_BLACKBIRD instead +#define canHWTYPE_BLACKBIRD 58 ///< Kvaser BlackBird +#define canHWTYPE_MEMORATOR_LIGHT 60 ///< Kvaser Memorator Light +#define canHWTYPE_MINIHYDRA 62 ///< Obsolete name, use canHWTYPE_EAGLE instead +#define canHWTYPE_EAGLE 62 ///< Kvaser Eagle family +#define canHWTYPE_BAGEL 64 ///< Obsolete name, use canHWTYPE_BLACKBIRD_V2 instead +#define canHWTYPE_BLACKBIRD_V2 64 ///< Kvaser BlackBird v2 +#define canHWTYPE_MINIPCIE 66 ///< Kvaser Mini PCI Express +#define canHWTYPE_USBCAN_KLINE 68 ///< USBcan Pro HS/K-Line +#define canHWTYPE_ETHERCAN 70 ///< Kvaser Ethercan +#define canHWTYPE_USBCAN_LIGHT 72 ///< Kvaser USBcan Light +#define canHWTYPE_USBCAN_PRO2 74 ///< Kvaser USBcan Pro 5xHS and variants +#define canHWTYPE_PCIE_V2 76 ///< Kvaser PCIEcan 4xHS and variants +#define canHWTYPE_MEMORATOR_PRO2 78 ///< Kvaser Memorator Pro 5xHS and variants +#define canHWTYPE_LEAF2 80 ///< Kvaser Leaf Pro HS v2 and variants +#define canHWTYPE_MEMORATOR_V2 82 ///< Kvaser Memorator (2nd generation) + + +/** @} */ + +/** + * \name canCHANNEL_CAP_xxx + * \anchor canCHANNEL_CAP_xxx + * + * Channel capabilities. + */ +#define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L ///< Can use extended identifiers +#define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L ///< Can report busload etc +#define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L ///< Can return error counters +#define canCHANNEL_CAP_CAN_DIAGNOSTICS 0x00000008L ///< Can report CAN diagnostics +#define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L ///< Can send error frames +#define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L ///< Can send CAN overload frame +#define canCHANNEL_CAP_TXREQUEST 0x00000040L ///< Can report when a CAN messsage transmission is initiated +#define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L ///< Can report when a CAN messages has been transmitted +#define canCHANNEL_CAP_VIRTUAL 0x00010000L ///< Virtual CAN channel +#define canCHANNEL_CAP_SIMULATED 0x00020000L ///< Simulated CAN channel +#define canCHANNEL_CAP_RESERVED_1 0x00040000L ///< Obsolete, use canCHANNEL_CAP_REMOTE_ACCESS or \ref canGetChannelData() instead. +#define canCHANNEL_CAP_CAN_FD 0x00080000L ///< CAN-FD ISO compliant channel +#define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L ///< CAN-FD NON-ISO compliant channel +#define canCHANNEL_CAP_SILENT_MODE 0x00200000L ///< Channel supports Silent mode +#define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L ///< Channel supports Single Shot messages +#define canCHANNEL_CAP_LOGGER 0x00800000L ///< Channel has logger capabilities. +#define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L ///< Channel has remote capabilities +#define canCHANNEL_CAP_SCRIPT 0x02000000L ///< Channel has script capabilities. + +/** + * \name canCHANNEL_OPMODE_xxx + * \anchor canCHANNEL_OPMODE_xxx + * + * Current WLAN operational mode. + * + * @{ + */ +#define canCHANNEL_OPMODE_NONE 1 ///< Not applicable, or unknown +#define canCHANNEL_OPMODE_INFRASTRUCTURE 2 ///< Infrastructure mode +#define canCHANNEL_OPMODE_RESERVED 3 ///< Reserved value, do not use +#define canCHANNEL_OPMODE_ADHOC 4 ///< Adhoc mode +/** @} */ + +/** + * \name canDRIVER_CAP_xxx + * \anchor canDRIVER_CAP_xxx + * + * Driver (transceiver) capabilities. + * @{ + */ +/** Used with \ref canCHANNELDATA_TRANS_CAP */ +#define canDRIVER_CAP_HIGHSPEED 0x00000001L +/** @} */ + +/** + * \ingroup General + * \name canIOCTL_xxx + * \anchor canIOCTL_xxx + * + * These defines are used in \ref canIoCtl(). + * + * @{ + */ + + + /** + * This define is used in \ref canIoCtl(), \a buf and \a buflen refers to this + * functions arguments. + * + * Tells CANLIB to "prefer" extended identifiers; that is, if you send a + * message with \ref canWrite() and don't specify \ref canMSG_EXT nor \ref canMSG_STD, + * \ref canMSG_EXT will be assumed. The contents of \a buf and \a buflen are + * ignored. \ref canRead() et al will set \ref canMSG_EXT and/or \ref canMSG_STD as usual + * and are not affected by this call. + */ +#define canIOCTL_PREFER_EXT 1 + + /** + * This define is used in \ref canIoCtl(), \a buf and \a buflen refers to this + * functions arguments. + * + * Tells CANLIB to "prefer" standard identifiers; that is, if you send a + * message with \ref canWrite() and don't specify \ref canMSG_EXT nor \ref canMSG_STD, + * \ref canMSG_STD will be assumed. The contents of \a buf and \a buflen are + * ignored. \ref canRead() et al will set \ref canMSG_EXT and/or \ref canMSG_STD as usual + * and are not affected by this call. + */ +#define canIOCTL_PREFER_STD 2 +// 3,4 reserved. + + /** + * The following canIOCTL code is deprecated. + * It is recommended to use \ref canIOCTL_RESET_OVERRUN_COUNT to reset overrun status + * (Note that CAN error counters are never updated on device and will be briefly + * changed back to their original values after this call) + * + * This define is used in \ref canIoCtl(), \a buf and \a buflen refers to this + * functions arguments. + * + * Tells CANLIB to clear the CAN error counters. The contents of \a buf and \a + * buflen are ignored. CAN error counters on device side are NOT updated. + * + */ +#define canIOCTL_CLEAR_ERROR_COUNTERS 5 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a DWORD which contains the desired time-stamp clock + * resolution in microseconds. The default value is 1000 microseconds, i.e. + * one millisecond. + * + * \note The accuracy of the clock isn't affected. + */ +#define canIOCTL_SET_TIMER_SCALE 6 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a DWORD which contains + * + * \li 0: to turn Transmit Acknowledges off. + * \li 1: to turn Transmit Acknowledges on. + * \li 2: to turn Transmit Acknowledges off, even for the driver's internal + * usage. This might enhance performance but will cause some other APIs to + * stop working (for example, the current size of the transmit queue can not + * be read when this mode is active.) + * + * The default value is 0, Transmit Acknowledge is off. + */ +#define canIOCTL_SET_TXACK 7 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points at a \c DWORD which receives the current RX queue level. The + * returned value is approximative (this is because not all hardware supports + * retrieving the queue levels. In that case a best-effort guess is + * returned. Also note that a device with embedded CPU will report its queue + * levels to the host computer after a short delay that depends on the bus + * traffic intensity, and consequently the value returned by the call to + * \ref canIoCtl() might be a few milliseconds old.) + */ +#define canIOCTL_GET_RX_BUFFER_LEVEL 8 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points at a \c DWORD which receives the current TX queue level. The + * returned value is approximative (this is because not all hardware supports + * retrieving the queue levels. In that case a best-effort guess is + * returned. Also note that a device with embedded CPU will report its queue + * levels to the host computer after a short delay that depends on the bus + * traffic intensity, and consequently the value returned by the call to + * \ref canIoCtl() might be a few milliseconds old.) + */ +#define canIOCTL_GET_TX_BUFFER_LEVEL 9 + + /** + * This define is used in \ref canIoCtl(), \a buf and \a buflen refers to this + * functions arguments. + * + * Discard the current contents of the RX queue. The values of \a buf and \a + * buflen are ignored. + * + * \note This is the same thing as calling \ref canFlushReceiveQueue() + */ +#define canIOCTL_FLUSH_RX_BUFFER 10 + + /** + * This define is used in \ref canIoCtl(), \a buf and \a buflen refers to this + * functions arguments. + * + * Discard the current contents of the TX queue. The values of \a buf and \a + * buflen are ignored. + * + * \note This is the same thing as calling \ref canFlushTransmitQueue(). + */ +#define canIOCTL_FLUSH_TX_BUFFER 11 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a \c DWORD which contains the desired time-stamp clock + * resolution in microseconds. Note that the accuracy of the clock isn't + * affected. The default value is 1000 microseconds, i.e. one millisecond. + */ +#define canIOCTL_GET_TIMER_SCALE 12 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a \c DWORD which contains + * + * \li \c 0 to turn Transmit Requests off. + * \li \c 1 to turn Transmit Requests on. + * + * Default value is \c 0, Transmit Requests off. + */ +#define canIOCTL_SET_TXRQ 13 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points at a \c DWORD which receives a Windows Event handle which can + * be passed to the Win32 API \c WaitForSingleObject. The event is signaled + * when "something" (typically that a CAN message has been received or + * transmitted) happens in the driver. + * + * \note There is no more information available as to what happened when this + * call returns. The call may return on an "internal" event in CANLIB and your + * application must be prepared to handle this (i.e. go to sleep again.) + * + * \win_start + * \note If \ref canWaitForEvent() returns with success status (\ref canOK), you must call + * \ref canRead() repeatedly until it returns \ref canERR_NOMSG, before calling + * \ref canWaitForEvent() again. This will flush the driver's internal event queues. + * Failure to call \ref canRead() can cause \ref canWaitForEvent() to get stuck in a state + * where it always sleeps for the specified timeout and then returns with + * \ref canERR_TIMEOUT. + * + * \sa \ref canWaitForEvent() + * \win_end + * + * \note You must not set, reset, nor close this handle. Waiting on it is + * the only supported operation. + */ +#define canIOCTL_GET_EVENTHANDLE 14 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \note Not yet implemented. + */ +#define canIOCTL_SET_BYPASS_MODE 15 + + /** + * This define is used in \ref canIoCtl(). + * + * This is only intended for internal use. + */ +#define canIOCTL_SET_WAKEUP 16 + +#if defined(CANLIB_DECLARE_ALL) + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a HANDLE which receives the Windows handle related to the + * CANLIB handle. + */ +# define canIOCTL_GET_DRIVERHANDLE 17 + + /** + * This define is used in \ref canIoCtl(). + * + * This is only intended for internal use. + */ +# define canIOCTL_MAP_RXQUEUE 18 + + /** + * This define is used in \ref canIoCtl(). + * + * This is only intended for internal use. + */ +# define canIOCTL_GET_WAKEUP 19 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a unsigned char which contains + * + * \li \c 0 to turn access error reporting off, and + * \li \c 1 to turn access error reporting on. + * + * Default value is \c 0, access error reporting off. + */ +# define canIOCTL_SET_REPORT_ACCESS_ERRORS 20 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a unsigned char which receives the current setting of the access + * error reporting (0 or 1.) + */ +# define canIOCTL_GET_REPORT_ACCESS_ERRORS 21 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * Connects the handle to the virtual bus number (0..31) which the \a buf + * points to. + */ +# define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * Disonnects the handle from the virtual bus number (0..31) which the \a buf + * points to. + */ +# define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a \ref canUserIoPortData struct that contains a port number + * and a port value to set. This is used by special hardware only. + */ +# define canIOCTL_SET_USER_IOPORT 24 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a \ref canUserIoPortData struct that contains a port + * number. After the call, the struct will contain the current value of the + * I/O port. This is used by special hardware only. + */ +# define canIOCTL_GET_USER_IOPORT 25 + + /** + * This define is used in \ref canIoCtl(). + * + * This is only intended for internal use. + */ +# define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * Use this function code to set the size of the receive buffer for a + * specific handle. \a buf points to an unsigned integer which contains the + * new size (number of messages) of the receive buffer. + * + * \note The receive buffer consumes system nonpaged pool memory, which is a + * limited resource. Do not increase the receive buffer size unless you + * have good reasons to do so. + * + * \note You can't use this function code when the channel is on bus. + */ +# define canIOCTL_SET_RX_QUEUE_SIZE 27 + + /** + * This define is used in \ref canIoCtl(). + * + * This is only intended for internal use. + */ +# define canIOCTL_SET_USB_THROTTLE 28 + + /** + * This define is used in \ref canIoCtl(). + * + * This is only intended for internal use. + */ +# define canIOCTL_GET_USB_THROTTLE 29 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a DWORD. If the value is zero, the CAN clock will not be + * reset at buson for the handle. Otherwise, the CAN clock will be reset at + * buson. + * + * Default value is \c 1, the CAN clock will be reset at buson. + */ +# define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * Returns the state of the Transmit Acknowledge as a DWORD in \a buf: + * + * \li 0: Transmit Acknowledges is turned off. + * \li 1: Transmit Acknowledges is turned on. + * \li 2: Transmit Acknowledges is turned off, even for the driver's internal + * usage. + */ +# define canIOCTL_GET_TXACK 31 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to an unsigned byte. If the value is zero, the local transmit + * echo is turned off for the handle. Otherwise, local transmit echo is turned + * on. + * + * Local transmit echo is turned on by default on all handles. This means + * that if two handles are open on the same channel, and a message is + * transmitted on the first handle, it will be received as a normal message + * on the second handle. Use the \ref canIOCTL_SET_LOCAL_TXECHO function code to + * turn this function off, if it is not desired on a certain handle. + */ +# define canIOCTL_SET_LOCAL_TXECHO 32 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to an unsigned byte. If the value is zero, the reporting of + * error frames is turned off for the handle. Otherwise, error frame reporting + * is turned on. + * + * Default value is \c 1, error frame reporting is turned on. + */ +# define canIOCTL_SET_ERROR_FRAMES_REPORTING 33 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a 32-bit unsigned integer that receives the quality of + * the channel, where the quality is measured in percent of optimal quality. + * + * For a WLAN, -90 dBm and -35 dBm are considered 0% and 100%, respectively. + * + * The quality is 100% for any directly connected channel (USB, PCI etc.). + */ +# define canIOCTL_GET_CHANNEL_QUALITY 34 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a \c DWORD that contains the roundtrip time measured in + * milliseconds. + */ +# define canIOCTL_GET_ROUNDTRIP_TIME 35 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a \c DWORD that contains the \ref kvBUSTYPE_GROUP_xxx bus type. + */ +# define canIOCTL_GET_BUS_TYPE 36 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a CHAR array of at least 32 characters which receives the + * current device name as a \c NULL terminated ASCII string. + * + * If device name is not set or the device does not support this + * functionality, an error will be returned. + */ +# define canIOCTL_GET_DEVNAME_ASCII 37 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a \c DWORD that contains the time in milliseconds since the last + * communication occured. + * + * For WLAN devices, this is the time since the last keep-alive message. + */ +# define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38 + + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * Obtain the time reference list for MagiSync devices. + * + * \a buf points to an array of pairs of 64-bit ints, one of which + * will contain the reference number and the other one the timestamp + * in nanoseconds. + * + * \note This function is subject to change in future releases and is + * not supported by Kvaser. + */ +# define canIOCTL_GET_TREF_LIST 39 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * \a buf points to a \c DWORD that contains the number of microseconds + * the minimum CAN message transmit interval should be set to, or 0xffffffff + * to fetch the current setting. + * The minimum interval can not be set to more than one second. + * + * When a CAN channel goes bus on, the minimum interval is set to zero. + * I.e. CAN transmissions happen at the maximum speed the device is capable of. + * + * If the device does not support this functionality, or if an invalid + * minimum interval is requested, an error will be returned. + * + * \note The minimum CAN messages transmit interval applies to the physical CAN + * channel. It will thus affect all messages transmitted, even those sent + * using other CANlib handles to the same physical channel. The interval + * is defined as the time from the successful completion of one transmit + * to the beginning of the next one. + */ +# define canIOCTL_TX_INTERVAL 40 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * Some hardware have bitrate limits, which must be met when using any of \a canSetBusParams(), + * \a canSetBusParamsC200(), \a canGetBusParams() functions + * which can be overriden with this IOCTL. + * \a buf points to a \c long value that contains a user defined bitrate. + * A value of 0 means that the device should use its own default bitrate limit. + */ +# define canIOCTL_SET_BRLIMIT 43 + + /** + * Obsolete, use \ref canIOCTL_SET_THROTTLE_SCALED instead + */ +# define canIOCTL_SET_USB_THROTTLE_SCALED 41 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * This ioctl can be used to set the responsitivity of some devices. + * \a buf points to a \c DWORD that should contain a value between 0 and 100. + * A value of 0 means that the device should be very responsive and a value + * of 100 means that the device generates less cpu load or requires more bandwidth. + * Note that not all + * devices support this. Some hardware will accept this command but neglect it. + * This can be found out by reading the scaled throttle. + */ +# define canIOCTL_SET_THROTTLE_SCALED 41 + + /** + * Obsolete, use \ref canIOCTL_GET_THROTTLE_SCALED instead + */ +# define canIOCTL_GET_USB_THROTTLE_SCALED 42 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * This ioctl can be used to set the responsitivity of some devices. + * \a buf points to a \c DWORD that should contain a value between 0 and 100. + * A value of 0 means that the device should be very responsive and a value + * of 100 means that the device generates less cpu load or requires more bandwidth. + * Note that not all + * devices support this. Some hardware will accept this command but neglect it. + * This can be found out by reading the scaled throttle. + */ +# define canIOCTL_GET_THROTTLE_SCALED 42 + + /** + * This define is used in \ref canIoCtl(), \a buf mentioned below refers to this + * functions argument. + * + * This ioctl resets overrun count and flags, \sa \ref canReadStatus \sa \ref canGetBusStatistics + */ +# define canIOCTL_RESET_OVERRUN_COUNT 44 +#endif + /** @} */ + +#if defined(CANLIB_DECLARE_ALL) +/** Used in \ref canIOCTL_SET_USER_IOPORT and \ref canIOCTL_GET_USER_IOPORT. */ +typedef struct { + unsigned int portNo; ///< Port number used in e.g. \ref canIOCTL_SET_USER_IOPORT + unsigned int portValue; ///< Port value used in e.g. \ref canIOCTL_SET_USER_IOPORT +} canUserIoPortData; + +#endif + +#if defined(CANLIB_DECLARE_ALL) +/** + * \ingroup Notification and Waiting + * + * \source_cs static Canlib.canStatus canWaitForEvent(int hnd, ulong timeout); + * + * \source_delphi function canWaitForEvent(hnd: canHandle; timeout: Cardinal): canStatus; + * \source_end + * + * Waits for an event (of any kind) to happen at the specified CAN circuit, or + * a timeout to occur. An event in this context means for example the arrival + * of a CAN message or a CAN bus status change, but it can also be an event + * internal to the driver. + * + * \param[in] hnd A handle to an open CAN circuit. + * \param[in] timeout The number of milliseconds to wait before the call + * returns, if no event occurs. 0xFFFFFFFF gives an + * infinite timeout. + * + * \return \ref canOK (zero) if an event happened during the specified time + * period. + * \return \ref canERR_TIMEOUT (negative) if nothing happened during the specified + * time period. + * \return \ref canERR_xxx (negative) if failure. + * + * \sa \ref page_code_snippets_examples, + * \ref page_user_guide_send_recv_asynch_not + * \sa \ref canRead() + */ +canStatus CANLIBAPI canWaitForEvent (const CanHandle hnd, DWORD timeout); +#endif + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canSetBusParamsC200(int hnd, byte btr0, byte btr1); + * + * \source_delphi function canSetBusParamsC200(hnd: canHandle; btr0, btr1: byte): canStatus; + * \source_end + * + * This function sets the bus timing parameters using the same + * convention as the 82c200 CAN controller (which is the same as many + * other CAN controllers, for example, the 82527.) + * + * To calculate the bit timing parameters, you can use the bit timing + * calculator that is included with CANLIB SDK. Look in the BIN directory. + * + * 82c200 Bit Timing + * + * \li \a btr0 [b7..b6]: SJW - 1 + * \li \a btr0 [b5..b0]: Prescaler -1 + * \li \a btr1 [b7]: \c 1: 3 samples, \c 0: 1 samples + * \li \a btr1 [b6..b4]: tseg2 - 1 + * \li \a btr1 [b3..b0]: tseg1 - 2 + * + * \note CANLIB will always behave as if the clock frequency is 16 MHz. It does + * not matter if the device has a different physical clock, since this will be + * compensated for by the driver. + * + * \param[in] hnd A handle to an open CAN circuit. + * \param[in] btr0 The desired bit timing, formatted as the contents of the + * BTR0 register in the 82c200. + * \param[in] btr1 The desired bit timing, formatted as the contents of the + * BTR1 register in the 82c200. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * + * \sa \ref page_code_snippets_bit_rate, \ref page_user_guide_misc_bitrate + * \sa \ref canSetBusParams() + */ +canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1); + +#if defined(CANLIB_DECLARE_ALL) + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canSetDriverMode(int hnd, int lineMode, int resNet); + * + * \source_delphi function canSetDriverMode(hnd: canHandle; lineMode, resNet: Integer): canStatus; + * \source_end + * + * This function sets the current CAN bus driver mode. This is + * typically a mode like sleep, wakeup, standby, fast mode, etc. The + * different modes are almost always hardware dependent and requires + * special DRVcan cables. As an example, the DRVcan S implements J2411 + * compliant single-wire CAN and supports four line modes, namely + * Normal, Sleep, Fast and Wakeup. + * + * Standard ISO 11898 CAN do not support any of these bus driver modes. + * + * \note The bus driver mode is typically used to control things like one- or + * two-wire mode, sleep mode, and so on. It requires special support in the CAN + * driver circuit. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] lineMode An int which defines the line mode, + * \ref canTRANSCEIVER_LINEMODE_xxx. + * \param[in] resNet An int which defines the resnet mode. Set this parameter to + * \ref canTRANSCEIVER_RESNET_NA unless you have good reasons to set it + * to something else. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \win_start + * \sa \ref canGetDriverMode() + * \win_end + * + * \linux_start + * Not implemented. + * \linux_end + */ +canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canGetDriverMode(int hnd, out int lineMode, out int resNet); + * + * \source_delphi function canGetDriverMode(hnd: canHandle; var lineMode: Integer; var resNet: Integer): canStatus; + * \source_end + * + * This function retrieves the current CAN bus driver mode. This is typically a + * mode like sleep, wakeup, standby, fast mode, etc. The different modes are + * almost always hardware dependent and requires special DRVcan cables. As an + * example, the DRVcan S implements J2411 compliant single-wire CAN and + * supports four line modes, namely Normal, Sleep, Fast and Wakeup. + * + * Standard ISO 11898 CAN do not support any of these bus driver modes. + * + * \note The bus driver mode is typically used to control things like one- or + * two-wire mode, sleep mode, and so on. It requires special support in the CAN + * driver circuit. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[out] lineMode A pointer to an int which receives the current line + * mode (\ref canTRANSCEIVER_LINEMODE_xxx). + * \param[out] resNet A pointer to an int which receives the current resnet + * mode. This value is usually + * \ref canTRANSCEIVER_RESNET_NA except for special DRVcan + * cables. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \win_start + * \sa \ref canSetDriverMode() + * \win_end + * + * \linux_start + * Not implemented. + * \linux_end + * + */ +canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet); +#endif + +/** + * \name canVERSION_CANLIB32_xxx + * \anchor canVERSION_CANLIB32_xxx + * @{ + * Item codes for canGetVersionEx(). + */ + + /** + * This define is used in \ref canGetVersionEx() and controls which version number + * that returned. + * + * Version number of the canlib32.dll file coded as an unsigned 16-bit word + * with the major version number in the upper byte and the minor version + * number in the lower byte. This version number is not related to the + * product version number of the whole CANLIB. For example, canlib32.dll + * belonging to CANLIB 2.27 would return 0x305. + */ +#define canVERSION_CANLIB32_VERSION 0 + + /** + * This define is used in \ref canGetVersionEx() and controls what type of version + * number that is returned. + * + * Product version number of canlib32.dll coded as an unsigned 16-bit word + * with the major version number in the upper byte and the minor version + * number in the lower byte. The product version number corresponds to the + * version number of the whole CANLIB. For example, canlib32.dll belonging to + * CANLIB 2.27 would return 0x21B. + */ +#define canVERSION_CANLIB32_PRODVER 1 + + /** + * This define is used in \ref canGetVersionEx() and controls what type of version + * number that is returned. + * + * Product version number of canlib32.dll coded as an unsigned 32-bit word + * where the bytes contain (in order from the most significant to the least + * significant byte) 0, major version number, minor version number, and the + * minor version letter. (The minor version letter is the ASCII code for the + * letter, or 0 (zero) if no letter). For example, CANLIB 3.8 would return + * 0x00030800 and CANLIB 3.8a would return 0x00030861. + */ +#define canVERSION_CANLIB32_PRODVER32 2 + + /** + * This define is used in \ref canGetVersionEx() and controls what type of version + * number that is returned. + * + * Returns 1 if the present version is a beta (preview) release, or 0 if it + * is an official release. + */ +#define canVERSION_CANLIB32_BETA 3 +/** @} */ + +#if defined(CANLIB_DECLARE_ALL) + +/** + * \ingroup Information Services + * + * \source_cs static int canGetVersionEx(int itemCode); + * + * \source_delphi function canGetVersionEx(itemCode: Cardinal): Cardinal; + * \source_end + * + * This function returns various version numbers from the driver routines. + * + * \param[in] itemCode Specifies which version number to retrieve. See + * \ref canVERSION_CANLIB32_xxx + * + * \return The return value is desired version number. + * + * \sa \ref page_user_guide_build_driver_version + */ +unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamGetCount(); + * + * \source_delphi function canParamGetCount(): canStatus; + * \source_end + * + * This function returns the number of entries in the table of named + * channels. + * + * \return The number of channels (zero or positive) + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * + */ +canStatus CANLIBAPI canParamGetCount (void); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamCommitChanges(); + * + * \source_delphi function canParamCommitChanges(): canStatus; + * \source_end + * + * This function writes the current set of named parameters to the + * Registry. Previous entries are erased. + * + * The named parameters are stored in the + * \c HKEY_LOCAL_MACHINE\\SOFTWARE\\KVASER \c AB\\CANLIB32\\PredefinedBitrates + * key in the Registry. + * + * \note You must have Administrator's rights to write to the Registry. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * + */ +canStatus CANLIBAPI canParamCommitChanges (void); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamDeleteEntry(int index); + * + * \source_delphi function canParamDeleteEntry(index: Integer): canStatus; + * \source_end + * + * This function deletes the entry in the table of named parameter settings + * with the given index. The entries below (i.e. with higher indices) the + * deleted entry are moved up one step in the table. + * + * The named parameters are stored in the + * \c HKEY_LOCAL_MACHINE\\SOFTWARE\\KVASER \c AB\\CANLIB32\\PredefinedBitrates + * key in the Registry. + * + * \param[in] index The index of the entry to delete. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCreateNewEntry(), \ref canParamCommitChanges() + */ +canStatus CANLIBAPI canParamDeleteEntry (int index); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static int canParamCreateNewEntry(); + * + * \source_delphi function canParamCreateNewEntry(): canStatus; + * \source_end + * + * This function creates a new entry in the table of named parameter + * settings. + * + * The named parameters are stored in the + * \c HKEY_LOCAL_MACHINE\\SOFTWARE\\KVASER \c AB\\CANLIB32\\PredefinedBitrates + * key in the Registry. + * + * \return The index of the created entry (zero or positive) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCommitChanges(), \ref canParamDeleteEntry() + * + */ +canStatus CANLIBAPI canParamCreateNewEntry (void); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamSwapEntries(int index1, int index2); + * + * \source_delphi function canParamSwapEntries(index1, index2: Integer): canStatus; + * \source_end + * + * This function swaps two entries in the list of named + * parameters. + * + * The named parameters are stored in the + * \c HKEY_LOCAL_MACHINE\\SOFTWARE\\KVASER \c AB\\CANLIB32\\PredefinedBitrates + * key in the Registry. + * + * \param[in] index1 The first of the two entries that are to be swapped in the + * named parameters list. + * \param[in] index2 The second of the two entries that are to be swapped in the + * named parameters list. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCommitChanges() + * + */ +canStatus CANLIBAPI canParamSwapEntries (int index1, int index2); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamGetName(int index, ref string str_buf); + * + * \source_delphi function canParamGetName(index: Integer; buffer: PChar; maxlen: Integer): canStatus; + * \source_end + * + * This function returns the name of a given entry in the list of + * named parameters. + * + * The named parameters are stored in the + * \c HKEY_LOCAL_MACHINE\\SOFTWARE\\KVASER \c AB\\CANLIB32\\PredefinedBitrates + * key in the Registry. + * + * \param[in] index The index of the entry in the named parameters list, whose + * name is to be returned. + * \param[out] buffer A pointer to a buffer that is to receive a + * \c NULL terminated string which contains the name. The + * buffer is allocated and deallocated by the user. + * \param[in] maxlen The length of the buffer. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamSetName(), \ref canParamCommitChanges() + */ +canStatus CANLIBAPI canParamGetName (int index, char *buffer, int maxlen); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static int canParamGetChannelNumber(int index); + * + * \source_delphi function canParamGetChannelNumber(index: Integer): canStatus; + * \source_end + * + * This function returns the channel number of the entry with the + * given index in the table of named parameter settings. + * + * \param[in] index The index of the entry in the table of named parameter + * settings. + * + * \return The channel number of the entry in question (zero or positive) + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCommitChanges(), \ref canParamGetChannelNumber() + */ +canStatus CANLIBAPI canParamGetChannelNumber (int index); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamGetBusParams(int index, out int bitrate, out int tseg1, out int tseg2, out int sjw, out int noSamp); + * + * \source_delphi function canParamGetBusParams(index: Integer; var bitrate: LongInt; var tseg1: Cardinal; var tseg2: Cardinal; var sjw: Cardinal; var nosamp: Cardinal): canStatus; + * \source_end + * + * This function retrieves the bus parameters associated with the + * entry with the given index in the table of named parameter + * settings. + * + * \param[in] index The index of the entry in the table of named parameter + * settings. + * \param[out] bitrate Bit rate (bits per second). + * \param[out] tseg1 Time segment 1, that is, the number of quanta from (but + * not including) the Sync Segment to the sampling point. + * \param[out] tseg2 Time segment 2, that is, the number of quanta from the + * sampling point to the end of the bit. + * \param[out] sjw The Synchronization Jump Width. + * \param[out] noSamp The number of sampling points; can be 1 or 3. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCommitChanges(), \ref canParamSetBusParams() + */ +canStatus CANLIBAPI canParamGetBusParams (int index, + long* bitrate, + unsigned int *tseg1, + unsigned int *tseg2, + unsigned int *sjw, + unsigned int *noSamp); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamSetName(int index, string str_buf); + * + * \source_delphi function canParamSetName(index: Integer; buffer: PChar): canStatus; + * \source_end + * + * This function sets or changes the name of a named parameter. + * + * \param[in] index The index of the named parameter whose name is to be + * changed or set. + * \param[out] buffer A pointer to a \c NULL terminated string that contains the + * new name. If the string is longer than the maximum + * allowed name length, it is truncated. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCommitChanges(), \ref canParamGetName() + */ +canStatus CANLIBAPI canParamSetName (int index, const char *buffer); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamSetChannelNumber(int index, int channel); + * + * \source_delphi function canParamSetChannelNumber(index, channel: Integer): canStatus; + * \source_end + * + * This function sets the channel number for a specified entry in the list of + * named parameters. Channels are numbered from 0 and up. + * + * \param[in] index The index of the entry in the named parameter list whose + * channel number is to be set. + * \param[in] channel The channel number. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCommitChanges(), \ref canParamGetChannelNumber() + */ +canStatus CANLIBAPI canParamSetChannelNumber (int index, int channel); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamSetBusParams(int index, int bitrate, int tseg1, int tseg2, int sjw, int noSamp); + * + * \source_delphi function canParamSetBusParams(index: Integer; bitrate: longint; tseq1, tseq2, sjw, noSamp: Cardinal): canStatus; + * \source_end + * + * This function sets or changes the bus parameters for a given entry in the + * list of named parameters. + * + * \note The bus parameters are not checked for validity. + * + * \param[in] index The index of the entry in the named parameter list whose + * parameters are to be set or changed. + * \param[in] bitrate Bit rate (measured in bits per second); or one of the + * predefined constants \ref canBITRATE_xxx. + + * \param[in] tseg1 Time segment 1, that is, the number of quanta from (but not + * including) the Sync Segment to the sampling point. + * \param[in] tseg2 Time segment 2, that is, the number of quanta from the + * sampling point to the end of the bit. + + * \param[in] sjw The Synchronization Jump Width. + * \param[in] noSamp The number of sampling points; can be 1 or 3. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCommitChanges(), \ref canParamGetBusParams() + */ +canStatus CANLIBAPI canParamSetBusParams (int index, + long bitrate, + unsigned int tseg1, + unsigned int tseg2, + unsigned int sjw, + unsigned int noSamp); + +/** + * \ingroup NamedParameterSettings + * + * \source_cs static Canlib.canStatus canParamFindByName(string str_name); + * + * \source_delphi function canParamFindByName(const Name: PChar):canStatus; + * \source_end + * + * This function returns the index of the parameter setting with the + * given name. + * + * \param[in] name A pointer to a string containing the name of the setting. + * + * \return The index of the setting (zero or positive) if success. + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_misc_named_parameters + * \sa \ref canParamCommitChanges() + */ +canStatus CANLIBAPI canParamFindByName (const char *name); +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufFreeAll(int handle); + * + * \source_delphi function canObjBufFreeAll(handle: canHandle): canStatus; + * \source_end + * + * Deallocates all object buffers on the specified handle. The + * buffers cannot be referenced after this operation. + * + * \param[in] hnd An open handle to a CAN circuit. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + * \sa \ref canObjBufFree(), \ref canObjBufAllocate() + */ +canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd); + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufAllocate(int handle, int type); + * + * \source_delphi function canObjBufAllocate(handle: canHandle; tp: Integer): canStatus; + * \source_end + * + * Allocates an object buffer associated with a handle to a CAN + * circuit. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] type The type of the buffer. Must be one of \ref canOBJBUF_TYPE_xxx + * + * \return A buffer index (zero or positive) if success. + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + * \sa \ref canObjBufFree(), \ref canObjBufFreeAll() + */ +canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type); + + /** + * \name canOBJBUF_TYPE_xxx + * \anchor canOBJBUF_TYPE_xxx + * + * Used in \ref canObjBufAllocate(). + * + * @{ + */ +#define canOBJBUF_TYPE_AUTO_RESPONSE 0x01 ///< The buffer is an auto-response buffer. +#define canOBJBUF_TYPE_PERIODIC_TX 0x02 ///< The buffer is an auto-transmit buffer. + /** @} */ + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufFree(int handle, int idx); + * + * \source_delphi function canObjBufFree(handle: canHandle; idx: Integer): canStatus; + * \source_end + * + * Deallocates the object buffer with the specified index. The buffer + * can not be referenced after this operation. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] idx The object buffer to deallocate. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + * \sa \ref canObjBufFreeAll(), \ref canObjBufAllocate(), + */ +canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx); + +// Writes CAN data to the object buffer with the specified index. + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufWrite(int handle, int idx, int id, byte[] msg, int dlc, int flags); + * + * \source_delphi function canObjBufWrite(handle: canHandle; idx, id: Integer; var msg; dlc, flags: cardinal): canStatus; + * \source_end + * + * Defines the contents of a specific object buffer. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] idx The index of the object buffer whose contents is to be + * defined. + * \param[in] id The CAN identifier of the message. + * \param[in] msg Points to the contents of the message. + * \param[in] dlc The length of the message in bytes.
+ For Classic CAN dlc can be at most 8, unless \ref canOPEN_ACCEPT_LARGE_DLC is used.
+ For CAN FD dlc can be one of the following 0-8, 12, 16, 20, 24, 32, 48, 64. + * \param[in] flags Message flags; a combination of the \ref canMSG_xxx flags. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + */ +canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd, + int idx, + int id, + void* msg, + unsigned int dlc, + unsigned int flags); + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufSetFilter(int handle, int idx, int code, int mask); + * + * \source_delphi function canObjBufSetFilter(handle: canHandle; idx: Integer; code, mask: Cardinal): canStatus; + * \source_end + * + * Defines a message reception filter on the specified object buffer. + * Messages not matching the filter are discarded. + * + * \note For an auto response buffer, set the code and mask that together define + * the identifier(s) that trigger(s) the automatic response. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] idx The index of the object buffer on which the filter is to be + * set. + * \param[in] code The acceptance code in the filter. + * \param[in] mask The acceptance mask in the filter. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \win_start \ref page_user_guide_misc_code_and_mask, \win_end + * \ref page_user_guide_send_recv_obj_buf + */ +canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd, + int idx, + unsigned int code, + unsigned int mask); + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufSetFlags(int handle, int idx, int flags); + * + * \source_delphi function canObjBufSetFlags(handle: canHandle; idx: Integer; flags: Cardinal): canStatus; + * \source_end + * + * Sets object buffer flags on a specified object buffer. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] idx The buffer on which the flags are to be set. + * \param[in] flags Specifies a combination of zero or more of the + * \ref canOBJBUF_AUTO_RESPONSE_xxx flag values + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + */ +canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd, + int idx, + unsigned int flags); + +/** + * \name canOBJBUF_AUTO_RESPONSE_xxx + * \anchor canOBJBUF_AUTO_RESPONSE_xxx + * + * These defines are used in \ref canObjBufSetFlags(). + * + * @{ + */ + /** + * This define is used in \ref canObjBufSetFlags(). + * + * For auto-response buffers only. When this flag is in effect, the buffer + * will auto-respond to remote requests only. If this flag is not in effect, + * the buffer will auto-respond to both remote requests and ordinary data + * frames. + * + */ +# define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01 + /** @} */ + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufSetPeriod(int hnd, int idx, int period); + * + * \source_delphi function canObjBufSetPeriod(handle: canHandle; idx: Integer; period: Cardinal): canStatus; + * \source_end + * + * The \ref canObjBufSetPeriod function sets the transmission period for an auto + * transmission object buffer. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] idx The index of a CAN object buffer. + * \param[in] period The transmission interval, in microseconds. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + */ +canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd, + int idx, + unsigned int period); + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufSetMsgCount(int hnd, int idx, int count); + * + * \source_delphi function canObjBufSetMsgCount(handle: canHandle; idx: Integer; count: Cardinal): canStatus; + * \source_end + * + * The \ref canObjBufSetMsgCount function sets the message count for an auto + * transmit object buffer. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] idx The index of a CAN object buffer. + * \param[in] count The message count. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + */ +canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd, + int idx, + unsigned int count); + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufEnable(int handle, int idx); + * + * \source_delphi function canObjBufEnable(handle: canHandle; idx: Integer): canStatus; + * \source_end + * + * Enables the object buffer with the specified index. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] idx The index of the object buffer to enable. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + * \sa \ref canObjBufDisable() + */ +canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx); + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufDisable(int handle, int idx); + * + * \source_delphi function canObjBufDisable(handle: canHandle; idx: Integer): canStatus; + * \source_end + * + * Disables the object buffer with the specified index. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] idx The index of the buffer. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + * \sa \ref canObjBufEnable() + */ +canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx); + +/** + * \ingroup ObjectBuffers + * + * \source_cs static Canlib.canStatus canObjBufSendBurst(int hnd, int idx, int burstlen); + * + * \source_delphi function canObjBufSendBurst(handle: canHandle; idx: Integer; burstLen: Cardinal): canStatus; + * \source_end + * + * The canObjBufSendBurst function sends a burst of CAN messages. You have to + * set up an object buffer first with the message to send. The messages will be + * sent as fast as possible from the hardware. + * + * This function is inteneded for certain diagnostic applications. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] idx The index of a CAN object buffer. + * \param[in] burstlen The number of messages to send. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_user_guide_send_recv_obj_buf + */ +canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd, + int idx, + unsigned int burstlen); + +/** + * \name canVERSION_xxx + * \anchor canVERSION_xxx + * + * These defines are used in \ref canProbeVersion(). + * + * @{ + */ + /** + * This define is used in \ref canProbeVersion(), \a major and \a minor refer to + * this functions arguments. + * + * Require that exactly the version specified by \a major and \a minor be + * present. Earlier and later versions are not accepted. This flag does not + * affect the acceptance of beta versions. + */ +#define canVERSION_DONT_ACCEPT_LATER 0x01 + /** + * This define is used in \ref canProbeVersion(), \a major and \a minor refer to + * this functions arguments. + * + * Return FALSE if a beta version (preview version) of CANLIB is installed, + * regardless of its version number. + */ +#define canVERSION_DONT_ACCEPT_BETAS 0x02 + /** @} */ + +/** + * \ingroup General + * + * \source_cs static bool canProbeVersion(int hnd, int major, int minor, int oem_id, int flags); + * + * \source_delphi function canProbeVersion(handle: canHandle; major, minor, oem_id: Integer; flags: Cardinal): Boolean; + * \source_end + * + * This function checks whether a specific version of CANLIB is installed on + * the system. + * + * The default behaviour of \ref canProbeVersion is to accept + * + * \li the version specified by \a major and \a minor, and + * \li any later version, and + * \li all beta versions. + * + * You get the default behaviour by setting \a flags to 0. Use any + * combination of the \ref canVERSION_xxx flags to modify the behaviour. + * + * \note Different handles might have different driver versions installed. This + * should not normally be the case but it might happen anyway. You should check + * the version for each handle you open, e.g. directly after calling + * \ref canOpenChannel(). + * + * \param[in] hnd A handle to an open circuit. + * \param[in] major The major version number of the version to test for. + * \param[in] minor The minor version number of the version to test for. + * \param[in] oem_id Reserved, must be zero. + * \param[in] flags Any combination of the \ref canVERSION_xxx flags, or 0. + * + * \return TRUE if the specified version of CANLIB is installed on the system. + * + * \sa \ref page_user_guide_build_driver_version + * \sa \ref page_code_snippets_examples + * \sa \ref canGetVersion(), \ref canGetVersionEx(), \ref canGetChannelData() + */ +BOOL CANLIBAPI canProbeVersion (const CanHandle hnd, + int major, + int minor, + int oem_id, + unsigned int flags); +#endif + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canResetBus(int handle); + * + * \source_delphi function canResetBus(handle: canHandle): canStatus; + * \source_end + * + * This function tries to reset a CAN bus controller by taking the channel off + * bus and then on bus again (if it was on bus before the call to \ref canResetBus().) + * + * This function will affect the hardware (and cause a real reset of the CAN + * chip) only if \a hnd is the only handle open on the channel. If there + * are other open handles, this operation will not affect the hardware. + * + * \param[in] hnd A handle to an open circuit. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canBusOn(), \ref canBusOff() + */ +canStatus CANLIBAPI canResetBus (const CanHandle hnd); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canWriteWait(int handle, int id, byte[] msg, int dlc, int flag, long timeout); + * + * \source_delphi function canWriteWait(handle: canHandle; id: longint; var msg; dlc, flag, timeout : Cardinal): canStatus; + * \source_end + * + * This function sends a CAN message. It returns when the message is sent, or + * the timeout expires. + * + * This is a convenience function that combines \ref canWrite() and \ref canWriteSync(). + * + * If you are using the same channel via multiple handles, note that the + * default behaviour is that the different handles will "hear" each other just as + * if each handle referred to a channel of its own. If you open, say, channel 0 + * from thread A and thread B and then send a message from thread A, it will be + * "received" by thread B. + * This behaviour can be changed using \ref canIOCTL_SET_LOCAL_TXECHO. + * + * \param[in] hnd A handle to an open CAN circuit. + * \param[in] id The identifier of the CAN message to send. + * \param[in] msg A pointer to the message data, or \c NULL. + * \param[in] dlc The length of the message in bytes.
+ For Classic CAN dlc can be at most 8, unless \ref canOPEN_ACCEPT_LARGE_DLC is used.
+ For CAN FD dlc can be one of the following 0-8, 12, 16, 20, 24, 32, 48, 64. + * \param[in] flag A combination of message flags, \ref canMSG_xxx. + * Use this parameter to send extended (29-bit) frames + * and/or remote frames. Use \ref canMSG_EXT and/or + * \ref canMSG_RTR for this purpose. + * \param[in] timeout The timeout, in milliseconds. 0xFFFFFFFF gives an + * infinite timeout. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ +canStatus CANLIBAPI canWriteWait (const CanHandle hnd, + long id, + void *msg, + unsigned int dlc, + unsigned int flag, + unsigned long timeout); + + +#if defined(CANLIB_DECLARE_ALL) + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus canUnloadLibrary(); + * + * \source_delphi function canUnloadLibrary: Integer; + * \source_end + * + * \win_start + * Use this function if you are loading CANLIB32.DLL dynamically (that is, + * using the Win32 API \c LoadLibrary) and need to unload it using the Win32 + * API \c FreeLibrary. \ref canUnloadLibrary() will free allocated memory, unload + * the DLLs canlib32.dll has loaded and de-initialize data structures. You must + * call \ref canInitializeLibrary() again to use the API functions in canlib32.dll. + * \win_end + * \linux_start + * \ref canUnloadLibrary() will close all open handles and free allocated memory. + * \linux_end + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canInitializeLibrary() + */ +canStatus CANLIBAPI canUnloadLibrary (void); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canSetAcceptanceFilter(int hnd, int code, int mask, int is_extended); + * + * \source_delphi function canSetAcceptanceFilter(handle: canHandle; code, mask: Cardinal; is_extended: Integer): canStatus; + * \source_end + * + * This routine sets the message acceptance filters on a CAN channel. + * + * Format of \a code and \a mask: + * + * \li A binary 1 in a mask means "the corresponding bit in the code is + * relevant" + * \li A binary 0 in a mask means "the corresponding bit in the code is not + * relevant" + * \li A relevant binary 1 in a code means "the corresponding bit in the + * identifier must be 1" + * \li A relevant binary 1 in a code means "the corresponding bit in the + * identifier must be 1" + * + * In other words, the message is accepted if ((code XOR id) AND mask) == 0. + * + * \a extended should be set to: + * + * \li \c 0 (FALSE): if the code and mask shall apply to 11-bit CAN identifiers. + * \li \c 1 (TRUE): if the code and mask shall apply to 29-bit CAN identifiers. + * + * If you want to remove a filter, call \ref canSetAcceptanceFilter() with the mask + * set to \c 0. + * + * On some boards the acceptance filtering is done by the CAN hardware; on + * other boards (typically those with an embedded CPU,) the acceptance + * filtering is done by software. \ref canSetAcceptanceFilter() behaves in the same + * way for all boards, however. + * + * \ref canSetAcceptanceFilter() and \ref canAccept() both serve the same purpose but the + * former can set the code and mask in just one call. + * + * \note You can set the extended code and mask only on CAN boards that support + * extended identifiers. + * + * \note Not all CAN boards support different masks for standard and + * extended CAN identifiers. + * + * \param[in] hnd An open handle to a CAN circuit. + * \param[in] code The acceptance code to set. + * \param[in] mask The acceptance mask to set. + * \param[in] is_extended Select 29-bit CAN identifiers. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples, + * \ref page_user_guide_misc_code_and_mask + * \sa \ref canAccept() + */ +canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd, + unsigned int code, + unsigned int mask, + int is_extended); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canFlushReceiveQueue(int hnd); + * + * \source_delphi function canFlushReceiveQueue(handle: canHandle): canStatus; + * \source_end + * + * This function removes all received messages from the handle's receive queue. + * Other handles open to the same channel are not affcted by this + * operation. That is, only the messages belonging to the handle you are + * passing to \ref canFlushReceiveQueue are discarded. + * + * \note This call has the same effect as calling \ref canIoCtl() with a function + * code of \ref canIOCTL_FLUSH_RX_BUFFER. + * + * \param[in] hnd A handle to an open circuit. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canFlushTransmitQueue() + */ +canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canFlushTransmitQueue(int hnd); + * + * \source_delphi function canFlushTransmitQueue(handle: canHandle): canStatus; + * \source_end + * + * This function removes all messages pending transmission from the + * transmit queue of the circuit. + * + * \note If there are other handles open to the same circuit, they are also + * flushed. + * + * \note This call has the same effect as calling \ref canIoCtl() with a function + * code of \ref canIOCTL_FLUSH_TX_BUFFER. + * + * \param[in] hnd A handle to an open circuit. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canFlushReceiveQueue() + */ +canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvGetApplicationMapping(int busType, string appName, int appChannel, out int resultingChannel); + * + * \source_delphi function kvGetApplicationMapping(busType: Integer; appName: PChar; appChannel: Integer; var resultingChannel: Integer): canStatus; + * \source_end + * + * \note The \ref kvGetApplicationMapping function is presently not implemented. + * + * \param busType + * \param appName + * \param appChannel + * \param resultingChannel + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +canStatus CANLIBAPI kvGetApplicationMapping (int busType, + char *appName, + int appChannel, + int *resultingChannel); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvBeep(int hnd, int freq, int duration); + * + * \source_delphi function kvBeep(handle: canHandle; freq: Integer; duration: Cardinal): canStatus; + * \source_end + * + * The \ref kvBeep function emits a sound of a specific frequency and duration from + * the loudspeaker on the device. + * + * \note This function requires that a loudspeaker be present on the hardware. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] freq The frequency (in Hertz) of the sound. + * \param[in] duration The duration of the sound, in milliseconds. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +canStatus CANLIBAPI kvBeep (const CanHandle hnd, + int freq, + unsigned int duration); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvSelfTest(int hnd, out int presults); + * + * \source_delphi function kvSelfTest(handle: canHandle; var presults: Cardinal): canStatus; + * \source_end + * + * The \ref kvSelfTest function runs a built-in self test in the device. Note that + * not all devices supports built-in self tests. + * + * \param[in] hnd An open hnd to a CAN channel. + * \param[out] presults A pointer to a 32-bit unsigned integer where the + * resuls of the self test will be placed. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +canStatus CANLIBAPI kvSelfTest (const CanHandle hnd, unsigned long *presults); + + /** + * \anchor kvLED_ACTION_xxx + * \name kvLED_ACTION_xxx + * + * The following constants can be used together with the \ref kvFlashLeds() function. + * + * @{ + */ +#define kvLED_ACTION_ALL_LEDS_ON 0 ///< Turn all LEDs on. +#define kvLED_ACTION_ALL_LEDS_OFF 1 ///< Turn all LEDs off. +#define kvLED_ACTION_LED_0_ON 2 ///< Turn LED 0 on. +#define kvLED_ACTION_LED_0_OFF 3 ///< Turn LED 0 off. +#define kvLED_ACTION_LED_1_ON 4 ///< Turn LED 1 on. +#define kvLED_ACTION_LED_1_OFF 5 ///< Turn LED 1 off. +#define kvLED_ACTION_LED_2_ON 6 ///< Turn LED 2 on. +#define kvLED_ACTION_LED_2_OFF 7 ///< Turn LED 2 off. +#define kvLED_ACTION_LED_3_ON 8 ///< Turn LED 3 on. +#define kvLED_ACTION_LED_3_OFF 9 ///< Turn LED 3 off. +#define kvLED_ACTION_LED_4_ON 10 ///< Turn LED 4 on. +#define kvLED_ACTION_LED_4_OFF 11 ///< Turn LED 4 off. +#define kvLED_ACTION_LED_5_ON 12 ///< Turn LED 5 on. +#define kvLED_ACTION_LED_5_OFF 13 ///< Turn LED 5 off. +#define kvLED_ACTION_LED_6_ON 14 ///< Turn LED 6 on. +#define kvLED_ACTION_LED_6_OFF 15 ///< Turn LED 6 off. +#define kvLED_ACTION_LED_7_ON 16 ///< Turn LED 7 on. +#define kvLED_ACTION_LED_7_OFF 17 ///< Turn LED 7 off. +#define kvLED_ACTION_LED_8_ON 18 ///< Turn LED 8 on. +#define kvLED_ACTION_LED_8_OFF 19 ///< Turn LED 8 off. +#define kvLED_ACTION_LED_9_ON 20 ///< Turn LED 9 on. +#define kvLED_ACTION_LED_9_OFF 21 ///< Turn LED 9 off. +#define kvLED_ACTION_LED_10_ON 22 ///< Turn LED 10 on. +#define kvLED_ACTION_LED_10_OFF 23 ///< Turn LED 10 off. +#define kvLED_ACTION_LED_11_ON 24 ///< Turn LED 11 on. +#define kvLED_ACTION_LED_11_OFF 25 ///< Turn LED 11 off. + + /** @} */ + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvFlashLeds(int hnd, int action, int timeout); + * + * \source_delphi function kvFlashLeds(handle: canHandle; action: Integer; timeout: Integer): canStatus; + * \source_end + * + * The \ref kvFlashLeds function will turn the LEDs on the device on or off. + * + * \param[in] hnd + * \param[in] action One of the \ref kvLED_ACTION_xxx constants, defining + * which LED to turn on or off. + * \param[in] timeout Specifies the time, in milliseconds, during which the + * action is to be carried out. When the timeout expires, + * the LED(s) will return to its ordinary function. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canRequestChipStatus(int hnd); + * + * \source_delphi function canRequestChipStatus(handle: canHandle): canStatus; + * \source_end + * + * \win_start + * The canRequestChipStatus function requests that the hardware report the chip + * status (bus on/error passive status etc.) to the driver. The chip status can + * later be retrieved using the \ref canReadStatus() function. + * + * \note The \ref canRequestChipStatus() function is asynchronous, that is, it + * completes before the answer is returned from the hardware. The time between + * a call to \ref canRequestChipStatus() and the point in time where the chip status + * is actually available via a call to \ref canReadStatus() is not + * defined. \ref canReadStatus() always returns the latest data reported by the + * hardware. + * \win_end + * \linux_start + * This function is a dummy implementation for code portability. The Linux + * implementation of \ref canReadStatus() will return the latest status without + * need of an additional call to canRequestChipStatus(), unlike the Windows + * counterpart. + * \linux_end + * + * \param[in] hnd An open handle to a CAN channel. + * + * \win_start + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * \win_end + * \linux_start + * \return \ref canOK (zero) + * \linux_end + * + * \sa \ref canReadStatus() + */ +canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canRequestBusStatistics(int hnd); + * + * \source_delphi function canRequestBusStatistics(handle: canHandle): canStatus; + * \source_end + * + * The \ref canRequestBusStatistics function requests bus statistics from the + * hardware. The bus statistics figures can be retrieved later by a call to the + * \ref canGetBusStatistics function. + * + * \note The time between a call to \ref canRequestBusStatistics() and the point in + * time where the bus statistics is actually available via a call to + * \ref canGetBusStatistics() is not defined. Typically, you would call + * \ref canRequestBusStatistics() from your application periodically (for example, + * once per second) to request the data from the driver and then call + * \ref canGetBusStatistics() with the same rate to obtain the latest reported data. + * + * \param[in] hnd An open handle to a CAN channel. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canGetBusStatistics() + */ +canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd); + + /** + * \ingroup CAN + * This struct is returned by \ref canGetBusStatistics() + * + * The values are cleared when the corresponding channel goes on bus. + */ +typedef struct canBusStatistics_s { + unsigned long stdData; ///< Number of received standard (11-bit identifiers) data frames. + unsigned long stdRemote; ///< Number of received standard (11-bit identifiers) remote frames. + unsigned long extData; ///< Number of received extended (29-bit identifiers) data frames. + unsigned long extRemote; ///< Number of received extended (29-bit identifiers) remote frames. + unsigned long errFrame; ///< Number of error frames + + /** + * The bus load, expressed as an integer in the interval 0 - 10000 + * representing 0.00% - 100.00% bus load. + */ + unsigned long busLoad; + unsigned long overruns; ///< The number of overruns detected by the hardware, firmware or driver. +} canBusStatistics; + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canGetBusStatistics(int hnd, out Canlib.canBusStatistics stat); + * + * \source_delphi function canGetBusStatistics(handle: canHandle; var stat: canBusStatistics; bufsiz: Cardinal): canStatus; + * \source_end + * + * The \ref canGetBusStatistics() function retrieves the latest bus statistics + * figures reported by the driver. You request the bus statistics from the + * driver by calling the \ref canRequestBusStatistics() function. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[out] stat A pointer to a \ref canBusStatistics struct that will receive + * the bus statistics figures. + * \param[in] bufsiz The size, in bytes, of the stat buffer. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canRequestBusStatistics() + */ +canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd, + canBusStatistics *stat, + size_t bufsiz); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canSetBitrate(int hnd, int bitrate); + * + * \source_delphi function canSetBitrate(handle: canHandle; bitrate: Integer): canStatus; + * \source_end + * + * The \ref canSetBitrate() function sets the nominal bit rate of the specified + * CAN channel. The sampling point is recalculated and kept as close as + * possible to the value before the call. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] bitrate The new bit rate, in bits/second. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canSetBusParamsC200(), \ref canSetBusParams(), \ref canGetBusParams() + */ +canStatus CANLIBAPI canSetBitrate (const CanHandle hnd, int bitrate); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvAnnounceIdentity(int hnd, object buffer); + * + * \source_delphi function kvAnnounceIdentity(handle: canHandle; var buf; bufsiz: Cardinal): canStatus; + * \source_end + * + * The \ref kvAnnounceIdentity function is used by certain OEM applications. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[out] buf A pointer to the data to be sent to the driver. + * \param[in] bufsiz The size, in bytes, of the buffer that buf points to. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ +canStatus CANLIBAPI kvAnnounceIdentity (const CanHandle hnd, + void *buf, + size_t bufsiz); +/** + * \ingroup General + * + * The \ref kvAnnounceIdentityEx function is used by certain OEM applications. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] type Type of announcement. + * \param[out] buf A pointer to the data to be sent to the driver. + * \param[in] bufsiz The size, in bytes, of the buffer that buf points to. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ +canStatus CANLIBAPI kvAnnounceIdentityEx (const CanHandle hnd, + int type, + void *buf, + size_t bufsiz); + +/** + * \ingroup CAN + * + * \source_cs static Canlib.canStatus canGetHandleData(int hnd, int item, out object buffer); + * + * \source_delphi function canGetHandleData(handle: canHandle; item: Integer; var Buffer; bufsize: Cardinal): canStatus; + * \source_end + * + * \note This function can be used to retrieve certain pieces of information about an open handle to a CANlib channel. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] item This parameter specifies what data to obtain for the specified handle. The value is one of the constants \ref canCHANNELDATA_xxx + * \param[out] buffer The address of a buffer which is to receive the data. + * \param[in] bufsize The size of the buffer to which the buffer parameter points. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canGetChannelData() + */ +canStatus CANLIBAPI canGetHandleData (const CanHandle hnd, + int item, + void *buffer, + size_t bufsize); + +/** Used for time domain handling. */ +typedef void *kvTimeDomain; + +/** Contains status codes according to \ref canSTAT_xxx. */ +typedef canStatus kvStatus; + +/** + * \ingroup TimeDomainHandling + * + * Used for time domain handling. + */ +typedef struct kvTimeDomainData_s { + int nMagiSyncGroups; ///< number of MagiSync&tm; groups + int nMagiSyncedMembers; ///< number of MagiSync&tm; members + int nNonMagiSyncCards; ///< number of non MagiSync&tm; interfaces + int nNonMagiSyncedMembers; ///< number of non MagiSync&tm; members +} kvTimeDomainData; + +/** + * \ingroup TimeDomainHandling + * + * \source_cs static Canlib.canStatus kvTimeDomainCreate(out object domain); + * + * \source_delphi function kvTimeDomainCreate(var domain: kvTimeDomain): kvStatus; + * \source_end + * + * This routine creates an empty time domain. + * + * The variable is set by this function and then used in later calls to + * other functions using a \ref kvTimeDomain. + * + * Time domains created by \ref kvTimeDomainCreate() can be destroyed with a + * call to \ref kvTimeDomainDelete(). + * + * \note A time domain is a set of channels with a common time base. + * + * \param[out] domain A pointer to a caller allocated, opaque variable of type + * \ref kvTimeDomain that holds data to identify a particlar + * time domain. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvTimeDomainDelete() + */ +kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain); + +/** + * \ingroup TimeDomainHandling + * + * \source_cs static Canlib.canStatus kvTimeDomainDelete(object domain); + * + * \source_delphi function kvTimeDomainDelete(domain: kvTimeDomain): kvStatus; + * \source_end + * + * This is a cleanup routine that deletes all members of a domain and then + * deletes the domain itself. + * + * \note A time domain is a set of channels with a common time base. + * + * \param[in] domain An opaque variable set by \ref kvTimeDomainCreate() that + * identifies the domain to be deleted. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvTimeDomainCreate() + */ +kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain); + +/** + * \ingroup TimeDomainHandling + * + * \source_cs static Canlib.canStatus kvTimeDomainResetTime(object domain); + * + * \source_delphi function kvTimeDomainResetTime(domain: kvTimeDomain): kvStatus; + * \source_end + * + * This routine resets the time on all members of a time domain. + * + * After a call to this routine timestamps from all channels with MagiSync&tm; + * running have no offset at all any longer. The same applies for channels that + * reside on the same physical interface. + * + * \note A time domain is a set of channels with a common time base. + * + * \param[in] domain An opaque variable set by \ref kvTimeDomainCreate() that + * identifies the domain to reset the time on. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvTimeDomainCreate() + */ +kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain); + +/** + * \ingroup TimeDomainHandling + * + * \source_cs static Canlib.canStatus kvTimeDomainGetData(object domain, Canlib.kvTimeDomainData data); + * + * \source_delphi function kvTimeDomainGetData(domain: kvTimeDomain; var data: kvTimeDomainData; bufsiz: Cardinal): kvStatus; + * \source_end + * + * This routine collects some data on a time domain. + * + * \note A time domain is a set of channels with a common time base. + * + * \param[in] domain An opaque variable set by \ref kvTimeDomainCreate() that + * identifies the domain to add a handle to. + * \param[out] data A pointer to a \ref kvTimeDomainData that is to be filled by + * the function. + * \param[in] bufsiz The size in bytes of the \ref kvTimeDomainData struct. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvTimeDomainCreate() + */ +kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain, + kvTimeDomainData *data, + size_t bufsiz); + +/** + * \ingroup TimeDomainHandling + * + * \source_cs static Canlib.canStatus kvTimeDomainAddHandle(object domain, int handle); + * + * \source_delphi function kvTimeDomainAddHandle(domain: kvTimeDomain; handle: canHandle): kvStatus; + * \source_end + * + * This routine adds an open channel handle to a domain. + * + * \note A time domain is a set of channels with a common time base. + * + * \param[in] domain An opaque variable set by \ref kvTimeDomainCreate() + * that identifies the domain to add a handle to. + * \param[in] hnd A handle to an open channel. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvTimeDomainCreate(), \ref kvTimeDomainRemoveHandle() + */ +kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain, + const CanHandle hnd); + +/** + * \ingroup TimeDomainHandling + * + * \source_cs static Canlib.canStatus kvTimeDomainRemoveHandle(object domain, int handle); + * + * \source_delphi function kvTimeDomainRemoveHandle(domain: kvTimeDomain; handle: canHandle): kvStatus; + * \source_end + * + * This routine removes an open channel handle from a domain. + * + * \note A time domain is a set of channels with a common time base. + * + * \param[in] domain An opaque variable set by \ref kvTimeDomainCreate() + * that identifies the domain to remove a handle from. + * \param[in] hnd A handle to an open channel. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvTimeDomainCreate(), \ref kvTimeDomainAddHandle() + */ +kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain, + const CanHandle hnd); + +/** + * \name kvCallback_t + * \anchor kvCallback_t + * \ref kvCallback_t is used by the function \ref kvSetNotifyCallback() + * + * The callback function is called with the following arguments: + * \li hnd - the handle of the CAN channel where the event happened. + * \li context - the context pointer you passed to \ref kvSetNotifyCallback(). + * \li notifyEvent - one of the \ref canNOTIFY_xxx notification codes. + * + * \note It is really the \ref canNOTIFY_xxx codes, and not the + * \ref canEVENT_xxx codes that the \ref canSetNotify() API is using. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] context Arbitrary user-defined context data which + * is passed to the callback function. + * \param[in] notifyEvent One or more of the \ref canEVENT_xxx flags. + * + */ +typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvSetNotifyCallback(int hnd, Canlib.kvCallbackDelegate callback, IntPtr context, uint notifyFlags); + * + * \source_delphi function kvSetNotifyCallback(handle: canHandle; callback: kvCallback_t; context: Pointer; notifyFlags: Cardinal): canStatus; + * \source_end + * + * The \ref kvSetNotifyCallback() function registers a callback function which is + * called when certain events occur. + * + * You can register at most one callback function per handle at any time. + * + * To remove the callback, call \ref kvSetNotifyCallback() with a \c NULL pointer in + * the callback argument. + * + * \note The callback function is called in the context of a high-priority + * thread created by CANLIB. You should take precaution not to do any time + * consuming tasks in the callback. You must also arrange the synchronization + * between the callback and your other threads yourself. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] callback A pointer to a callback function of type + * \ref kvCallback_t + * \param[in] context A pointer to arbitrary user-defined context data which + * is passed to the callback function. + * \param[in] notifyFlags One or more of the \ref canNOTIFY_xxx flags. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canSetNotify() + */ +kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd, + kvCallback_t callback, + void* context, + unsigned int notifyFlags); + +/** + * \name kvBUSTYPE_xxx + * \anchor kvBUSTYPE_xxx + * + * Bus types, returned by \ref kvGetSupportedInterfaceInfo(). + * @{ + */ +#define kvBUSTYPE_NONE 0 ///< Unkown bus type. +#define kvBUSTYPE_PCI 1 ///< Bus of type PCI. +#define kvBUSTYPE_PCMCIA 2 ///< Bus of type PCMCIA +#define kvBUSTYPE_USB 3 ///< Bus of type USB +#define kvBUSTYPE_WLAN 4 ///< Bus of type WLAN +#define kvBUSTYPE_PCI_EXPRESS 5 ///< Bus of type PCI Express +#define kvBUSTYPE_ISA 6 ///< Bus of type ISA +#define kvBUSTYPE_VIRTUAL 7 ///< Bus of type virtual +#define kvBUSTYPE_PC104_PLUS 8 ///< Bus of type PC104+ +#define kvBUSTYPE_LAN 9 ///< Bus of type LAN +/** @} */ + +/** + * \name kvBUSTYPE_GROUP_xxx + * \anchor kvBUSTYPE_GROUP_xxx + * + * Bus type group, returned when using \ref canCHANNELDATA_BUS_TYPE + * This is a grouping of the individual \ref kvBUSTYPE_xxx. + * @{ + */ +#define kvBUSTYPE_GROUP_VIRTUAL 1 ///< \ref kvBUSTYPE_VIRTUAL +#define kvBUSTYPE_GROUP_LOCAL 2 ///< \ref kvBUSTYPE_USB +#define kvBUSTYPE_GROUP_REMOTE 3 ///< \ref kvBUSTYPE_WLAN, \ref kvBUSTYPE_LAN +#define kvBUSTYPE_GROUP_INTERNAL 4 ///< \ref kvBUSTYPE_PCI, \ref kvBUSTYPE_PCMCIA, ... +/** @} */ + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvGetSupportedInterfaceInfo(int index, out string hwName, out int hwType, out int hwBusType); + * + * \source_delphi function kvGetSupportedInterfaceInfo(index: Integer; hwName: PChar; nameLen: Cardinal; var hwType: Integer; var hwBusType: Integer): kvStatus; + * \source_end + * + * The \ref kvGetSupportedInterfaceInfo function returns information about the + * different supported hardware types in the installed version of CANLIB. + * + * This function is used to enumerate all the supported hardware types in the + * installed version of CANLIB. It does not return a complete list of all + * supported devices, nor does it return a list of the presently installed + * hardware. The returned data indicates which device families are supported. + * + * For example, a returned set of data might be: + * \li \a hwType = \ref canHWTYPE_MEMORATOR_PRO + * \li \a hwBusType = \ref kvBUSTYPE_USB + * \li \a hwName = \c "Kvaser Memorator Professional" + * + * This means that + * \li the presently installed version of CANLIB supports members in the Kvaser + * Memorator Pro family (e.g. the HS/HS and the HS/LS), + * \li the members of the Kvaser Memorator Pro family are USB devices, + * \li the members of the Kvaser Memorator Pro family use the + * \ref canHWTYPE_MEMORATOR_PRO hardware type. + * + * The \ref kvGetSupportedInterfaceInfo() function is intended to help + * application designers build a bus-oriented display of the different + * installed and/or supported Kvaser devices in the computer. + * + * \param[in] index Use this parameter to enumerate the different supported + * hardware types. Start with index = 0, and then call + * \ref kvGetSupportedInterfaceInfo again() with index = + * 1,2,3,... until the function returns an error code. + * \param[out] hwName A pointer to a buffer that will receive the name of the + * hardware family, as a zero-terminated ASCII string. + * \param[in] nameLen The length of the hwName buffer. + * \param[out] hwType Pointer to a 32-bit integer that will receive the + * hardware type (one of the \ref canHWTYPE_xxx + * constants.) + * \param[out] hwBusType Pointer to a 32-bit integer that will receive the bus + * type (one of the \ref kvBUSTYPE_xxx constants.) + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canBusOn(), \ref canResetBus() + */ +kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index, + char *hwName, + size_t nameLen, + int *hwType, + int *hwBusType); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvReadDeviceCustomerData(int hnd, int userNumber, int itemNumber, byte[] data, int bufsize); + * + * \source_delphi function kvReadDeviceCustomerData(hnd: canHandle;userNumber, itemNumber: Integer; var data; bufsize: Cardinal): kvStatus; + * \source_end + * + * Reading customer data works with Kvaser Leaf (of all + * types), Kvaser USBcan Professional, Kvaser Memorator Professional, Kvaser Eagle and + * Kvaser Memorator Light. To write customer data use external tools. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] userNumber Assigned by Kvaser. + * \param[in] itemNumber Must be zero (reserved) + * \param[out] data A pointer to a buffer of up to 8 bytes where + * the result will be placed. + * \param[in] bufsiz The size of the buffer that data points at. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ +kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd, + int userNumber, + int itemNumber, + void *data, + size_t bufsiz); + +// +// +// APIs for t-script +// + +/** + * \ingroup tScript + * \name kvENVVAR_TYPE_xxx + * \anchor kvENVVAR_TYPE_xxx + * + * These defines are used in \ref kvScriptEnvvarOpen(). + * @{ + */ + /** + * This define is used in \ref kvScriptEnvvarOpen(). + * + * It defines the type of the envvar as \c int. + */ +#define kvENVVAR_TYPE_INT 1 + + /** + * This define is used in \ref kvScriptEnvvarOpen(). + * + * It defines the type of the envvar as \c float. + */ +#define kvENVVAR_TYPE_FLOAT 2 + + /** + * This define is used in \ref kvScriptEnvvarOpen(). + * + * It defines the type of the envvar as \c string. + */ +#define kvENVVAR_TYPE_STRING 3 + /** @} */ +/** + * \ingroup tScript + * \name kvEVENT_xxx + * \anchor kvEVENT_xxx + * + * These defines are used in \ref kvScriptSendEvent(). + * @{ + */ + + /** + * This define is used in \ref kvScriptSendEvent(). + * + * It defines an event of type "key pressed". + */ +#define kvEVENT_TYPE_KEY 1 + /** @} */ + /** + * \ingroup tScript + * + * A handle to a t-script envvar. + * Returned by the function \ref kvScriptEnvvarOpen(). + */ +typedef __int64 kvEnvHandle; + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptStart(int hnd, int slotNo); + * + * \source_delphi function kvScriptStart(const hnd: canHandle; slotNo: integer): kvStatus; + * \source_end + * + * The \ref kvScriptStart() function starts a loaded script. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] slotNo The slot with the loaded script we want to start. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptLoadFile(), \ref kvScriptStop() + */ +kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo); + +/** + * Script stop modes. Used by \ref kvScriptStop(). + * \anchor kvSCRIPT_STOP_xxx + * \name kvSCRIPT_STOP_xxx + * @{ + */ +#define kvSCRIPT_STOP_NORMAL 0 /**< Stop a running script */ +#define kvSCRIPT_STOP_FORCED -9 /**< Request termination of a hanged script */ +/** @} */ + + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptStop(int hnd, int slotNo, int mode); + * + * \source_delphi function kvScriptStop(const hnd: canHandle; slotNo: integer; mode: integer): kvStatus; + * \source_end + * + * The \ref kvScriptStop() function stops a started script. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] slotNo The slot with the loaded and running script we want to stop. + * \param[in] mode Stop mode of type \ref kvSCRIPT_STOP_xxx + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptLoadFile(), \ref kvScriptStart() + */ +kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptUnload(int hnd, int slotNo); + * + * \source_delphi function kvScriptUnload(const hnd: canHandle; slotNo: integer): kvStatus; + * \source_end + * + * The \ref kvScriptUnload() function unloads a stopped script. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] slotNo The slot with the loaded and stopped script we want to unload. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptLoadFile(), \ref kvScriptStop() + */ +kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptSendEvent(int hnd, int slotNo, int eventType, int eventNo, uint data); + * + * \source_delphi function kvScriptSendEvent(const hnd: canHandle; slotNo: integer; eventType: integer; eventNo: integer; data: Cardinal): kvStatus; + * \source_end + * + * The \ref kvScriptSendEvent() function sends an event of a type, and an event + * number and associated data to a script running in a specific slot. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] slotNo The slot where the script was loaded and is running. + * \param[in] eventType The event to send, of type \ref kvEVENT_xxx + * \param[in] eventNo The event's number. + * \param[in] data The event's data. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + */ +kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd, + int slotNo, + int eventType, + int eventNo, + unsigned int data); + +/** + * \ingroup tScript + * + * \source_cs static long kvScriptEnvvarOpen(int hnd, string envvarName, out int envvarType, out int envvarSize); + * + * \source_delphi function kvScriptEnvvarOpen(const hnd: canHandle; envvarName: PChar; var envvarType: Integer; var envvarSize: Integer): \ref kvEnvHandle; + * \source_end + * + * The \ref kvScriptEnvvarOpen() opens an existing envvar and returns a handle to it. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] envvarName The envvar's name; a pointer to a \c NULL terminated + * array of chars. + * \param[out] envvarType A pointer to a 32-bit integer that will receive the + * \ref kvENVVAR_TYPE_xxx type. + * \param[out] envvarSize A pointer to a 32-bit integer that will receive the + * size of the envvar in bytes. + * + * \return A \ref kvEnvHandle handle (positive) to an envvar if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptEnvvarClose() + */ +kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd, + char* envvarName, + int *envvarType, + int *envvarSize); // returns scriptHandle + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptEnvvarClose(long eHnd); + * + * \source_delphi function kvScriptEnvvarClose(const eHnd: kvEnvHandle): kvStatus; + * \source_end + * + * The \ref kvScriptEnvvarClose() function closes an open envvar. + * + * \param[in] eHnd An open handle to an envvar. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvScriptEnvvarOpen() + */ +kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptEnvvarSetInt(long eHnd, int val); + * + * \source_delphi function kvScriptEnvvarSetInt(const eHnd: kvEnvHandle; val: Integer): kvStatus; + * \source_end + * + * The \ref kvScriptEnvvarSetInt() sets the value of an \c int envvar. + * + * \param[in] eHnd An open handle to an envvar. + * \param[in] val The new value. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptEnvvarOpen(), \ref kvScriptEnvvarGetInt(), \ref kvScriptEnvvarSetFloat(), + * \ref kvScriptEnvvarSetData() + */ +kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptEnvvarGetInt(long eHnd, out int val); + * + * \source_delphi function kvScriptEnvvarGetInt(const eHnd: kvEnvHandle; var val: Integer): kvStatus; + * \source_end + * + * The \ref kvScriptEnvvarGetInt() function retrieves the value of an \c int envvar. + * + * \param[in] eHnd An open handle to an envvar. + * \param[out] val The current value. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptEnvvarOpen(), \ref kvScriptEnvvarSetInt(), \ref kvScriptEnvvarGetFloat(), + * \ref kvScriptEnvvarGetData() + * + */ +kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptEnvvarSetFloat(long eHnd, float val); + * + * \source_delphi function kvScriptEnvvarSetFloat(const eHnd: kvEnvHandle; val: Single): kvStatus; + * \source_end + * + * The \ref kvScriptEnvvarSetFloat() sets the value of a \c float envvar. + * + * \param[in] eHnd An open handle to an envvar. + * \param[in] val The new value. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptEnvvarOpen(), \ref kvScriptEnvvarGetFloat(), \ref kvScriptEnvvarSetInt(), + * \ref kvScriptEnvvarSetData() + */ +kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptEnvvarGetFloat(long eHnd, out float val); + * + * \source_delphi function kvScriptEnvvarGetFloat(const eHnd: kvEnvHandle; var val: Single): kvStatus; + * \source_end + * + * The \ref kvScriptEnvvarGetFloat() function retrieves the value of a \c float envvar. + * + * \param[in] eHnd An open handle to an envvar. + * \param[out] val A pointer to a \c float where the retrieved result should be + * stored. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptEnvvarOpen(), \ref kvScriptEnvvarSetFloat(), \ref kvScriptEnvvarGetInt(), + * \ref kvScriptEnvvarGetData() + */ +kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptEnvvarSetData(long eHnd, byte[] buf, int start_index, int data_len); + * + * \source_delphi function kvScriptEnvvarSetData(const eHnd: kvEnvHandle; var buf; start_index: Integer; data_len: Integer): kvStatus; + * \source_end + * + * The \ref kvScriptEnvvarSetData() function sets a range of data bytes in an envvar. + * + * \param[in] eHnd An open handle to an envvar. + * \param[in] buf A pointer to a data area with the new values. + * \param[in] start_index The start index of the envvar's data range that we + * want to update. + * \param[in] data_len The length in bytes of the envvar's data range that + * we want to update. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptEnvvarOpen(), \ref kvScriptEnvvarGetData(), \ref kvScriptEnvvarSetInt(), + * \ref kvScriptEnvvarSetFloat() + */ +kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd, + void *buf, + int start_index, + int data_len); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptEnvvarGetData(long eHnd, out byte[] buf, int start_index, int data_len); + * + * \source_delphi function kvScriptEnvvarGetData(const eHnd: kvEnvHandle; var buf; start_index: Integer; data_len: Integer): kvStatus; + * \source_end + * + * The \ref kvScriptEnvvarGetData() function retrieves a range of data bytes from an envvar. + * + * \param[in] eHnd An open handle to an envvar. + * \param[out] buf A pointer to a data area where the retrieved data + * range should be stored. + * \param[in] start_index The start index of the data range. + * \param[in] data_len The length in bytes of the data range. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptEnvvarOpen(), \ref kvScriptEnvvarSetData(), \ref kvScriptEnvvarGetInt(), + * \ref kvScriptEnvvarGetFloat() + */ +kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd, + void *buf, + int start_index, + int data_len); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptLoadFileOnDevice(int hnd, int slotNo, ref string localFile); + * + * \source_delphi function kvScriptLoadFileOnDevice(hnd: canHandle; slotNo: Integer; localFile: PChar): kvStatus; + * \source_end + * + * The \ref kvScriptLoadFileOnDevice() function loads a compiled script file (.txe) + * stored on the device (SD card) into a script slot on the device. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] slotNo The slot where to load the script. + * \param[in] localFile The script file name; a pointer to a \c NULL terminated + * array of chars. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptLoadFile(), \ref kvFileCopyToDevice(), \ref kvScriptStart(), + * \ref kvScriptStop() + */ +kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd, + int slotNo, + char *localFile); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptLoadFile(int hnd, int slotNo, ref string filePathOnPC); + * + * \source_delphi function kvScriptLoadFile(hnd: canHandle; slotNo: Integer; filePathOnPC: PChar): kvStatus; + * \source_end + * + * The \ref kvScriptLoadFile() function loads a compiled script file (.txe) stored + * on the host (PC) into a script slot on the device. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] slotNo The slot where to load the script. + * \param[in] filePathOnPC The script file name; a pointer to a \c NULL + * terminated array of chars. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref page_code_snippets_examples + * \sa \ref kvScriptLoadFileOnDevice(), \ref kvFileCopyToDevice(), \ref kvScriptStart(), + * \ref kvScriptStop() + */ +kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd, + int slotNo, + char *filePathOnPC); + + + + +/** + * \ingroup General + * \name kvSCRIPT_REQUEST_TEXT_xxx + * \anchor kvSCRIPT_REQUEST_TEXT_xxx + * + * These defines are used in \ref kvScriptRequestText() for printf message subscribe/unsubscribe. + * + * @{ + */ + +/** + * Cancel subscription of printf messages from script slots. + */ +#define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1 + +/** + * Subscribe to printf messages from script slots. + */ +#define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2 + +/** + * Select all script slots. + */ +#define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255 + +/** @} */ + + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptRequestText(int hnd, int slot, int request); + * + * \source_delphi function kvScriptRequestText(hnd: canHandle; slotNo: cardinal; request: cardinal): kvStatus; + * \source_end + * + * The \ref kvScriptRequestText() Sets up a printf subscription to a + * selected script slot. + * Read the printf messages with \ref kvScriptGetText(). + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] slot The slot to subscribe to. + * \param[in] request Subscription request i.e. \ref kvSCRIPT_REQUEST_TEXT_xxx. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd, + unsigned int slot, + unsigned int request); + + + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptGetText(int hnd, out int slot, out ulong time, out int flags, out string buf); + * + * \source_delphi function kvScriptGetText(hnd: canHandle; var slot: integer; var time: Cardinal; var flags: Cardinal; buf: PChar; bufsize: Cardinal): kvStatus; + * \source_end + * + * The \ref kvScriptGetText() Reads a printf from a subscribed script slot. + * Set up a subscription with \ref kvScriptRequestText(). + * + * \param[in] hnd An open handle to a CAN channel. + * \param[out] slot The slot where the printf originated. + * \param[out] time The printf timestamp. + * \param[out] flags Printf flags. A combination of \ref canSTAT_xxx flags. + * \param[out] buf Buffer to hold the printf string. + * \param[in] bufsize Size of the buffer. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd, + int *slot, + unsigned long *time, + unsigned int *flags, + char *buf, + size_t bufsize + ); + + + +/** + * Script status flag bits. Used by \ref kvScriptStatus(). + * \anchor kvSCRIPT_STATUS_xxx + * \name kvSCRIPT_STATUS_xxx + * @{ + */ +#define kvSCRIPT_STATUS_LOADED 1 /**< The slot is loaded with a script */ +#define kvSCRIPT_STATUS_RUNNING 2 /**< The slot is running a script. */ +/** @} */ + + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvScriptStatus(int hnd, int slot, out unsigned int status); + * \source_delphi function kvScriptStatus(hnd: canHandle; var slot: integer; var time: integer): kvStatus; + * \source_end + * + * The \ref kvScriptStatus() function reads the current status of a script slot. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] slot The slot which status we want. + * \param[out] status The script status, as \ref kvSCRIPT_STATUS_xxx flag bits + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ +kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd, + int slot, + unsigned int *status); + + + + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvFileCopyToDevice(int hnd, string hostFileName, string deviceFileName); + * + * \source_delphi function kvFileCopyToDevice(hnd: canHandle; hostFileName: PChar; deviceFileName: PChar): kvStatus; + * \source_end + * + * The \ref kvFileCopyToDevice() function copies an arbitrary file from the host to + * the device. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] hostFileName The host file name; a pointer to a \c NULL terminated + * array of chars. + * \param[in] deviceFileName The target device file name; a pointer to a \c NULL + * terminated array of chars. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvFileCopyFromDevice(), \ref kvFileDelete() + */ +kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd, + char *hostFileName, + char *deviceFileName); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvFileCopyFromDevice(int hnd, string deviceFileName, string hostFileName); + * + * \source_delphi function kvFileCopyFromDevice(hnd: canHandle; deviceFileName: PChar; hostFileName: PChar): kvStatus; + * \source_end + * + * The \ref kvFileCopyFromDevice() function copies an arbitrary file from the device + * to the host. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] deviceFileName The device file name; a pointer to a \c NULL + * terminated array of chars. + * \param[in] hostFileName The target host file name; a pointer to a \c NULL terminated + * array of chars. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvFileCopyToDevice() + */ +kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd, + char *deviceFileName, + char *hostFileName); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvFileDelete(int hnd, string deviceFileName); + * + * \source_delphi function kvFileDelete(hnd: canHandle; deviceFileName: PChar): kvStatus; + * \source_end + * + * The \ref kvFileDelete() function deletes a file on the device. + * + * \note Deleting system files is not recommended. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] deviceFileName The file on the device to delete; a pointer + * to a \c NULL terminated array of chars. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvFileCopyToDevice() + */ +kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvFileGetName(int hnd, int fileNo, out string name); + * + * \source_delphi function kvFileGetName(hnd: canHandle; fileNo: Integer; name: PChar; namelen: Integer): kvStatus; + * \source_end + * + * The \ref kvFileGetName() function returns the name of the file with + * number \a fileNo. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] fileNo The number of the file. + * \param[out] name A buffer that will contain the name of the + * file. The name is a zero-terminated ASCII string. + * \param[in] namelen The length, in bytes, of the \a name buffer. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvFileGetCount(), \ref kvFileGetSystemData() + */ +kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd, + int fileNo, + char *name, + int namelen); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvFileGetCount(int hnd, out int count); + * + * \source_delphi function kvFileGetCount(hnd: canHandle; var count: Integer): kvStatus; + * \source_end + * + * The \ref kvFileGetCount() function returns the number of files. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[out] count A pointer to a 32-bit integer that will receive + * the file count. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvFileGetName(), \ref kvFileGetSystemData() + */ +kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count); + +/** + * \ingroup tScript + * + * \source_cs static Canlib.canStatus kvFileGetSystemData(int hnd, int itemCode, out int result); + * + * \source_delphi function kvFileGetSystemData(hnd: canHandle; itemCode: Integer; var result: Integer): kvStatus; + * \source_end + * + * The \ref kvFileGetSystemData() function is used for reading disk parameters, + * e.g. size, max number of (user) files, etc. + * + * \note Not yet implemented + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] itemCode The item we want information on. + * \param[out] result A pointer to a 32-bit integer that will + * receive the result. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + */ +kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd, + int itemCode, + int *result); + +/** + * \ingroup General + * \anchor kvDEVICE_MODE_xxx + * \name kvDEVICE_MODE_xxx + * + * These defines are used in \ref kvDeviceSetMode() and \ref kvDeviceGetMode(). + * + * \note The mode is device specific, which means that not all modes are + * implemented in all products. + * + * @{ + */ + /** + * This define is used in \ref kvDeviceSetMode() and \ref kvDeviceGetMode(). + * + * Device is running or should be running in interface mode. + */ +#define kvDEVICE_MODE_INTERFACE 0x00 + /** + * This define is used in \ref kvDeviceSetMode() and \ref kvDeviceGetMode(). + * + * Device is running or should be running in logger mode. + */ +#define kvDEVICE_MODE_LOGGER 0x01 + /** @} */ + + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvDeviceSetMode(int hnd, int mode); + * + * \source_delphi function kvDeviceSetMode(hnd: canHandle; mode: Integer): kvStatus; + * \source_end + * + * The \ref kvDeviceSetMode() sets the mode. + * + * \note The mode is device specific, which means that not all modes are + * implemented in all products. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[in] mode One of the \ref kvDEVICE_MODE_xxx constants, + * defining which mode to use. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvDeviceGetMode() + */ +kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvDeviceGetMode(int hnd, out int result); + * + * \source_delphi function kvDeviceGetMode(hnd: canHandle; var mode: Integer): kvStatus; + * \source_end + * + * The \ref kvDeviceGetMode() reads the current device's specific mode. + * + * \note The mode is device specific, which means that not all modes are + * implemented in all products. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[out] result A pointer to a 32-bit integer that will receive the + * \ref kvDEVICE_MODE_xxx value. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvDeviceSetMode() + */ +kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result); + + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvPingRequest(int hnd, out uint requestTime); + * + * \source_delphi function kvPingRequest(hnd: canHandle; var requestTime: Cardinal): kvStatus; + * \source_end + * + * This function sends an active ping to a device. The ping time can later be + * retrieved using \ref kvPingGetLatest(). + * + * \param[in] hnd A handle to an open circuit. + * \param[out] requestTime Time of request in microseconds. Used for matching answer to request. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ +kvStatus CANLIBAPI kvPingRequest (const CanHandle hnd, + unsigned int *requestTime); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvPingGetLatest(int hnd, out uint requestTime, out uint pingTime); + * + * \source_delphi function kvPingGetLatest(hnd: canHandle; var requestTime: Cardinal; var pingTime: Cardinal): kvStatus; + * \source_end + * + * This retrieves the latest ping time issued by an earlier call to \ref kvPingRequest() + * + * \param[in] hnd A handle to an open circuit. + * \param[out] requestTime Time of request in microseconds. Used for matching answer to request. + * \param[out] pingTime Latest value of ping time in milliseconds. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + */ + kvStatus CANLIBAPI kvPingGetLatest (const CanHandle hnd, + unsigned int *requestTime, + unsigned int *pingTime); + + +/** + * \ingroup Internal + * \anchor Internal + * \name Unimplemented internal + * + * The following are not yet implemented. Do not use it. + * + * @{ + */ +// +// +// +#if defined(_CANEVT_H_) +canStatus CANLIBAPI canReadEvent (const CanHandle hnd, CanEvent *event); +#endif + +/** This function is not implemented, do not use it. */ +void CANLIBAPI canSetDebug(int d); +/** This function is not implemented, do not use it. */ +canStatus CANLIBAPI canSetNotifyEx (const CanHandle hnd, + HANDLE event, + unsigned int flags); +/** This function is not implemented, do not use it. */ +canStatus CANLIBAPI canSetTimer (const CanHandle hnd, + DWORD interval, + DWORD flags); +/** This is reserved for \ref canSetTimer() but not implemented, do not use it. */ +#define canTIMER_CYCLIC 0x01 +/** This is reserved for \ref canSetTimer() but not implemented, do not use it. */ +#define canTIMER_EXPENSIVE 0x02 +/** This function is not implemented, do not use it. */ +int CANLIBAPI canSplitHandle (CanHandle hnd, int channel); +/** This function is not implemented, do not use it. */ +int CANLIBAPI canOpenMultiple (DWORD bitmask, int flags); +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvReadTimer(int hnd, out int time); + * + * \source_delphi function kvReadTimer(handle: canHandle; var time: Cardinal): kvStatus; + * \source_end + * + * The \ref kvReadTimer reads the hardware clock on the specified device and returns + * the value. + * + * When the call to \ref kvReadTimer() returns, the time value is already + * obsolete. The time required for the device firmware, any intermediary buses + * (like USB,) and the operating system to return the time value is not + * defined. + * + * This call should be used instead of \ref canReadTimer() because it can return an + * error code if it fails. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[out] time A pointer to a 32-bit unsigned integer that will receive + * the time value. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref canReadTimer(), \ref kvReadTimer64() + */ +kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time); + +/** + * \ingroup General + * + * \source_cs static Canlib.canStatus kvReadTimer64(int hnd, out long time); + * + * \source_delphi function kvReadTimer64(handle: canHandle; var time: Int64): kvStatus; + * \source_end + * + * The \ref kvReadTimer64 reads the hardware clock on the specified device and + * returns the value. + * + * When the call to \ref kvReadTimer64() returns, the time value is already + * obsolete. The time required for the device firmware, any intermediary buses + * (like USB,) and the operating system to return the time value is not + * defined. + * + * This call should be used instead of \ref canReadTimer() because it can return an + * error code if it fails. + * + * \param[in] hnd An open handle to a CAN channel. + * \param[out] time A pointer to a 64-bit signed integer that will receive the + * time value. + * + * \return \ref canOK (zero) if success + * \return \ref canERR_xxx (negative) if failure + * + * \sa \ref kvReadTimer(), \ref canReadTimer() + */ +kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, KVINT64 *time); +/** @} */ +#endif + +#ifdef __cplusplus +} +#endif + +# include "obsolete.h" + +#ifdef KVASER_EYES_ONLY +canStatus CANLIBAPI lowLevelAccess (const CanHandle hnd, void * data, int size); +#endif + +#endif diff --git a/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canstat.h b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canstat.h new file mode 100644 index 00000000..6d8e05ef --- /dev/null +++ b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/canstat.h @@ -0,0 +1,497 @@ +/** + * \section LICENSE + * Copyright 1994-2013 by KVASER AB, SWEDEN + * + * WWW: http://www.kvaser.com + * + * This software is furnished under a license and may be used and copied + * only in accordance with the terms of such license. + * + * \section DESCRIPTION + * + * Definitions for the CANLIB API. + * + * \file canlib.h + * \author Kvaser AB + * + * \note MATLAB users on Windows: if you define WIN32_LEAN_AND_MEAN before + * including this file, you will see a lot less warnings. + * + * \defgroup General General + * \defgroup CAN CAN + * \defgroup ObjectBuffers Object buffers + * \win_start + * \defgroup TimeDomainHandling Time Domain Handling + * \defgroup NamedParameterSettings Named Parameter Settings + * \defgroup tScript t-script + * \win_end + */ +#ifndef _CANSTAT_H_ +#define _CANSTAT_H_ + +// +// Don't forget to update canGetErrorText in canlib.c if this is changed! +// + +/** + * \name canERR_xxx + * \anchor canERR_xxx + * + * Generally, a return code greater than or equal to zero means success. A + * value less than zero means failure. + * + * You should avoid testing for a specific error code unless it is explicitly + * stated in the documentation for the API in question that this specific error + * code is returned. Instead, check if the error code is less than zero. Use + * \ref canGetErrorText() to obtain an error message suitable for a message to the + * user, or for a line in an error log file. + */ +typedef enum { + /** + * Normal successful completion; The driver is just fine, and really + * believes it carried out your command to everyone's satisfaction. + */ + canOK = 0, + /** + * Error in one or more parameters; a parameter \ref canERR_xxx + * specified in the call was invalid, out of range, or so. This status code + * will also be returned when the call is not implemented. + */ + canERR_PARAM = -1, + /** + * There were no messages to read; A function tried to read a message, + * but there was no message to read. + */ + canERR_NOMSG = -2, + /** + * Specified device or channel not found. There is no hardware + * available that matches the given search criteria. For example, you may + * have specified \ref canOPEN_REQUIRE_EXTENDED but there's no controller + * capable of extended CAN. You may have specified a channel number that is + * out of the range for the hardware in question. You may have requested + * exclusive access to a channel, but the channel is already occupied. + */ + canERR_NOTFOUND = -3, + /** + * Out of memory; A memory allocation failed. + */ + canERR_NOMEM = -4, + /** + * No channels available; There is indeed hardware matching the + * criteria you specified, but there are no channels available, or the + * channel you specified is already occupied. + */ + canERR_NOCHANNELS = -5, + + canERR_INTERRUPTED = -6, ///< Interrupted by signals + /** + * Timeout occurred; A function waited for something to happen (for + * example, the arrival of a message), but that something didn't happen. + */ + canERR_TIMEOUT = -7, + /** + * The library is not initialized; The driver is not + * initialized. \ref canInitializeLibrary() was probably not called? + */ + canERR_NOTINITIALIZED = -8, + /** + * Out of handles; No handles are available inside canlib32. The + * application has too many handles open (i.e. has called \ref canOpenChannel() too + * many times, or there's a memory leak somewhere.) + * + * \note We are not talking about Windows handles here, it's CANLIB's own + * internal handles. + */ + canERR_NOHANDLES = -9, + /** + * Handle is invalid; The CANLIB handle you specified (if the API call + * includes a handle) is not valid. Ensure you are passing the handle and + * not, for example, a channel number. + */ + canERR_INVHANDLE = -10, + canERR_INIFILE = -11, ///< Error in the ini-file (16-bit only) + /** + * Driver type not supported; CAN driver mode is not supported by the + * present hardware. + */ + canERR_DRIVER = -12, + /** + * Transmit buffer overflow; The transmit queue was full, so the + * message was dropped. + */ + canERR_TXBUFOFL = -13, + canERR_RESERVED_1 = -14, ///< Reserved + /** + * A hardware error has occurred; Something probably related to the + * hardware happened. This could mean that the device does not respond (IRQ + * or address conflict?), or that the response was invalid or unexpected + * (faulty card?). + */ + canERR_HARDWARE = -15, + /** + * A driver DLL can't be found or loaded; (One of) the DLL(s) + * specified in the registry failed to load. This could be a driver + * installation problem. + */ + canERR_DYNALOAD = -16, + /** + * A DLL seems to have wrong version; DLL version mismatch. (One of) + * the DLL(s) specified in the registry is - probably - too old, or - less + * likely - too new. + */ + canERR_DYNALIB = -17, + /** + * Error when initializing a DLL; Something failed when a device + * driver was being initialized. In other words, we can open the driver but + * it makes a lot of fuss about something we don't understand. + */ + canERR_DYNAINIT = -18, + canERR_NOT_SUPPORTED = -19, ///< Operation not supported by hardware or firmware + canERR_RESERVED_5 = -20, ///< Reserved + canERR_RESERVED_6 = -21, ///< Reserved + canERR_RESERVED_2 = -22, ///< Reserved + /** + * Can't find or load kernel driver; A device driver (kernel mode + * driver for NT, VxD for W95/98) failed to load; or the DLL could not open + * the device. Privileges? Driver file missing? + */ + canERR_DRIVERLOAD = -23, + /** + * DeviceIOControl failed; Use Win32 GetLastError() to learn what + * really happened. + */ + canERR_DRIVERFAILED = -24, + canERR_NOCONFIGMGR = -25, ///< Can't find req'd config s/w (e.g. CS/SS) + canERR_NOCARD = -26, ///< The card was removed or not inserted + canERR_RESERVED_7 = -27, ///< Reserved + /** + * Error (missing data) in the Registry; A registry key is missing, + * invalid, malformed, has gone for lunch or what not. can_verify.exe might + * provide some insight. + */ + canERR_REGISTRY = -28, + canERR_LICENSE = -29, ///< The license is not valid. + /** + * Internal error in the driver; Indicates an error condition in the + * driver or DLL, which couldn't be properly handled. Please contact the + * friendly support at support@kvaser.com. + */ + canERR_INTERNAL = -30, + /** + * Access denied; This means that you tried to set the bit rate on a + * handle to which you haven't got init access or you tried to open a channel + * that already is open with init access. See \ref canOpenChannel() for more + * information about init access. + */ + canERR_NO_ACCESS = -31, + /** + * Not implemented; The requested feature or function is not + * implemented in the device you are trying to use it on. + */ + canERR_NOT_IMPLEMENTED = -32, + /** + * Device File error; An error has occured when trying to access a + * file on the device. + */ + canERR_DEVICE_FILE = -33, + /** + * Host File error; An error has occured when trying to access a file on the host. + * + */ + canERR_HOST_FILE = -34, + /** + * Disk error; A disk error has occurred. Verify that the disk is + * initialized. + */ + canERR_DISK = -35, + /** + * CRC error; The CRC calculation did not match the expected result. + */ + canERR_CRC = -36, + /** + * Configuration Error; The configuration is corrupt. + */ + canERR_CONFIG = -37, + /** + * Memo Error; Other configuration error. + */ + canERR_MEMO_FAIL = -38, + /** + * Script Fail; A script has failed. + * + * \note This code represents several different failures, for example: + * - Trying to load a corrupt file or not a .txe file + * - Trying to start a t script that has not been loaded + * - Trying to load a t script compiled with the wrong version of the t compiler + * - Trying to unload a t script that has not been stopped + * - Trying to use an envvar that does not exist + */ + canERR_SCRIPT_FAIL = -39, + + /** + * The t script version dosen't match the version(s) that the device firmware supports.; + */ + canERR_SCRIPT_WRONG_VERSION = -40, + + + // The last entry - a dummy so we know where NOT to place a comma. + canERR__RESERVED = -41 ///< Reserved +} canStatus; + + +/** + * \name Convenience + * @{ + */ +#define CANSTATUS_SUCCESS(X) ((X) == canOK) +#define CANSTATUS_FAILURE(X) ((X) != canOK) +/** @} */ + +/** + * \name canEVENT_xxx WM__CANLIB notification codes + * \anchor canEVENT_xxx + * Appears in the notification \c WM__CANLIB message. + * @{ + */ +#define canEVENT_RX 32000 ///< when the queue of received CAN messages goes from empty to non-empty +#define canEVENT_TX 32001 ///< when a CAN message has been transmitted +#define canEVENT_ERROR 32002 ///< when a CAN bus error is reported by the CAN controller +#define canEVENT_STATUS 32003 ///< when the CAN controller changes state +#define canEVENT_ENVVAR 32004 ///< An envvar changed +# define canEVENT_BUSONOFF 32005 ///< Bus on/off status changed +# define canEVENT_REMOVED 32006 ///< Device removed +/** @} */ + +/** + * \name canNOTIFY_xxx + * \anchor canNOTIFY_xxx + * + * These are notification codes used in calls to \ref canSetNotify() and \ref kvSetNotifyCallback(). + * + * This can be \ref canNOTIFY_NONE (zero), meaning that no event notification is to + * occur, or a combination of any of the following constants + * + * @{ + */ +#define canNOTIFY_NONE 0 ///< Turn notifications off. +#define canNOTIFY_RX 0x0001 ///< CAN message reception notification +#define canNOTIFY_TX 0x0002 ///< CAN message transmission notification +#define canNOTIFY_ERROR 0x0004 ///< CAN bus error notification +#define canNOTIFY_STATUS 0x0008 ///< CAN chip status change +#define canNOTIFY_ENVVAR 0x0010 ///< An environment variable was changed by a script +# define canNOTIFY_BUSONOFF 0x0020 ///< Notify on bus on/off status changed +# define canNOTIFY_REMOVED 0x0040 ///< Notify on device removed +/** @} */ + + +/** + * \ingroup InformationServices + * \name canSTAT_xxx + * \anchor canSTAT_xxx + * + * The following circuit status flags are returned by \ref canReadStatus(). Note + * that more than one flag might be set at any one time. + * + * \note Usually both \ref canSTAT_HW_OVERRUN and \ref canSTAT_SW_OVERRUN are set + * when overrun has occurred. This is because the kernel driver can't see the + * difference between a software overrun and a hardware overrun. So the code + * should always test for both types of overrun using the \ref canSTAT_OVERRUN + * "flag". + * + * @{ + */ +#define canSTAT_ERROR_PASSIVE 0x00000001 ///< The circuit is error passive +#define canSTAT_BUS_OFF 0x00000002 ///< The circuit is Off Bus +#define canSTAT_ERROR_WARNING 0x00000004 ///< At least one error counter > 96 +#define canSTAT_ERROR_ACTIVE 0x00000008 ///< The circuit is error active. +#define canSTAT_TX_PENDING 0x00000010 ///< There are messages pending transmission +#define canSTAT_RX_PENDING 0x00000020 ///< There are messages in the receive buffer +#define canSTAT_RESERVED_1 0x00000040 +#define canSTAT_TXERR 0x00000080 ///< There has been at least one TX error +#define canSTAT_RXERR 0x00000100 ///< There has been at least one RX error of some sort +#define canSTAT_HW_OVERRUN 0x00000200 ///< The has been at least one HW buffer overflow +#define canSTAT_SW_OVERRUN 0x00000400 ///< The has been at least one SW buffer overflow +#define canSTAT_OVERRUN (canSTAT_HW_OVERRUN | canSTAT_SW_OVERRUN) ///< For convenience. +/** @} */ + +/** + * \name Message information flags, < 0x100 + * \anchor canMSG_xxx + * + * The following flags can be returned from \ref canRead() et al, or passed to + * \ref canWrite(). + * + * All flags and/or combinations of them are meaningful for received messages. + * + * \ref canMSG_RTR, \ref canMSG_STD, \ref canMSG_EXT, \ref canMSG_WAKEUP and + * \ref canMSG_ERROR_FRAME are meaningful also for transmitted messages. + * \ref canMSG_SINGLE_SHOT is only for transmission. + * + * Note that \ref canMSG_RTR cannot be set for CAN FD messages. + * + * @{ + */ +#define canMSG_MASK 0x00ff ///< Used to mask the non-info bits +#define canMSG_RTR 0x0001 ///< Message is a remote request +#define canMSG_STD 0x0002 ///< Message has a standard ID +#define canMSG_EXT 0x0004 ///< Message has an extended ID +#define canMSG_WAKEUP 0x0008 ///< Message to be sent / was received in wakeup mode + +/** + * NERR was active during the message + * + * The NERR flag is set by the CAN transceiver when certain CAN bus wire faults + * occur, namely: + * \li CANH wire interrupted + * \li CANL wire interrupted + * \li CANH short-circuited to battery + * \li CANH short-circuited to VCC + * \li CANL short-circuited to ground + * \li CANH short-circuited to ground + * \li CANL short-circuited to battery + * \li CANL short-circuited to VCC + * \li CANL and CANH mutually short-circuited + * + * See the TJA1054 data sheet (available from Philips) for more detailed + * information. + */ +#define canMSG_NERR 0x0010 +#define canMSG_ERROR_FRAME 0x0020 ///< Message is an error frame +#define canMSG_TXACK 0x0040 ///< Message is a TX ACK (msg is really sent) +#define canMSG_TXRQ 0x0080 ///< Message is a TX REQUEST (msg is transfered to the chip) +#define canMSG_DELAY_MSG 0x0100 ///< Message is NOT sent on the bus. The transmission of messages are delayed. The dlc specifies the delay in milliseconds (1..1000). + +// single shot flags: +#define canMSG_SINGLE_SHOT 0x1000000 ///< Message is Single Shot, try to send once, no retransmission. This flag can only be used with transmitted messages. +#define canMSG_TXNACK 0x2000000 ///< Message is a failed Single Shot, message was not sent. This flag is only used with received messages. +#define canMSG_ABL 0x4000000 ///< Only together with canMSG_TXNACK, Single shot message was not sent because arbitration was lost. This flag is only used with received messages. + + +/** + * \name canFDMSG_xxx + * \anchor canFDMSG_xxx + * + * Flags used in the CAN FD protocol. Set \ref canOPEN_CAN_FD in \ref + * canOpenChannel() to enable the CAN FD protocol. + * + * @{ + */ +#define canFDMSG_MASK 0xff0000 +#define canFDMSG_EDL 0x010000 ///< Obsolete, use \ref canFDMSG_FDF instead +#define canFDMSG_FDF 0x010000 ///< Message is an FD message (CAN FD) +#define canFDMSG_BRS 0x020000 ///< Message is sent/received with bit rate switch (CAN FD) +#define canFDMSG_ESI 0x040000 ///< Sender of the message is in error passive mode (CAN FD) +/** @} */ + +/** @} */ + +/** + * \name Message error flags + * \anchor canMSGERR_xxx + * + * \note Not all hardware platforms can detect the difference between hardware + * overruns and software overruns, so your application should test for both + * conditions. You can use the symbol \ref canMSGERR_OVERRUN for this purpose. + * + * @{ + */ +#define canMSGERR_MASK 0xff00 ///< Used to mask the non-error bits +// 0x0100 reserved +#define canMSGERR_HW_OVERRUN 0x0200 ///< HW buffer overrun +#define canMSGERR_SW_OVERRUN 0x0400 ///< SW buffer overrun +#define canMSGERR_STUFF 0x0800 ///< Stuff error +#define canMSGERR_FORM 0x1000 ///< Form error +#define canMSGERR_CRC 0x2000 ///< CRC error +#define canMSGERR_BIT0 0x4000 ///< Sent dom, read rec +#define canMSGERR_BIT1 0x8000 ///< Sent rec, read dom + +// Convenience values for the message error flags. +#define canMSGERR_OVERRUN 0x0600 ///< Any overrun condition. +#define canMSGERR_BIT 0xC000 ///< Any bit error. +#define canMSGERR_BUSERR 0xF800 ///< Any RX error + +/** @} */ + +/** + * \name canTRANSCEIVER_LINEMODE_xxx + * \anchor canTRANSCEIVER_LINEMODE_xxx + * + * The following values can be used \win_start with \ref canSetDriverMode() \win_end to set different + * driver (i.e. transceiver) modes. \win_start Use \ref canGetDriverMode() to obtain the + * current driver mode for a particular CAN channel. \win_end + * + * \linux_start + * Not implemented in Linux. + * \linux_end + * @{ + */ +#define canTRANSCEIVER_LINEMODE_NA 0 ///< Not Affected/Not available. +#define canTRANSCEIVER_LINEMODE_SWC_SLEEP 4 ///< SWC Sleep Mode. +#define canTRANSCEIVER_LINEMODE_SWC_NORMAL 5 ///< SWC Normal Mode. +#define canTRANSCEIVER_LINEMODE_SWC_FAST 6 ///< SWC High-Speed Mode. +#define canTRANSCEIVER_LINEMODE_SWC_WAKEUP 7 ///< SWC Wakeup Mode. +#define canTRANSCEIVER_LINEMODE_SLEEP 8 ///< Sleep mode for those supporting it. +#define canTRANSCEIVER_LINEMODE_NORMAL 9 ///< Normal mode (the inverse of sleep mode) for those supporting it. +#define canTRANSCEIVER_LINEMODE_STDBY 10 ///< Standby for those who support it +#define canTRANSCEIVER_LINEMODE_TT_CAN_H 11 ///< Truck & Trailer: operating mode single wire using CAN high +#define canTRANSCEIVER_LINEMODE_TT_CAN_L 12 ///< Truck & Trailer: operating mode single wire using CAN low +#define canTRANSCEIVER_LINEMODE_OEM1 13 ///< Reserved for OEM apps +#define canTRANSCEIVER_LINEMODE_OEM2 14 ///< Reserved for OEM apps +#define canTRANSCEIVER_LINEMODE_OEM3 15 ///< Reserved for OEM apps +#define canTRANSCEIVER_LINEMODE_OEM4 16 ///< Reserved for OEM apps + +/** @} */ + +/** + * \anchor canTRANSCEIVER_RESNET_xxx + * + */ +#define canTRANSCEIVER_RESNET_NA 0 +#define canTRANSCEIVER_RESNET_MASTER 1 +#define canTRANSCEIVER_RESNET_MASTER_STBY 2 +#define canTRANSCEIVER_RESNET_SLAVE 3 + +/** + * \name Transceiver (logical) types + * \anchor canTRANSCEIVER_TYPE_xxx + * + * The following constants can be returned from \ref canGetChannelData(), using the + * \ref canCHANNELDATA_TRANS_TYPE item code. They identify the bus transceiver + * type for the channel specified in the call to \ref canGetChannelData. + * + * \note They indicate a hardware type, but not necessarily a specific circuit + * or product. + * + * @{ + */ +// Also see src\include\hwnames.h and registered document 048. +#define canTRANSCEIVER_TYPE_UNKNOWN 0 ///< Unknown or undefined +#define canTRANSCEIVER_TYPE_251 1 ///< 82c251 +#define canTRANSCEIVER_TYPE_252 2 ///< 82c252, TJA1053, TJA1054 +#define canTRANSCEIVER_TYPE_DNOPTO 3 ///< Optoisolated 82C251 +#define canTRANSCEIVER_TYPE_W210 4 ///< +#define canTRANSCEIVER_TYPE_SWC_PROTO 5 ///< AU5790 prototype +#define canTRANSCEIVER_TYPE_SWC 6 ///< AU5790 +#define canTRANSCEIVER_TYPE_EVA 7 ///< +#define canTRANSCEIVER_TYPE_FIBER 8 ///< 82c251 with fibre extension +#define canTRANSCEIVER_TYPE_K251 9 ///< K-line + 82c251 +#define canTRANSCEIVER_TYPE_K 10 ///< K-line, without CAN +#define canTRANSCEIVER_TYPE_1054_OPTO 11 ///< TJA1054 with optical isolation +#define canTRANSCEIVER_TYPE_SWC_OPTO 12 ///< AU5790 with optical isolation +#define canTRANSCEIVER_TYPE_TT 13 ///< B10011S Truck-And-Trailer +#define canTRANSCEIVER_TYPE_1050 14 ///< TJA1050 +#define canTRANSCEIVER_TYPE_1050_OPTO 15 ///< TJA1050 with optical isolation +#define canTRANSCEIVER_TYPE_1041 16 ///< TJA1041 +#define canTRANSCEIVER_TYPE_1041_OPTO 17 ///< TJA1041 with optical isolation +#define canTRANSCEIVER_TYPE_RS485 18 ///< RS485 (i.e. J1708) +#define canTRANSCEIVER_TYPE_LIN 19 ///< LIN +#define canTRANSCEIVER_TYPE_KONE 20 ///< KONE +#define canTRANSCEIVER_TYPE_CANFD 22 ///< CAN-FD +#define canTRANSCEIVER_TYPE_LINX_LIN 64 +#define canTRANSCEIVER_TYPE_LINX_J1708 66 +#define canTRANSCEIVER_TYPE_LINX_K 68 +#define canTRANSCEIVER_TYPE_LINX_SWC 70 +#define canTRANSCEIVER_TYPE_LINX_LS 72 +/** @} */ + +#endif diff --git a/Host/Source/LibOpenBLT/port/windows/canif/kvaser/leaflight.c b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/leaflight.c index 26455d8c..999b4616 100644 --- a/Host/Source/LibOpenBLT/port/windows/canif/kvaser/leaflight.c +++ b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/leaflight.c @@ -38,6 +38,30 @@ #include "candriver.h" /* Generic CAN driver module */ #include "leaflight.h" /* Kvaser Leaf Light v2 interface */ #include /* for Windows API */ +/*lint -efile(537, pshpack1.h, poppack.h) */ +/*lint -efile(451, pshpack1.h, poppack.h) */ +#include "canlib.h" /* for Kvaser CANLIB API */ + + +/*************************************************************************************** +* Type definitions +****************************************************************************************/ +/* Type definitions of the function in the Kvaser CANLIB API that this CAN interface + * uses. + */ +typedef void (__stdcall * tLeafLightLibFuncInitializeLibrary)(void); +typedef canStatus (__stdcall * tLeafLightLibFuncUnloadLibrary)(void); +typedef CanHandle (__stdcall * tLeafLightLibFuncOpenChannel)(int32_t channel, int32_t flags); +typedef canStatus (__stdcall * tLeafLightLibFuncSetBusParams)(const CanHandle hnd, int32_t freq, uint32_t tseg1, uint32_t tseg2, uint32_t sjw, uint32_t noSamp, uint32_t syncmode); +typedef canStatus (__stdcall * tLeafLightLibFuncSetBusOutputControl)(const CanHandle hnd, const uint32_t drivertype); +typedef canStatus (__stdcall * tLeafLightLibFuncSetAcceptanceFilter)(const CanHandle hnd, uint32_t code, uint32_t mask, int32_t is_extended); +typedef canStatus (__stdcall * tLeafLightLibFuncIoCtl)(const CanHandle hnd, uint32_t func, void * buf, uint32_t buflen); +typedef canStatus (__stdcall * tLeafLightLibFuncBusOn)(const CanHandle hnd); +typedef canStatus (__stdcall * tLeafLightLibFuncWrite)(const CanHandle hnd, int32_t id, void * msg, uint32_t dlc, uint32_t flag); +typedef canStatus (__stdcall * tLeafLightLibFuncRead)(const CanHandle hnd, int32_t * id, void * msg, uint32_t * dlc, uint32_t * flag, uint32_t * time); +typedef canStatus (__stdcall * tLeafLightLibFuncReadStatus)(const CanHandle hnd, uint32_t * const flags); +typedef canStatus (__stdcall * tLeafLightLibFuncBusOff)(const CanHandle hnd); +typedef canStatus (__stdcall * tLeafLightLibFuncClose)(const CanHandle hnd); /*************************************************************************************** @@ -51,6 +75,32 @@ static void LeafLightDisconnect(void); static bool LeafLightTransmit(tCanMsg const * msg); static bool LeafLightIsBusError(void); static void LeafLightRegisterEvents(tCanEvents const * events); +/* CAN message reception thread. */ +static DWORD WINAPI LeafLightReceptionThread(LPVOID pv); +/* Kvaser CANLIB library handling. */ +static void LeafLightLibLoadDll(void); +static void LeafLightLibUnloadDll(void); +static void LeafLightLibFuncInitializeLibrary(void); +static canStatus LeafLightLibFuncUnloadLibrary(void); +static CanHandle LeafLightLibFuncOpenChannel(int32_t channel, int32_t flags); +static canStatus LeafLightLibFuncSetBusParams(const CanHandle hnd, int32_t freq, + uint32_t tseg1, uint32_t tseg2, + uint32_t sjw, uint32_t noSamp, + uint32_t syncmode); +static canStatus LeafLightLibFuncSetBusOutputControl(const CanHandle hnd, + const uint32_t drivertype); +static canStatus LeafLightLibFuncSetAcceptanceFilter(const CanHandle hnd, uint32_t code, + uint32_t mask, int32_t is_extended); +static canStatus LeafLightLibFuncIoCtl(const CanHandle hnd, uint32_t func, void * buf, + uint32_t buflen); +static canStatus LeafLightLibFuncBusOn(const CanHandle hnd); +static canStatus LeafLightLibFuncWrite(const CanHandle hnd, int32_t id, void * msg, + uint32_t dlc, uint32_t flag); +static canStatus LeafLightLibFuncRead(const CanHandle hnd, int32_t * id, void * msg, + uint32_t * dlc, uint32_t * flag, uint32_t * time); +static canStatus LeafLightLibFuncReadStatus(const CanHandle hnd, uint32_t * const flags); +static canStatus LeafLightLibFuncBusOff(const CanHandle hnd); +static canStatus LeafLightLibFuncClose(const CanHandle hnd); /**************************************************************************************** @@ -81,6 +131,60 @@ static tCanEvents * leafLightEventsList; /** \brief Total number of event entries into the \ref leafLightEventsList list. */ static uint32_t leafLightEventsEntries; +/** \brief Handle to the Kvaser CANLIB dynamic link library. */ +static HINSTANCE leafLightDllHandle; + +/** \brief Handle to the CAN channel. */ +static CanHandle leafLightCanHandle; + +/** \brief Function pointer to the Kvaser CANLIB canInitializeLibrary function. */ +static tLeafLightLibFuncInitializeLibrary leafLightLibFuncInitializeLibraryPtr; + +/** \brief Function pointer to the Kvaser CANLIB canUnloadLibrary function. */ +static tLeafLightLibFuncUnloadLibrary leafLightLibFuncUnloadLibraryPtr; + +/** \brief Function pointer to the Kvaser CANLIB canOpenChannel function. */ +static tLeafLightLibFuncOpenChannel leafLightLibFuncOpenChannelPtr; + +/** \brief Function pointer to the Kvaser CANLIB canSetBusParams function. */ +static tLeafLightLibFuncSetBusParams leafLightLibFuncSetBusParamsPtr; + +/** \brief Function pointer to the Kvaser CANLIB canSetBusOutputControl function. */ +static tLeafLightLibFuncSetBusOutputControl leafLightLibFuncSetBusOutputControlPtr; + +/** \brief Function pointer to the Kvaser CANLIB canSetAcceptanceFilter function. */ +static tLeafLightLibFuncSetAcceptanceFilter leafLightLibFuncSetAcceptanceFilterPtr; + +/** \brief Function pointer to the Kvaser CANLIB canIoCtl function. */ +static tLeafLightLibFuncIoCtl leafLightLibFuncIoCtlPtr; + +/** \brief Function pointer to the Kvaser CANLIB canBusOn function. */ +static tLeafLightLibFuncBusOn leafLightLibFuncBusOnPtr; + +/** \brief Function pointer to the Kvaser CANLIB canWrite function. */ +static tLeafLightLibFuncWrite leafLightLibFuncWritePtr; + +/** \brief Function pointer to the Kvaser CANLIB canRead function. */ +static tLeafLightLibFuncRead leafLightLibFuncReadPtr; + +/** \brief Function pointer to the Kvaser CANLIB canReadStatus function. */ +static tLeafLightLibFuncReadStatus leafLightLibFuncReadStatusPtr; + +/** \brief Function pointer to the Kvaser CANLIB canBusOff function. */ +static tLeafLightLibFuncBusOff leafLightLibFuncBusOffPtr; + +/** \brief Function pointer to the Kvaser CANLIB canClose function. */ +static tLeafLightLibFuncClose leafLightLibFuncClosePtr; + +/** \brief Handle for the event to terminate the reception thread. */ +static HANDLE leafLightTerminateEvent; + +/** \brief Handle for a CAN related event. */ +static HANDLE leafLightCanEvent; + +/** \brief Handle for the CAN reception thread. */ +static HANDLE leafLightRxThreadHandle; + /***********************************************************************************//** ** \brief Obtains a pointer to the CAN interface structure, so that it can be linked @@ -106,6 +210,25 @@ static void LeafLightInit(tCanSettings const * settings) /* Initialize locals. */ leafLightEventsList = NULL; leafLightEventsEntries = 0; + leafLightTerminateEvent = NULL; + leafLightCanEvent = NULL; + leafLightRxThreadHandle = NULL; + leafLightDllHandle = NULL; + leafLightCanHandle = -1; + /* Reset library function pointers. */ + leafLightLibFuncInitializeLibraryPtr = NULL; + leafLightLibFuncUnloadLibraryPtr = NULL; + leafLightLibFuncOpenChannelPtr = NULL; + leafLightLibFuncSetBusParamsPtr = NULL; + leafLightLibFuncSetBusOutputControlPtr = NULL; + leafLightLibFuncSetAcceptanceFilterPtr = NULL; + leafLightLibFuncIoCtlPtr = NULL; + leafLightLibFuncBusOnPtr = NULL; + leafLightLibFuncWritePtr = NULL; + leafLightLibFuncReadPtr = NULL; + leafLightLibFuncReadStatusPtr = NULL; + leafLightLibFuncBusOffPtr = NULL; + leafLightLibFuncClosePtr = NULL; /* Reset CAN interface settings. */ leafLightSettings.devicename = ""; leafLightSettings.channel = 0; @@ -135,7 +258,9 @@ static void LeafLightInit(tCanSettings const * settings) leafLightSettings.devicename = canDeviceName; } } - /* ##Vg TODO Perform initialization of Kvaser Leaf Light API. */ + /* Perform initialization of Kvaser Leaf Light API. */ + LeafLightLibLoadDll(); + LeafLightLibFuncInitializeLibrary(); } } /*** end of LeafLightInit ***/ @@ -146,7 +271,9 @@ static void LeafLightInit(tCanSettings const * settings) ****************************************************************************************/ static void LeafLightTerminate(void) { - /* ##Vg TODO Perform termination of Kvaser Leaf Light API. */ + /* Perform termination of Kvaser Leaf Light API. */ + (void)LeafLightLibFuncUnloadLibrary(); + LeafLightLibUnloadDll(); /* Release memory that was allocated for storing the device name. */ if (leafLightSettings.devicename != NULL) { @@ -175,9 +302,214 @@ static void LeafLightTerminate(void) static bool LeafLightConnect(void) { bool result = false; + bool baudrateSupported = true; + int32_t frequency = 0; + uint32_t tseg1 = 0; + uint32_t tseg2 = 0; + uint32_t sjw = 0; + uint32_t noSamp = 0; - /* ##Vg TODO Process and verify settings, configure acceptance filter, connect. */ + /* Convert the baudrate to a value supported by the PCAN-Basic API. */ + switch (leafLightSettings.baudrate) + { + case CAN_BR10K: + frequency = canBITRATE_10K; + break; + case CAN_BR20K: + frequency = 20000; + tseg1 = 5; + tseg2 = 2; + sjw = 2; + noSamp = 1; + break; + case CAN_BR50K: + frequency = canBITRATE_50K; + break; + case CAN_BR100K: + frequency = canBITRATE_100K; + break; + case CAN_BR125K: + frequency = canBITRATE_125K; + break; + case CAN_BR250K: + frequency = canBITRATE_250K; + break; + case CAN_BR500K: + frequency = canBITRATE_500K; + break; + case CAN_BR800K: + frequency = 800000; + tseg1 = 6; + tseg2 = 3; + sjw = 2; + noSamp = 1; + break; + case CAN_BR1M: + frequency = canBITRATE_1M; + break; + default: + baudrateSupported = false; + break; + } + /* Note that the device name itself is not needed anymore at this point, it was only + * needed by the CAN driver to link the correct interface (this one). The channel is + * also don't care as the adapter only has one channel. Check settings. + */ + assert(baudrateSupported); + + /* Invalidate handles. */ + leafLightCanHandle = -1; + leafLightTerminateEvent = NULL; + leafLightCanEvent = NULL; + leafLightRxThreadHandle = NULL; + + /* Only continue with valid settings. */ + if (baudrateSupported) + { + /* Init result code to success and only negate it on detection of error. */ + result = true; + /* Open the CAN channel with support for both 11- and 29-bit CAN identifiers, and + * obtain its handle. + */ + leafLightCanHandle = LeafLightLibFuncOpenChannel(0, canOPEN_REQUIRE_INIT_ACCESS | + canOPEN_REQUIRE_EXTENDED); + /* Validate the handle. */ + if (leafLightCanHandle < 0) + { + result = false; + } + /* Configure the baudrate. */ + if (result) + { + if (LeafLightLibFuncSetBusParams(leafLightCanHandle, frequency, tseg1, tseg2, + sjw, noSamp, 0) != canOK) + { + result = false; + } + } + /* Set output control to the default normal mode. */ + if (result) + { + if (LeafLightLibFuncSetBusOutputControl(leafLightCanHandle, + canDRIVER_NORMAL) != canOK) + { + result = false; + } + } + /* Configure reception acceptance filter. */ + if ( (result) && (leafLightSettings.mask != 0x00000000u) ) + { + /* Start out by closing the acceptance filters first. */ + if (LeafLightLibFuncSetAcceptanceFilter(leafLightCanHandle, 0x00000000u, + 0x00000000u, 0) != canOK) + { + result = false; + } + if (result) + { + if (LeafLightLibFuncSetAcceptanceFilter(leafLightCanHandle, 0x00000000u, + 0x00000000u, 1) != canOK) + { + result = false; + } + } + if (result) + { + /* Use bit logic to determine if the filter should accept standard 11-bit and/or + * extended 29-bit identifiers: + * acceptStdId = ((mask & code & CAN_MSG_EXT_ID_MASK) == 0) + * acceptExtId = ((mask & code & CAN_MSG_EXT_ID_MASK) != 0) || + * ((mask & CAN_MSG_EXT_ID_MASK) == 0) + */ + bool acceptStdID = ((leafLightSettings.mask & leafLightSettings.code & CAN_MSG_EXT_ID_MASK) == 0); + bool acceptExtID = ((leafLightSettings.mask & leafLightSettings.code & CAN_MSG_EXT_ID_MASK) != 0) || + ((leafLightSettings.mask & CAN_MSG_EXT_ID_MASK) == 0); + /* Configure acceptance filter for standard 11-bit identifiers. */ + if (acceptStdID) + { + if (LeafLightLibFuncSetAcceptanceFilter(leafLightCanHandle, + leafLightSettings.code & 0x1fffffffu, + leafLightSettings.mask & 0x1fffffffu, + 0) != canOK) + { + result = false; + } + } + /* Configure acceptance filter for extended 29-bit identifiers. */ + if ((acceptExtID) && (result)) + { + if (LeafLightLibFuncSetAcceptanceFilter(leafLightCanHandle, + leafLightSettings.code & 0x1fffffffu, + leafLightSettings.mask & 0x1fffffffu, + 1) != canOK) + { + result = false; + } + } + } + } + /* Go on the bus. */ + if (result) + { + if (LeafLightLibFuncBusOn(leafLightCanHandle) != canOK) + { + result = false; + } + } + /* Obtain the handle for CAN events. */ + if (result) + { + leafLightCanEvent = NULL; + if (LeafLightLibFuncIoCtl(leafLightCanHandle, canIOCTL_GET_EVENTHANDLE, + &leafLightCanEvent, sizeof(leafLightCanEvent)) != canOK) + { + result = false; + } + /* Validate the handle. */ + if (leafLightCanEvent == NULL) + { + result = false; + } + } + /* Create the terminate event handle used in the reception thread. */ + if (result) + { + leafLightTerminateEvent = CreateEvent(NULL, TRUE, FALSE, ""); + if (leafLightTerminateEvent == NULL) + { + result = false; + } + } + /* Start the reception thread as the last step. */ + if (result) + { + leafLightRxThreadHandle = CreateThread(NULL, 0, LeafLightReceptionThread, + NULL, 0, NULL); + if (leafLightRxThreadHandle == NULL) + { + result = false; + } + } + } + + /* Clean-up in case an error occurred. */ + if (!result) + { + if (leafLightCanHandle >= 0) + { + /* Go off the bus and close the channel. */ + (void)LeafLightLibFuncBusOff(leafLightCanHandle); + (void)LeafLightLibFuncClose(leafLightCanHandle); + leafLightCanHandle = -1; + } + if (leafLightTerminateEvent != NULL) + { + /* Close the event handle. */ + (void)CloseHandle(leafLightTerminateEvent); + leafLightTerminateEvent = NULL; + } + } /* Give the result back to the caller. */ return result; } /*** end of LeafLightConnect ***/ @@ -189,7 +521,30 @@ static bool LeafLightConnect(void) ****************************************************************************************/ static void LeafLightDisconnect(void) { - /* ##Vg TODO Disconnect. */ + /* Stop the reception thread. */ + if (leafLightRxThreadHandle != NULL) + { + /* Trigger event to request the reception thread to stop. */ + (void)SetEvent(leafLightTerminateEvent); + /* Wait for the thread to signal termination. */ + (void)WaitForSingleObject(leafLightRxThreadHandle, INFINITE); + /* Close the thread handle. */ + (void)CloseHandle(leafLightRxThreadHandle); + leafLightRxThreadHandle = NULL; + } + /* Close the terminate event handle. */ + if (leafLightTerminateEvent != NULL) + { + (void)CloseHandle(leafLightTerminateEvent); + leafLightTerminateEvent = NULL; + } + /* Go off the bus and close the channel. */ + if (leafLightCanHandle >= 0) + { + (void)LeafLightLibFuncBusOff(leafLightCanHandle); + (void)LeafLightLibFuncClose(leafLightCanHandle); + leafLightCanHandle = -1; + } } /*** end of LeafLightDisconnect ***/ @@ -202,14 +557,52 @@ static void LeafLightDisconnect(void) static bool LeafLightTransmit(tCanMsg const * msg) { bool result = false; + tCanEvents const * pEvents; + int32_t txId; + uint32_t txFlags; + uint8_t txData[CAN_MSG_MAX_LEN]; /* Check parameters. */ assert(msg != NULL); - /* Only continue with valid parameters. */ - if (msg != NULL) /*lint !e774 */ + /* Only continue with valid parameters and handle. */ + if ( (msg != NULL) && (leafLightCanHandle >= 0) ) /*lint !e774 */ { - /* ##Vg TODO Transmit and trigger event(s). */ + /* Prepare message. */ + if ((msg->id & CAN_MSG_EXT_ID_MASK) == 0) + { + txId = msg->id & 0x7ffu; + txFlags = canMSG_STD; + } + else + { + txId = msg->id & 0x1fffffffu; + txFlags = canMSG_EXT; + } + for (uint8_t idx = 0; idx < msg->dlc; idx++) + { + txData[idx] = msg->data[idx]; + } + /* Submit CAN message for transmission. */ + if (LeafLightLibFuncWrite(leafLightCanHandle, txId, txData, msg->dlc, txFlags) == canOK) + { + /* Update result value to success. */ + result = true; + /* Trigger transmit complete event(s). */ + pEvents = leafLightEventsList; + for (uint32_t idx = 0; idx < leafLightEventsEntries; idx++) + { + if (pEvents != NULL) + { + if (pEvents->MsgTxed != NULL) + { + pEvents->MsgTxed(msg); + } + /* Move on to the next entry in the list. */ + pEvents++; + } + } + } } /* Give the result back to the caller. */ return result; @@ -224,9 +617,21 @@ static bool LeafLightTransmit(tCanMsg const * msg) static bool LeafLightIsBusError(void) { bool result = false; + uint32_t statusFlags; - /* ##Vg TODO Check and process status. */ - + /* Only continue with valid handle. */ + if (leafLightCanHandle >= 0) + { + /* Read the status flags. */ + if (LeafLightLibFuncReadStatus(leafLightCanHandle, &statusFlags) == canOK) + { + /* Check for bus off or error passive bits. */ + if ((statusFlags & (canSTAT_BUS_OFF | canSTAT_ERROR_PASSIVE)) != 0) + { + result = true; + } + } + } /* Give the result back to the caller. */ return result; } /*** end of LeafLightIsBusError ***/ @@ -272,5 +677,577 @@ static void LeafLightRegisterEvents(tCanEvents const * events) } /*** end of LeafLightRegisterEvents ***/ +/************************************************************************************//** +** \brief CAN message reception thread. +** \param pv Pointer to thread parameters. +** \return Thread exit code. +** +****************************************************************************************/ +static DWORD WINAPI LeafLightReceptionThread(LPVOID pv) +{ + DWORD waitResult; + HANDLE handles[] = + { + leafLightCanEvent, + leafLightTerminateEvent + }; + bool running = true; + int32_t rxId; + uint32_t rxDlc; + uint32_t rxTime; + uint32_t rxFlags; + tCanMsg rxMsg; + canStatus rxStatus; + tCanEvents const * pEvents; + + /* Parameter not used. */ + (void)pv; + + /* Enter thread's infinite loop. */ + while (running) + { + waitResult = WaitForMultipleObjects(sizeof(handles)/sizeof(handles[0]), handles, + FALSE, INFINITE); + switch (waitResult) + { + /* CAN reception event. */ + case WAIT_OBJECT_0 + 0: /*lint !e835 */ + /* Only read out the events when the handle is valid. */ + if (leafLightCanHandle >= 0) + { + /* Empty out the event queue. */ + do + { + rxStatus = LeafLightLibFuncRead(leafLightCanHandle, &rxId, &rxMsg.data[0], + &rxDlc, &rxFlags, &rxTime); + /* Only process the result if a message was read. */ + if (rxStatus == canOK) + { + /* Only process STD and EXT messages. */ + if ((rxFlags & (canMSG_STD | canMSG_EXT)) != 0) + { + /* Convert the CAN message to the format of the CAN driver module. Note + * that the data was already copied by LeafLightLibFuncRead(). + */ + rxMsg.id = (uint32_t)rxId; + if ((rxFlags & canMSG_EXT) != 0) + { + rxMsg.id |= CAN_MSG_EXT_ID_MASK; + } + rxMsg.dlc = (uint8_t)rxDlc; + + /* Trigger message reception event(s). */ + pEvents = leafLightEventsList; + for (uint32_t idx = 0; idx < leafLightEventsEntries; idx++) + { + if (pEvents != NULL) + { + if (pEvents->MsgRxed != NULL) + { + pEvents->MsgRxed(&rxMsg); + } + /* Move on to the next entry in the list. */ + pEvents++; + } + } + } + } + } + while (rxStatus != canERR_NOMSG); + } + break; + + /* Termination event. */ + default: + case WAIT_OBJECT_0 + 1: /*lint !e835 */ + /* Stop thread. */ + running = false; + break; + } + } + /* Exit thread. */ + return 0; +} /*** end of LeafLightReceptionThread ***/ + + +/************************************************************************************//** +** \brief Loads the Kvaser CANLIB DLL and initializes the API function pointers. +** +****************************************************************************************/ +static void LeafLightLibLoadDll(void) +{ + /* Reset the channel handle. */ + leafLightCanHandle = -1; + /* Start out by resetting the API function pointers. */ + leafLightLibFuncInitializeLibraryPtr = NULL; + leafLightLibFuncUnloadLibraryPtr = NULL; + leafLightLibFuncOpenChannelPtr = NULL; + leafLightLibFuncSetBusParamsPtr = NULL; + leafLightLibFuncSetBusOutputControlPtr = NULL; + leafLightLibFuncSetAcceptanceFilterPtr = NULL; + leafLightLibFuncIoCtlPtr = NULL; + leafLightLibFuncBusOnPtr = NULL; + leafLightLibFuncWritePtr = NULL; + leafLightLibFuncReadPtr = NULL; + leafLightLibFuncReadStatusPtr = NULL; + leafLightLibFuncBusOffPtr = NULL; + leafLightLibFuncClosePtr = NULL; + + /* Attempt to load the library and obtain a handle to it. */ + leafLightDllHandle = LoadLibrary("canlib32"); + + /* Assert libary handle. */ + assert(leafLightDllHandle != NULL); + + /* Only continue if the library was successfully loaded */ + if (leafLightDllHandle != NULL) /*lint !e774 */ + { + /* Set canInitializeLibrary function pointer. */ + leafLightLibFuncInitializeLibraryPtr = (tLeafLightLibFuncInitializeLibrary)GetProcAddress(leafLightDllHandle, "canInitializeLibrary"); + /* Set canUnloadLibrary function pointer. */ + leafLightLibFuncUnloadLibraryPtr = (tLeafLightLibFuncUnloadLibrary)GetProcAddress(leafLightDllHandle, "canUnloadLibrary"); + /* Set canOpenChannel function pointer. */ + leafLightLibFuncOpenChannelPtr = (tLeafLightLibFuncOpenChannel)GetProcAddress(leafLightDllHandle, "canOpenChannel"); + /* Set canSetBusParams function pointer. */ + leafLightLibFuncSetBusParamsPtr = (tLeafLightLibFuncSetBusParams)GetProcAddress(leafLightDllHandle, "canSetBusParams"); + /* Set canSetBusOutputControl function pointer. */ + leafLightLibFuncSetBusOutputControlPtr = (tLeafLightLibFuncSetBusOutputControl)GetProcAddress(leafLightDllHandle, "canSetBusOutputControl"); + /* Set canAccept function pointer. */ + leafLightLibFuncSetAcceptanceFilterPtr = (tLeafLightLibFuncSetAcceptanceFilter)GetProcAddress(leafLightDllHandle, "canSetAcceptanceFilter"); + /* Set canIoCtl function pointer. */ + leafLightLibFuncIoCtlPtr = (tLeafLightLibFuncIoCtl)GetProcAddress(leafLightDllHandle, "canIoCtl"); + /* Set canBusOn function pointer. */ + leafLightLibFuncBusOnPtr = (tLeafLightLibFuncBusOn)GetProcAddress(leafLightDllHandle, "canBusOn"); + /* Set canWrite function pointer. */ + leafLightLibFuncWritePtr = (tLeafLightLibFuncWrite)GetProcAddress(leafLightDllHandle, "canWrite"); + /* Set canRead function pointer. */ + leafLightLibFuncReadPtr = (tLeafLightLibFuncRead)GetProcAddress(leafLightDllHandle, "canRead"); + /* Set canReadStatus function pointer. */ + leafLightLibFuncReadStatusPtr = (tLeafLightLibFuncReadStatus)GetProcAddress(leafLightDllHandle, "canReadStatus"); + /* Set canBusOff function pointer. */ + leafLightLibFuncBusOffPtr = (tLeafLightLibFuncBusOff)GetProcAddress(leafLightDllHandle, "canBusOff"); + /* Set canClose function pointer. */ + leafLightLibFuncClosePtr = (tLeafLightLibFuncClose)GetProcAddress(leafLightDllHandle, "canClose"); + } +} /*** end of LeafLightLibLoadDll ***/ + + +/************************************************************************************//** +** \brief Unloads the Kvaser CANLIB DLL and resets the API function pointers. +** +****************************************************************************************/ +static void LeafLightLibUnloadDll(void) +{ + /* Reset the API function pointers. */ + leafLightLibFuncInitializeLibraryPtr = NULL; + leafLightLibFuncUnloadLibraryPtr = NULL; + leafLightLibFuncOpenChannelPtr = NULL; + leafLightLibFuncSetBusParamsPtr = NULL; + leafLightLibFuncSetBusOutputControlPtr = NULL; + leafLightLibFuncSetAcceptanceFilterPtr = NULL; + leafLightLibFuncIoCtlPtr = NULL; + leafLightLibFuncBusOnPtr = NULL; + leafLightLibFuncWritePtr = NULL; + leafLightLibFuncReadPtr = NULL; + leafLightLibFuncReadStatusPtr = NULL; + leafLightLibFuncBusOffPtr = NULL; + leafLightLibFuncClosePtr = NULL; + /* Reset the channel handle. */ + leafLightCanHandle = -1; + /* Unload the library and invalidate its handle. */ + if (leafLightDllHandle != NULL) + { + (void)FreeLibrary(leafLightDllHandle); + leafLightDllHandle = NULL; + } +} /*** end of LeafLightLibUnloadDll **/ + + +/************************************************************************************//** +** \brief This function must be called before any other functions is used. It will +** initialize the driver. +** +****************************************************************************************/ +static void LeafLightLibFuncInitializeLibrary(void) +{ + /* Check function pointer and library handle. */ + assert(leafLightLibFuncInitializeLibraryPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncInitializeLibraryPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + leafLightLibFuncInitializeLibraryPtr(); + } +} /*** end of LeafLightLibFuncInitializeLibrary ***/ + + +/************************************************************************************//** +** \brief Frees allocated memory, unload the DLLs canlib32.dll has loaded and de- +** initializes data structures. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncUnloadLibrary(void) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncUnloadLibraryPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncUnloadLibraryPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncUnloadLibraryPtr(); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncUnloadLibrary ***/ + + +/************************************************************************************//** +** \brief Opens a CAN channel and returns a handle which is used in subsequent calls. +** \param channel The number of the channel. Channel numbering is hardware dependent. +** \param flags A combination of canOPEN_xxx flags. +** \return Handle (positive) to the channel if successful, canERR_xxx (negative) +** otherwise. +** +****************************************************************************************/ +static CanHandle LeafLightLibFuncOpenChannel(int32_t channel, int32_t flags) +{ + canHandle result = (canHandle)canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncOpenChannelPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncOpenChannelPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncOpenChannelPtr(channel, flags); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncOpenChannel ***/ + + +/************************************************************************************//** +** \brief This function sets the nominal bus timing parameters for the specified CAN +** controller. The library provides default values for tseg1, tseg2, sjw and +** noSamp when freq is specified to one of the pre-defined constants, +** canBITRATE_xxx for classic CAN and canFD_BITRATE_xxx for CAN FD. +** \param hnd An open handle to a CAN controller. +** \param freq Bit rate (measured in bits per second); or one of the predefined +** constants (canBITRATE_xxx for classic CAN and canFD_BITRATE_xxx for +** CAN FD). +** \param tseg1 Time segment 1, that is, the number of quanta from (but not +** including) the Sync Segment to the sampling point. +** \param tseg2 Time segment 2, that is, the number of quanta from the sampling point +** to the end of the bit. +** \param sjw The Synchronization Jump Width. +** \param noSamp The number of sampling points; can be 1 or 3. +** \param syncmode Unsupported and ignored. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncSetBusParams(const CanHandle hnd, int32_t freq, + uint32_t tseg1, uint32_t tseg2, + uint32_t sjw, uint32_t noSamp, + uint32_t syncmode) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncSetBusParamsPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncSetBusParamsPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncSetBusParamsPtr(hnd, freq, tseg1, tseg2, sjw, noSamp, syncmode); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncSetBusParams ***/ + + +/************************************************************************************//** +** \brief This function sets the driver type for a CAN controller. This corresponds +** loosely to the bus output control register in the CAN controller, hence the +** name of this function. CANLIB does not allow for direct manipulation of the +** bus output control register; instead, symbolic constants are used to select +** the desired driver type. +** \param hnd A handle to an open circuit. +** \param drivertype Can driver type (canDRIVER_xxx). +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncSetBusOutputControl(const CanHandle hnd, + const uint32_t drivertype) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncSetBusOutputControlPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncSetBusOutputControlPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncSetBusOutputControlPtr(hnd, drivertype); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncSetBusOutputControl ***/ + + +/************************************************************************************//** +** \brief This routine sets the message acceptance filters on a CAN channel. +** \param hnd A handle to an open circuit. +** \param code The acceptance code to set. +** \param mask The acceptance mask to set +** \param is_extended Select 29-bit CAN identifiers. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncSetAcceptanceFilter(const CanHandle hnd, uint32_t code, + uint32_t mask, int32_t is_extended) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncSetAcceptanceFilterPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncSetAcceptanceFilterPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncSetAcceptanceFilterPtr(hnd, code, mask, is_extended); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncSetAcceptanceFilter ***/ + + +/************************************************************************************//** +** \brief This API call performs several different functions; these are described +** below. The functions are handle-specific unless otherwise noted; this means +** that they affect only the handle you pass to canIoCtl(), whereas other open +** handles will remain unaffected. The contents of buf after the call is +** dependent on the function code you specified. +** \param hnd A handle to an open circuit. +** \param func A canIOCTL_xxx function code. +** \param buf Pointer to a buffer containing function-dependent data; or a NULL +** pointer for certain function codes. The buffer can be used for both input +** and output depending on the function code. See canIOCTL_xxx. +** \param buflen The length of the buffer. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncIoCtl(const CanHandle hnd, uint32_t func, void * buf, + uint32_t buflen) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncIoCtlPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncIoCtlPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncIoCtlPtr(hnd, func, buf, buflen); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncIoCtl ***/ + + +/************************************************************************************//** +** \brief Takes the specified channel on-bus. +** \param hnd An open handle to a CAN channel. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncBusOn(const CanHandle hnd) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncBusOnPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncBusOnPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncBusOnPtr(hnd); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncBusOn ***/ + + +/************************************************************************************//** +** \brief This function sends a CAN message. The call returns immediately after +** queuing the message to the driver. +** \param hnd A handle to an open CAN circuit. +** \param id The identifier of the CAN message to send. +** \param msg A pointer to the message data, or NULL. +** \param dlc The length of the message in bytes. +** \param flag A combination of message flags, canMSG_xxx (including canFDMSG_xxx if +** the CAN FD protocol is enabled). Use this parameter to send extended +** (29-bit) frames and/or remote frames. Use canMSG_EXT and/or canMSG_RTR for +** this purpose. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncWrite(const CanHandle hnd, int32_t id, void * msg, + uint32_t dlc, uint32_t flag) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncWritePtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncWritePtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncWritePtr(hnd, id, msg, dlc, flag); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncWrite ***/ + + +/************************************************************************************//** +** \brief Reads a message from the receive buffer. If no message is available, the +** function returns immediately with return code canERR_NOMSG. +** \param hnd A handle to an open circuit. +** \param id Pointer to a buffer which receives the CAN identifier. This buffer will +** only get the identifier. To determine whether this identifier was standard +** (11-bit) or extended (29-bit), and/or whether it was remote or not, or if +** it was an error frame, examine the contents of the flag argument. +** \param msg Pointer to the buffer which receives the message data. This buffer must +** be large enough (i.e. 8 bytes.) Only the message data is copied; the rest +** of the buffer is left as-is. +** \param dlc Pointer to a buffer which receives the message length. +** \param flag Pointer to a buffer which receives the message flags, which is a +** combination of the canMSG_xxx and canMSGERR_xxx values. +** \param time Pointer to a buffer which receives the message time stamp. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncRead(const CanHandle hnd, int32_t * id, void * msg, + uint32_t * dlc, uint32_t * flag, uint32_t * time) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncReadPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncReadPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncReadPtr(hnd, id, msg, dlc, flag, time); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncRead ***/ + + +/************************************************************************************//** +** \brief Returns the status for the specified circuit. flags points to a longword +** which receives a combination of the canSTAT_xxx flags. +** \param hnd A handle to an open circuit. +** \param flags Pointer to a DWORD which receives the status flags; this is a +** combination of any of the canSTAT_xxx. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncReadStatus(const CanHandle hnd, uint32_t * const flags) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncReadStatusPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncReadStatusPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncReadStatusPtr(hnd, flags); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncReadStatus ***/ + + +/************************************************************************************//** +** \brief Takes the specified channel off-bus. +** \param hnd A handle to an open circuit. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncBusOff(const CanHandle hnd) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncBusOffPtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncBusOffPtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncBusOffPtr(hnd); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncBusOff ***/ + + +/************************************************************************************//** +** \brief Closes the channel associated with the handle. If no other threads are +** using the CAN circuit, it is taken off bus. The handle can not be used for +** further references to the channel, so any variable containing it should be +** zeroed. +** \param hnd A handle to an open circuit. +** \return canOK if successful, canERR_xxx otherwise. +** +****************************************************************************************/ +static canStatus LeafLightLibFuncClose(const CanHandle hnd) +{ + canStatus result = canERR_NOTINITIALIZED; + + /* Check function pointer and library handle. */ + assert(leafLightLibFuncClosePtr != NULL); + assert(leafLightDllHandle != NULL); + + /* Only continue with valid function pointer and library handle. */ + if ((leafLightLibFuncClosePtr != NULL) && (leafLightDllHandle != NULL)) /*lint !e774 */ + { + /* Call library function. */ + result = leafLightLibFuncClosePtr(hnd); + } + /* Give the result back to the caller. */ + return result; +} /*** end of LeafLightLibFuncClose ***/ + + /*********************************** end of leaflight.c ********************************/ diff --git a/Host/Source/LibOpenBLT/port/windows/canif/kvaser/obsolete.h b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/obsolete.h new file mode 100644 index 00000000..02924bca --- /dev/null +++ b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/obsolete.h @@ -0,0 +1,304 @@ +/** + * \section LICENSE + * Copyright 1998-2011 by KVASER AB, SWEDEN + * + * WWW: http://www.kvaser.com + * + * This software is furnished under a license and may be used and copied + * only in accordance with the terms of such license. + * + * \section DESCRIPTION + * + * This file contains definitions which are retained for compatibility. + * + * \file obsolete.h + * \author Kvaser AB + */ + +#ifndef _OBSOLETE_H_ +#define _OBSOLETE_H_ + +/** + * \defgroup Obsolete Obsolete API Reference + * @{ + */ + +#define canCIRCUIT_ANY -1 ///< Any circuit will do \warning Obsolete! +#define canCARD_ANY -1 ///< Any card will do \warning Obsolete! +#define canCHANNEL_ANY -1 ///< Any channel will do \warning Obsolete! + +#define CANID_METAMSG (-1L) ///< Like msgs containing bus status changes. \warning Obsolete! +#define CANID_WILDCARD (-2L) ///< We don't care or don't know. \warning Obsolete! + +/** + * Retained for compatibility. + */ + +/** + * \warning Obsolete! + */ +typedef void* (*canMemoryAllocator) (size_t size); + +/** + * \warning Obsolete! + */ +typedef void (*canMemoryDeallocator)(void* p); + +/** + * \warning Obsolete! + */ +typedef struct tagCanHWDescr { + int circuitType; + int cardType; + int channel; +} canHWDescr; + +/** + * \warning Obsolete! + */ +typedef struct tagCanSWDescr { + unsigned int rxBufSize; + unsigned int txBufSize; + canMemoryAllocator alloc; + canMemoryDeallocator deAlloc; +} canSWDescr; + +#ifdef __WIN32__ +/** + * \warning Obsolete! + */ +typedef struct { + unsigned int size; + unsigned int rxBufSize; + unsigned int txBufSize; +} canSWDescriptorEx; +#endif + +/** + * \warning Obsolete! + */ +canStatus CANLIBAPI canLocateHardware(void); + +/** + * \warning Obsolete! + */ +int CANLIBAPI canOpen(const canHWDescr * const hwdescr, + const canSWDescr * const swdescr, + const unsigned int flags); + +/** + * \warning Obsolete! + */ +canStatus CANLIBAPI canGetCircuits(int * context, + char * name, + char * vendor, + char * version, + unsigned int * cardtype, + unsigned int * circtype, + unsigned int * channel); + +/** + * \name Some obsolete codes; they are not used nowadays. + * \warning Obsolete! + * @{ + */ +#define canERR_BUFOFL canERR_RESERVED_3 ///< "Buffer overflow" \warning Obsolete! +#define canERR_REINIT canERR_RESERVED_4 ///< "Reinitialization failed" \warning Obsolete! +#define canERR_MSGLOST canERR_RESERVED_5 ///< "Message lost by CAN-chip" \warning Obsolete! +#define canERR_OVERRUN canERR_RESERVED_6 ///< "Receive buffer overrun" \warning Obsolete! +#define canERR_CARDCOMMFAILED canERR_RESERVED_7 ///< "Can't communicate with the card" \warning Obsolete! +/** @} */ + +/** + * \name Circuit status flags, retained for compatibility + * \warning Obsolete! + * @{ + */ +#define canCIRCSTAT_ERROR_PASSIVE 0x0001 ///< Error passive \warning Obsolete! +#define canCIRCSTAT_BUS_OFF 0x0002 ///< Bus off \warning Obsolete! +#define canCIRCSTAT_ERROR_WARNING 0x0004 ///< Error counter > 96 \warning Obsolete! +/** @} */ + + +/** + * \name retained for compatibility + * \warning Obsolete! + * @{ + */ +#define canCHANNEL_CAP_REMOTE canCHANNEL_CAP_RESERVED_1 ///< Obsolete, use \ref canCHANNEL_CAP_REMOTE_ACCESS or \ref canCHANNELDATA_IS_REMOTE + + +/** + * \name Sticky status flags + * \warning Obsolete! + * @{ + */ +#define canSTICKY_ACK_ERROR 0x80000801 ///< \warning Obsolete! +#define canSTICKY_FORM_ERROR 0x80000002 ///< \warning Obsolete! +#define canSTICKY_STUFF_ERROR 0x80000004 ///< \warning Obsolete! +#define canSTICKY_CRC_ERROR 0x80000008 ///< \warning Obsolete! +#define canSTICKY_BIT0_ERROR 0x80000010 ///< \warning Obsolete! +#define canSTICKY_BIT1_ERROR 0x80000020 ///< \warning Obsolete! +#define canSTICKY_HW_OVERRUN 0x80000040 ///< \warning Obsolete! +#define canSTICKY_SW_OVERRUN 0x80000080 ///< \warning Obsolete! +/** @} */ + +#define canSTAT_INACTIVE canSTAT_RESERVED_1 ///< The circuit is not active (removed from the sw bus) \warning Obsolete! + + +/* +#define canCIRCSTAT_TXERR 0x0001 // TX error has occurred +#define canCIRCSTAT_RXERR 0x0002 // Receive error has occurred +#define canCIRCSTAT_OVERRUN 0x0004 // Receiver overrun +#define canCIRCSTAT_WAKEUP 0x0008 // Wakeup has occurred +#define canCIRCSTAT_INT 0x0010 // ?? +#define canCIRCSTAT_ACK 0x0020 // ACK error +#define canCIRCSTAT_BIT 0x0040 // Bit error +*/ +/* +More apocryphs. +#define canCIRCSTAT_OVERRUN 0x0004 // Receiver overrun +#define canCIRCSTAT_WAKEUP 0x0008 // Wakeup has occurred +#define canCIRCSTAT_ACK 0x0010 // ACK error +#define canCIRCSTAT_BIT0 0x0020 // Bit error +#define canCIRCSTAT_BIT1 0x0040 // Bit error +#define canCIRCSTAT_BOFF 0x0080 // Chip went Bus Off +*/ +/* +Even more. +#define canCIRCSTAT_BOFF_HW 0x10000L // Chip is Bus Off +#define canCIRCSTAT_BOFF_SW 0x20000L // We are Bus Off +*/ + + +/** + * \name Flags for canOpen + * \warning Obsolete! Use \ref canOPEN_xxx instead. + * @{ + */ +#define canWANT_ACTIONS 0x01 ///< \warning Obsolete! +#define canWANT_OWN_BUFFERS 0x02 ///< \warning Obsolete! +#define canWANT_ERROR_COUNTERS 0x04 ///< \warning Obsolete! +#define canWANT_EXCLUSIVE 0x08 ///< \warning Obsolete! Use \ref canOPEN_xxx instead. +#define canWANT_EXTENDED 0x10 ///< \warning Obsolete! Use \ref canOPEN_xxx instead. +#if defined(CANLIB_DECLARE_ALL) +# define canWANT_VIRTUAL 0x20 ///< \warning Obsolete! Use \ref canOPEN_xxx instead. +#endif + +/** @} */ + +/** + * \name Circuit types. + * \warning Obsolete! + * @{ + */ +// No circuit 0 +#define PCCAN_PHILIPS 1 ///< 82C200 on PCCAN 1.0 \warning Obsolete! +#define PCCAN_INTEL526 2 ///< Not supported. \warning Obsolete! +#define PCCAN_INTEL527 3 ///< 82527 on PCCAN 1.0 \warning Obsolete! +#define CANCARD_NEC72005 4 ///< NEC72005 on CANCard \warning Obsolete! +#define CIRC_VIRTUAL 5 ///< \warning Obsolete! +#define CIRC_SJA1000 6 ///< \warning Obsolete! +/** @} */ + +/** + * \name Card types. + * \warning Obsolete! + * @{ + */ +#define canCARD_PCCAN 1 ///< PCCAN ver 1.x (KVASER) \warning Obsolete! +#define canCARD_CANCARD 2 ///< CANCard (Softing) \warning Obsolete! +#define canCARD_AC2 3 ///< CAN-AC2 (Softing) \warning Obsolete! +#define canCARD_LAPCAN 4 ///< \warning Obsolete! +#define canCARD_ISACAN 5 ///< \warning Obsolete! +#define canCARD_PCCAN_OEM 6 ///< Special for OEM PCcan cards. \warning Obsolete! +/** @} */ + +/** + * \name The canFlgXXX are left for compatibility. + * \warning Obsolete! + * @{ + */ +#define canFlgACCEPT 1 ///< \warning Obsolete! +#define canFlgREJECT 2 ///< \warning Obsolete! +#define canFlgCODE 3 ///< \warning Obsolete! +#define canFlgMASK 4 ///< \warning Obsolete! +/** @} */ + +/** + * \name Flags for action routines + * \warning Obsolete! + * @{ + */ +#define canDISCARD_MESSAGE 3 ///< \warning Obsolete! +#define canRETAIN_MESSAGE 4 ///< \warning Obsolete! +/** @} */ + +/** + * \name For busParams - sync on rising edge only or both rising and falling edge + * (Not supported) + * \warning Obsolete! + * @{ + */ +#define canSLOW_MODE 0x01 ///< Sync on rising and falling edge \warning Obsolete! +/** @} */ + +/** + * \name CAN driver types; these constants are retained for compatibility. + * (Not supported) + * \warning Obsolete! + * @{ + */ +#define canOFF 0 ///< \warning Obsolete! +#define canTRISTATE 1 ///< \warning Obsolete! +#define canPULLUP 2 ///< \warning Obsolete! +#define canPULLDOWN 3 ///< \warning Obsolete! +#define canPUSHPULL 4 ///< This is the usual setting. \warning Obsolete! +#define canINVPULLUP 5 ///< \warning Obsolete! +#define canINVPULLDOWN 6 ///< \warning Obsolete! +#define canINVPUSHPULL 7 ///< \warning Obsolete! +/** @} */ + +/** + * \name These were never implemented. + * (Not supported) + * \warning Obsolete! + * @{ + */ +#define canIOCTL_LOCAL_ECHO_ON 3 ///< \warning Obsolete! +#define canIOCTL_LOCAL_ECHO_OFF 4 ///< \warning Obsolete! + +#define canMSG_STATUS 0x0008 +/** @} */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \warning Obsolete! + */ +canStatus CANLIBAPI canInstallAction(int handle, long id, int (*fn)()); + +/** + * \warning Obsolete! + */ +canStatus CANLIBAPI canUninstallAction(int handle, long id); + +/** + * \warning Obsolete! + */ +canStatus CANLIBAPI canInstallOwnBuffer(int handle, long id, unsigned int len, + void * buf); + +/** + * \warning Obsolete! + */ +canStatus CANLIBAPI canUninstallOwnBuffer(int handle, long id); +#ifdef __cplusplus +} +#endif + +/** @} */ + +#endif diff --git a/Host/Source/LibOpenBLT/port/windows/canif/kvaser/predef.h b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/predef.h new file mode 100644 index 00000000..dad2755a --- /dev/null +++ b/Host/Source/LibOpenBLT/port/windows/canif/kvaser/predef.h @@ -0,0 +1,103 @@ +/* +** Copyright 2007 by KVASER AB, SWEDEN +** WWW: http://www.kvaser.com +** +** This software is furnished under a license and may be used and copied +** only in accordance with the terms of such license. +** +** Description: +** This file removes the differences between BCC and MSC with regards +** to some predefined macros. The other differences remain. Sigh. +** --------------------------------------------------------------------------- +*/ + +#ifndef _PREDEF_H_ +#define _PREDEF_H_ + +// 1) Win16: Borland defines _Windows +// MSC defines _WINDOWS +// We want _WINDOWS (but also _Windows to be sure) +#if defined(_Windows) && !defined(_WINDOWS) +# define _WINDOWS 1 +#endif + +#if defined(_WINDOWS) && !defined(_Windows) +# define _Windows 1 +#endif + + +// 2) Win32: Borland defines _Windows and __WIN32__ and _WIN32 +// MSC defines _WIN32 +// We want __WIN32__ and _WINDOWS and _Windows and _WIN32 +#if defined(_WIN32) || defined(__WIN32__) +# if !defined(__WIN32__) +# define __WIN32__ 1 +# endif +# if !defined(_WINDOWS) +# define _WINDOWS 1 +# endif +# if !defined(_Windows) +# define _Windows 1 +# endif +#endif + + +// 3) DLL: Borland defines __DLL__ +// MSC defines _DLL +// We want __DLL__ +#if defined (_DLL) && !defined(__DLL__) +# define __DLL__ 1 +#endif + + + + +//=========================================================================== +#ifndef USE_CANLIB39_TYPES + // New typedefs for CANLIB 4.0 and beyond, partly to take care about + // the 64 bit ints, partly to alleviate pre3.9 mixing of ints and + // longs. + #if __STDC_VERSION__ >= 199901L + #include + #define KVINT32 int32_t + #define KVINT64 int64_t + #define KVINT32L int32_t + #define KVUINT32 uint32_t + #define KVUINT64 uint64_t + #define KVUINT32L uint32_t + #elif defined(__GNUC__) + #define KVINT32 int + #define KVINT64 long long + #define KVINT32L int + #define KVUINT32 unsigned int + #define KVUINT64 unsigned long long + #define KVUINT32L unsigned int + #else + #define KVINT32 int + #define KVINT64 __int64 + #define KVINT32L int + #define KVUINT32 unsigned int + #define KVUINT64 unsigned __int64 + #define KVUINT32L unsigned int + #endif +#else + // Old typedefs for compability with CANLIB 3.9 and older. + #ifdef __GNUC__ + #define KVINT32 int + #define KVINT64 long long + #define KVINT32L long + #define KVUINT32 unsigned int + #define KVUINT64 unsigned long long + #define KVUINT32L unsigned long + #else + #define KVINT32 int + #define KVINT64 __int64 + #define KVINT32L long + #define KVUINT32 unsigned int + #define KVUINT64 unsigned __int64 + #define KVUINT32L unsigned long + #endif +#endif + +#endif + diff --git a/Host/Source/LibOpenBLT/port/windows/canif/peak/pcanusb.c b/Host/Source/LibOpenBLT/port/windows/canif/peak/pcanusb.c index 2d0fc303..afb84d28 100644 --- a/Host/Source/LibOpenBLT/port/windows/canif/peak/pcanusb.c +++ b/Host/Source/LibOpenBLT/port/windows/canif/peak/pcanusb.c @@ -46,7 +46,7 @@ ****************************************************************************************/ /* Type definitions of the function in the PCAN-Basic API that this CAN interface uses.*/ typedef TPCANStatus (__stdcall * tPCanUsbLibFuncInitialize)(TPCANHandle, TPCANBaudrate, TPCANType, DWORD, WORD); -typedef TPCANStatus (__stdcall * tPCanUsbLibFuncpUninitialize)(TPCANHandle); +typedef TPCANStatus (__stdcall * tPCanUsbLibFuncUninitialize)(TPCANHandle); typedef TPCANStatus (__stdcall * tPCanUsbLibFuncGetStatus)(TPCANHandle); typedef TPCANStatus (__stdcall * tPCanUsbLibFuncSetValue)(TPCANHandle, TPCANParameter, void*, DWORD); typedef TPCANStatus (__stdcall * tPCanUsbLibFuncRead)(TPCANHandle, TPCANMsg*, TPCANTimestamp*); @@ -73,7 +73,7 @@ static void PCanUsbLibUnloadDll(void); static TPCANStatus PCanUsbLibFuncInitialize(TPCANHandle Channel, TPCANBaudrate Btr0Btr1, TPCANType HwType, DWORD IOPort, WORD Interrupt); -static TPCANStatus PCanUsbLibFuncpUninitialize(TPCANHandle Channel); +static TPCANStatus PCanUsbLibFuncUninitialize(TPCANHandle Channel); static TPCANStatus PCanUsbLibFuncGetStatus(TPCANHandle Channel); static TPCANStatus PCanUsbLibFuncSetValue(TPCANHandle Channel, TPCANParameter Parameter, void * Buffer, DWORD BufferLength); @@ -142,7 +142,7 @@ static HINSTANCE pCanUsbDllHandle; static tPCanUsbLibFuncInitialize pCanUsbLibFuncInitializePtr; /** \brief Function pointer to the PCAN-Basic Uninitialize function. */ -static tPCanUsbLibFuncpUninitialize pCanUsbLibFuncpUninitializePtr; +static tPCanUsbLibFuncUninitialize pCanUsbLibFuncUninitializePtr; /** \brief Function pointer to the PCAN-Basic GetStatus function. */ static tPCanUsbLibFuncGetStatus pCanUsbLibFuncGetStatusPtr; @@ -199,7 +199,7 @@ static void PCanUsbInit(tCanSettings const * settings) pCanUsbDllHandle = NULL; /* Reset library function pointers. */ pCanUsbLibFuncInitializePtr = NULL; - pCanUsbLibFuncpUninitializePtr = NULL; + pCanUsbLibFuncUninitializePtr = NULL; pCanUsbLibFuncGetStatusPtr = NULL; pCanUsbLibFuncSetValuePtr = NULL; pCanUsbLibFuncReadPtr = NULL; @@ -329,6 +329,11 @@ static bool PCanUsbConnect(void) assert(baudrateSupported); assert(channelSupported); + /* Invalidate handles. */ + pCanUsbTerminateEvent = NULL; + pCanUsbCanEvent = NULL; + pCanUsbRxThreadHandle = NULL; + /* Only continue with valid settings. */ if ( (baudrateSupported) && (channelSupported) ) { @@ -451,7 +456,7 @@ static bool PCanUsbConnect(void) if (libInitialized) { /* Uninitialize the library. */ - (void)PCanUsbLibFuncpUninitialize(pCanUsbChannelLookup[pCanUsbSettings.channel]); + (void)PCanUsbLibFuncUninitialize(pCanUsbChannelLookup[pCanUsbSettings.channel]); } if (pCanUsbTerminateEvent != NULL) { @@ -487,6 +492,7 @@ static void PCanUsbDisconnect(void) (void)WaitForSingleObject(pCanUsbRxThreadHandle, INFINITE); /* Close the thread handle. */ (void)CloseHandle(pCanUsbRxThreadHandle); + pCanUsbRxThreadHandle = NULL; } /* Close the terminate event handle. */ @@ -502,7 +508,7 @@ static void PCanUsbDisconnect(void) pCanUsbCanEvent = NULL; } /* Disconnect from the CAN interface. */ - (void)PCanUsbLibFuncpUninitialize(pCanUsbChannelLookup[pCanUsbSettings.channel]); + (void)PCanUsbLibFuncUninitialize(pCanUsbChannelLookup[pCanUsbSettings.channel]); } /*** end of PCanUsbDisconnect ***/ @@ -725,7 +731,7 @@ static void PCanUsbLibLoadDll(void) { /* Start out by resetting the API function pointers. */ pCanUsbLibFuncInitializePtr = NULL; - pCanUsbLibFuncpUninitializePtr = NULL; + pCanUsbLibFuncUninitializePtr = NULL; pCanUsbLibFuncGetStatusPtr = NULL; pCanUsbLibFuncSetValuePtr = NULL; pCanUsbLibFuncReadPtr = NULL; @@ -744,7 +750,7 @@ static void PCanUsbLibLoadDll(void) /* Set CAN_Initialize function pointer. */ pCanUsbLibFuncInitializePtr = (tPCanUsbLibFuncInitialize)GetProcAddress(pCanUsbDllHandle, "CAN_Initialize"); /* Set CAN_Uninitialize function pointer. */ - pCanUsbLibFuncpUninitializePtr = (tPCanUsbLibFuncpUninitialize)GetProcAddress(pCanUsbDllHandle, "CAN_Uninitialize"); + pCanUsbLibFuncUninitializePtr = (tPCanUsbLibFuncUninitialize)GetProcAddress(pCanUsbDllHandle, "CAN_Uninitialize"); /* Set CAN_GetStatus function pointer. */ pCanUsbLibFuncGetStatusPtr = (tPCanUsbLibFuncGetStatus)GetProcAddress(pCanUsbDllHandle, "CAN_GetStatus"); /* Set CAN_SetValue function pointer. */ @@ -767,7 +773,7 @@ static void PCanUsbLibUnloadDll(void) { /* Reset the API function pointers. */ pCanUsbLibFuncInitializePtr = NULL; - pCanUsbLibFuncpUninitializePtr = NULL; + pCanUsbLibFuncUninitializePtr = NULL; pCanUsbLibFuncGetStatusPtr = NULL; pCanUsbLibFuncSetValuePtr = NULL; pCanUsbLibFuncReadPtr = NULL; @@ -825,24 +831,24 @@ static TPCANStatus PCanUsbLibFuncInitialize(TPCANHandle Channel, TPCANBaudrate B ** success. ** ****************************************************************************************/ -static TPCANStatus PCanUsbLibFuncpUninitialize(TPCANHandle Channel) +static TPCANStatus PCanUsbLibFuncUninitialize(TPCANHandle Channel) { /* set result to error. */ TPCANStatus result = PCAN_ERROR_INITIALIZE; /* Check function pointer and library handle. */ - assert(pCanUsbLibFuncpUninitializePtr != NULL); + assert(pCanUsbLibFuncUninitializePtr != NULL); assert(pCanUsbDllHandle != NULL); /* Only continue with valid function pointer and library handle. */ - if ((pCanUsbLibFuncpUninitializePtr != NULL) && (pCanUsbDllHandle != NULL)) /*lint !e774 */ + if ((pCanUsbLibFuncUninitializePtr != NULL) && (pCanUsbDllHandle != NULL)) /*lint !e774 */ { /* Call library function. */ - result = pCanUsbLibFuncpUninitializePtr(Channel); + result = pCanUsbLibFuncUninitializePtr(Channel); } /* Give the result back to the caller. */ return result; -} /*** end of PCanUsbLibFuncpUninitialize ***/ +} /*** end of PCanUsbLibFuncUninitialize ***/ /************************************************************************************//** diff --git a/Host/libopenblt.dll b/Host/libopenblt.dll index 24447d90164a8f9bd49b6021461bb5c47364a060..c93732f569f6482098337310cf41b2a99b8f212f 100644 GIT binary patch delta 33768 zcmeIbdt6l2*FSz{1VsZG6%-W}6%_Atzt4adOidI~6jKYY9f=fmFfw&eP@$0|kBXKh zgcX*RhIuJ9G7~i`G&3tcMP@Yy7JcGlSmgZPYoD26hV1EizQ5n|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