Kvaser Linux CANLIB

linlib.h File Reference

Data Structures

struct  LinMessageInfo

Defines

#define linINVALID_HANDLE   ((LinHandle)(-1))
#define CompilerAssert(exp)   extern char _CompilerAssert[(exp) ? 1 : -1]
#define LINERROR(f)   ((f) & (LIN_NODATA | LIN_CSUM_ERROR | LIN_SYNCH_ERROR | LIN_BIT_ERROR))
#define LINLIBAPI
LIN message flags

The following flags can be returned from linReadMessage() and linReadMessageWait().

#define LIN_TX   1
#define LIN_RX   2
#define LIN_WAKEUP_FRAME   4
#define LIN_NODATA   8
#define LIN_CSUM_ERROR   16
#define LIN_PARITY_ERROR   32
#define LIN_SYNCH_ERROR   64
#define LIN_BIT_ERROR   128
Flags for linOpenChannel()
#define LIN_MASTER   1
#define LIN_SLAVE   2
LIN illegal message flags

#define LIN_MSG_DISTURB_CSUM   1
#define LIN_MSG_DISTURB_PARITY   2
LIN message parity

#define LIN_MSG_USE_STANDARD_PARITY   0x04
#define LIN_MSG_USE_ENHANCED_PARITY   0x08
LIN setup
#define LIN_ENHANCED_CHECKSUM   1
#define LIN_VARIABLE_DLC   2

Typedefs

typedef int LinHandle

Enumerations

Return codes from the LINlib functions

enum  LinStatus {
  linOK = 0,
  linERR_NOMSG = -1,
  linERR_NOTRUNNING = -3,
  linERR_RUNNING = -4,
  linERR_MASTERONLY = -5,
  linERR_SLAVEONLY = -6,
  linERR_PARAM = -7,
  linERR_NOTFOUND = -8,
  linERR_NOMEM = -9,
  linERR_NOCHANNELS = -10,
  linERR_TIMEOUT = -11,
  linERR_NOTINITIALIZED = -12,
  linERR_NOHANDLES = -13,
  linERR_INVHANDLE = -14,
  linERR_CANERROR = -15,
  linERR_ERRRESP = -16,
  linERR_WRONGRESP = -17,
  linERR_DRIVER = -18,
  linERR_DRIVERFAILED = -19,
  linERR_NOCARD = -20,
  linERR_LICENSE = -21,
  linERR_INTERNAL = -22,
  linERR_NO_ACCESS = -23,
  linERR_VERSION = -24
}

Functions

void linInitializeLibrary (void)
LinStatus linGetTransceiverData (int channel, unsigned char eanNo[8], unsigned char serNo[8], int *ttype)
LinHandle linOpenChannel (int channel, int flags)
LinStatus linClose (LinHandle h)
LinStatus linGetFirmwareVersion (LinHandle h, unsigned char *bootVerMajor, unsigned char *bootVerMinor, unsigned char *bootVerBuild, unsigned char *appVerMajor, unsigned char *appVerMinor, unsigned char *appVerBuild)
LinStatus linSetBitrate (LinHandle h, unsigned int bps)
LinStatus linBusOn (LinHandle h)
LinStatus linBusOff (LinHandle h)
unsigned long linReadTimer (LinHandle h)
LinStatus linWriteMessage (LinHandle h, unsigned int id, const void *msg, unsigned int dlc)
LinStatus linRequestMessage (LinHandle h, unsigned int id)
LinStatus linReadMessage (LinHandle h, unsigned int *id, void *msg, unsigned int *dlc, unsigned int *flags, LinMessageInfo *msgInfo)
LinStatus linReadMessageWait (LinHandle h, unsigned int *id, void *msg, unsigned int *dlc, unsigned int *flags, LinMessageInfo *msgInfo, unsigned long timeout)
LinStatus linUpdateMessage (LinHandle h, unsigned int id, const void *msg, unsigned int dlc)
LinStatus linSetupIllegalMessage (LinHandle h, unsigned int id, unsigned int cFlags, unsigned int delay)
LinStatus linSetupLIN (LinHandle h, unsigned int lFlags, unsigned int bps)
LinStatus linWriteWakeup (LinHandle h, unsigned int count, unsigned int interval)
LinStatus linClearMessage (LinHandle h, unsigned int id)
LinStatus linWriteSync (LinHandle h, unsigned long timeout)
LinStatus linGetCanHandle (LinHandle h, unsigned int *canHandle)

Detailed Description

LICENSE

Copyright 2003-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.

DESCRIPTION

Definitions for the LINlib API.

Author:
Kvaser AB