libHartwer - Documentation
Data Structures | Defines | Enumerations | Functions

bcs_can.h File Reference

Basic CAN Port functions. More...

Go to the source code of this file.

Data Structures

struct  BCS_canmsg
 structure representing a CAN message More...

Defines

#define BCS_CAN_BOARD   "/dev/can1"
 Constant defining can port for pic network.
#define BCS_CAN_ECU   "/dev/can0"
 Constant defining can port for ECU.
#define BCS_CAN_MSG_LENGTH   8
 Constant telling the maximum length for a can message.

Enumerations

enum  BCS_CAN_Flag { BCS_CAN_NONE, BCS_CAN_NOWAIT }
 

Flags for controlling methods behaviour.

More...

Functions

BCS_ERROR BCS_CAN_close (BCS_canport *filedescriptor)
 Is closing the connection to the CAN Port.
BCS_ERROR BCS_CAN_open (BCS_canport *fd, const char *port, BCS_CAN_Flag f)
 Open given CAN port with the given flags to enable reading and writing.
static BCS_ERROR BCS_CAN_read (BCS_canport *fd, BCS_canmsg *dt)
 Reads the latest CAN Message from a given filedescriptor.
static BCS_ERROR BCS_CAN_write (BCS_canport *fd, BCS_canmsg *dt)
 Writes the given CAN Message to a given filedescriptor.

Detailed Description

Date:
14.03.2009
Author:
Marius Zwicker This file is providing functions to read from and write to CAN ports

Enumeration Type Documentation

Enumerator:
BCS_CAN_NONE 

blocking call, method will return only if message could be sent or received

BCS_CAN_NOWAIT 

non blocking, method will always return and return BCS_ERR_EMPTY or BCS_ERR_NOTSENT if operation failed


Function Documentation

BCS_ERROR BCS_CAN_close ( BCS_canport filedescriptor)
Parameters:
filedescriptor
Returns:
error values
BCS_ERROR BCS_CAN_open ( BCS_canport fd,
const char *  port,
BCS_CAN_Flag  f 
)
Parameters:
fdpointer to an unused BCS filedescriptor
porta string constant describing the CAN port (e.g. '/dev/can0')
fconfigure device options, see BCS_CAN_Flag docu
Returns:
error values
static BCS_ERROR BCS_CAN_read ( BCS_canport fd,
BCS_canmsg dt 
) [inline, static]
Parameters:
fdan Int32 describing the filedescriptor (return value of FR9C_open)
dta pointer of type BCS_canmsg awaiting data
Returns:
error values
static BCS_ERROR BCS_CAN_write ( BCS_canport fd,
BCS_canmsg dt 
) [inline, static]
Parameters:
fdan int describing the filedescriptor (return value of FR9C_open)
dta pointer of type BCS_canmsg containing your data
Returns:
error values

Generated on Fri Feb 11 2011 18:25:46 for libHartwer by Doxygen 1.7.3
Content © 2009-2011 Elefant Racing Bayreuth & MLBA (About) – Design © 2010 Emzeat. All Rights reserved.