Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

IsoAgLib::iCANIO_c Class Reference

Main Object for CAN communication; act as interface for CANIO_c of the __IsoAgLib namespace. More...

#include <icanio_c.h>

Inheritance diagram for IsoAgLib::iCANIO_c:

Inheritance graph
[legend]
Collaboration diagram for IsoAgLib::iCANIO_c:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool init (uint8_t rui8_busNumber=0xFF, uint16_t rui16_bitrate=DEFAULT_BITRATE, Ident_c::identType_t ren_identType=DEFAULT_CONFIG_IDENT_TYPE, uint8_t rui8_minObjNr=DEFAULT_MIN_OBJ_NR, uint8_t rui8_maxObjNr=DEFAULT_MAX_OBJ_NR)
 Initialize the CAN hardware, and instantiate one msg object for sending of messages.
bool processMsg ()
 initiate processing of all received msg check all active MsgObj_c for received CAN msg and initiate their processing
int16_t getBusLoad () const
 deliver actual BUS load in baud
void setSendpause (uint16_t rui16_minDelay) const
 set the minimum delay in msec.
uint8_t sendCanFreecnt (Ident_c::identType_t ren_identType=DEFAULT_IDENT_TYPE)
 deliver the numbers which can be placed at the moment in the send puffer
void sendCanClearbuf (Ident_c::identType_t ren_identType=DEFAULT_IDENT_TYPE)
 clear the send buffer
bool existFilter (uint16_t rui32_mask, uint16_t rui32_filter, Ident_c::identType_t ren_identType=DEFAULT_IDENT_TYPE, ArrFilterBox::iterator *rpc_iter=NULL)
 test if a FilterBox_c definition already exist (version expecial for standard ident, chosen at compile time)
bool existFilter (uint32_t rui32_mask, uint32_t rui32_filter, Ident_c::identType_t ren_identType=DEFAULT_IDENT_TYPE, ArrFilterBox::iterator *rpc_iter=NULL)
 test if a FilterBox_c definition already exist (version expecial for extended ident, chosen at compile time)
bool existFilter (const Ident_c &rc_compMask, const Ident_c &rc_compFilter, ArrFilterBox::iterator *rpc_iter=NULL)
 test if a FilterBox_c definition already exist (version with comper items as Ident_c class instances, chosen by compiler)
bool insertFilter (IsoAgLib::iCANCustomer_c &rref_customer, MASK_TYPE rt_mask, MASK_TYPE rt_filter, bool rb_reconfigImmediate=true, const Ident_c::identType_t rt_identType=DEFAULT_IDENT_TYPE)
 create a Filter Box with specified rt_mask/rt_filter on ui8_busNr of object; reconfig HW CAN MsgObj_c only if rb_reconfigImmediate == true -> useful for avoiding unneeded reconfiguration during sequence of FilterBox_c insertions; by rref_customer iCANIO_c (FilterBox_c) can start direct processing of received data in dedicated customer object (no search); uses BIOS functions
bool reconfigureMsgObj ()
 reconfigure the MsgObj after insert/delete of FilterBox
bool deleteFilter (MASK_TYPE rui32_mask, MASK_TYPE rui32_filter, const Ident_c::identType_t rt_identType=DEFAULT_IDENT_TYPE)
 delete a FilerBox definition
iCANIO_coperator<< (iCANPkg_c &rrefc_src)
 function for sending data out of iCANPkg if send puffer is full a local loop waits till puffer has enough space (every 100ms the watchdog is triggered, to avoid watchdog reset)
iCANIO_coperator<< (iCANPkgExt_c &rrefc_src)
 function for sending data out of iCANPkg if send puffer is full a local loop waits till puffer has enough space (every 100ms the watchdog is triggered, to avoid watchdog reset)

Private Types

typedef std::bad_alloc bad_alloc
typedef __IsoAgLib::CANCustomer_c CANCustomer_c
typedef __IsoAgLib::CANPkg_c CANPkg_c
typedef __IsoAgLib::Ident_c Ident_c

Friends

iCANIO_cgetIcanInstance (void)
 allow getIcanInstance() access to shielded base class.

Detailed Description

Main Object for CAN communication; act as interface for CANIO_c of the __IsoAgLib namespace.

Manages dynamic amount of FilterBox_c which can have individual filter/mask settings (means no global mask needed). Inhertis virtual from Shared::Err_c to allow easy access to status checking functions.

Author:
Dipl.-Inform. Achim Spangler

Definition at line 75 of file icanio_c.h.


Member Typedef Documentation

typedef std::bad_alloc IsoAgLib::iCANIO_c::bad_alloc [private]
 

Definition at line 78 of file icanio_c.h.

typedef __IsoAgLib::CANCustomer_c IsoAgLib::iCANIO_c::CANCustomer_c [private]
 

Definition at line 79 of file icanio_c.h.

typedef __IsoAgLib::CANPkg_c IsoAgLib::iCANIO_c::CANPkg_c [private]
 

Definition at line 80 of file icanio_c.h.

typedef __IsoAgLib::Ident_c IsoAgLib::iCANIO_c::Ident_c [private]
 

Definition at line 81 of file icanio_c.h.

Referenced by existFilter().


Member Function Documentation

bool IsoAgLib::iCANIO_c::deleteFilter MASK_TYPE  rui32_mask,
MASK_TYPE  rui32_filter,
const Ident_c::identType_t  rt_identType = DEFAULT_IDENT_TYPE
[inline]
 

delete a FilerBox definition

Parameters:
rui32_mask individual mask for this filter box
rui32_filter individual filter
rt_identType ident type of the deleted ident: standard 11bit or extended 29bit (defualt DEFAULT_IDENT_TYPE defined in isoaglib_config.h)
Returns:
true -> FilterBox_c found and deleted

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 243 of file icanio_c.h.

bool IsoAgLib::iCANIO_c::existFilter const Ident_c rc_compMask,
const Ident_c rc_compFilter,
ArrFilterBox::iterator *  rpc_iter = NULL
[inline]
 

test if a FilterBox_c definition already exist (version with comper items as Ident_c class instances, chosen by compiler)

Parameters:
rc_compMask individual mask for this filter box
rc_compFilter individual filter
Returns:
true -> same FilterBox_c already exist

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 192 of file icanio_c.h.

References Ident_c.

bool IsoAgLib::iCANIO_c::existFilter uint32_t  rui32_mask,
uint32_t  rui32_filter,
Ident_c::identType_t  ren_identType = DEFAULT_IDENT_TYPE,
ArrFilterBox::iterator *  rpc_iter = NULL
[inline]
 

test if a FilterBox_c definition already exist (version expecial for extended ident, chosen at compile time)

Parameters:
rui32_mask individual mask for this filter box
rui32_filter individual filter
ren_identType type of searched ident: standard 11bit or extended 29bit (default DEFAULT_IDENT_TYPE set in isoaglib_config.h)
Returns:
true -> same FilterBox_c already exist

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 181 of file icanio_c.h.

References uint32_t.

bool IsoAgLib::iCANIO_c::existFilter uint16_t  rui32_mask,
uint16_t  rui32_filter,
Ident_c::identType_t  ren_identType = DEFAULT_IDENT_TYPE,
ArrFilterBox::iterator *  rpc_iter = NULL
[inline]
 

test if a FilterBox_c definition already exist (version expecial for standard ident, chosen at compile time)

Parameters:
rui32_mask individual mask for this filter box
rui32_filter individual filter
ren_identType type of searched ident: standard 11bit or extended 29bit (default DEFAULT_IDENT_TYPE set in isoaglib_config.h)
Returns:
true -> same FilterBox_c already exist

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 167 of file icanio_c.h.

References uint16_t.

int16_t IsoAgLib::iCANIO_c::getBusLoad  )  const [inline]
 

deliver actual BUS load in baud

Returns:
baudrate in [baud] on used CAN BUS

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 133 of file icanio_c.h.

References int16_t.

bool IsoAgLib::iCANIO_c::init uint8_t  rui8_busNumber = 0xFF,
uint16_t  rui16_bitrate = DEFAULT_BITRATE,
Ident_c::identType_t  ren_identType = DEFAULT_CONFIG_IDENT_TYPE,
uint8_t  rui8_minObjNr = DEFAULT_MIN_OBJ_NR,
uint8_t  rui8_maxObjNr = DEFAULT_MAX_OBJ_NR
[inline]
 

Initialize the CAN hardware, and instantiate one msg object for sending of messages.

Do configuration for BUS number, sending bitrate, CAN ident length, minx/max hardware/BIOS Msg Obj numbers by parameters; called by specified constructor or external functions; wrong BUS and msg obj numbers are rejected and cause set of Err_c:range

If even the rui8_busNumber parameter has the default value 0xFF, then the configuration settings of a previous init call are not changed. In this case, the CAN BUS is only reset with the old settings. This is enabled by the default value 0xFF for rui8_busNumber, which is changed to DEFAULT_BUS_NUMBER for the first call of init() after the constructor. In all other cases, the special value 0xFF is indicator for empty parameter list.

possible errors: Err_c::range on undefined BUS, msgOb_nr or sendPufferSize, Err_c::hwConfig on uninitialized BUS, undef. msgType or CAN-BIOS mem-err, Err_c::busy on already used sending Msg-Obj

Parameters:
rui8_busNumber optional number of the CAN bus
rui16_bitrate optional bitrate (default by define in master_header.h)
t_identLength optional length of the ident (S (11bit), E (29bit)) (default by define in master_header.h)
rui8_minObjNr optional minimum number for hardware CAN message object (important for sharing CAN controller with other tasks) (default by define in master_header.h)
rui8_maxObjNr optional maximum number for hardware CAN message object (default by define in master_header.h)
Returns:
true -> correct initialisation without errors

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 114 of file icanio_c.h.

References uint16_t, and uint8_t.

bool IsoAgLib::iCANIO_c::insertFilter IsoAgLib::iCANCustomer_c rref_customer,
MASK_TYPE  rt_mask,
MASK_TYPE  rt_filter,
bool  rb_reconfigImmediate = true,
const Ident_c::identType_t  rt_identType = DEFAULT_IDENT_TYPE
[inline]
 

create a Filter Box with specified rt_mask/rt_filter on ui8_busNr of object; reconfig HW CAN MsgObj_c only if rb_reconfigImmediate == true -> useful for avoiding unneeded reconfiguration during sequence of FilterBox_c insertions; by rref_customer iCANIO_c (FilterBox_c) can start direct processing of received data in dedicated customer object (no search); uses BIOS functions

possible errors: Err_c::badAlloc on not enough memory for new FilterBox instance or for new configured MsgObj_c's

See also:
IsoAgLib::iCANCustomer
Parameters:
rref_customer reference to IsoAgLib::iCANCustomer_c which needs filtered messages (-> on received msg call rref_customer.processMsg())
rt_mask individual mask for this filter box
rt_filter individual filter
rb_reconfigImmediate true -> all Filter objects are reconfigured to according CAN hardware MsgObj after creating this filter
rt_identType ident type of the created ident: standard 11bit or extended 29bit (default DEFAULT_IDENT_TYPE set in isoaglib_config.h)
Returns:
true -> inserting and if wanted reconfiguration are performed without errors
Exceptions:
badAlloc 

Definition at line 223 of file icanio_c.h.

iCANIO_c& IsoAgLib::iCANIO_c::operator<< iCANPkgExt_c rrefc_src  )  [inline]
 

function for sending data out of iCANPkg if send puffer is full a local loop waits till puffer has enough space (every 100ms the watchdog is triggered, to avoid watchdog reset)

possible errors: Err_c::hwConfig on wrong configured CAN obj, not init BUS or no configured send obj Err_c::range on undef BUS or BIOS send obj nr Err_c::can_warn on physical CAN-BUS problems Err_c::can_off on physical CAN-BUS off state

See also:
iCANPkg_c
Parameters:
rrefc_src iCANPkg_c which holds the to be sent data
Returns:
reference to this iCANIO_c instance ==> needed by commands like "c_can_io << pkg_1 << pkg_2 ... << pkg_n;"

Definition at line 283 of file icanio_c.h.

References IsoAgLib::iCANPkgExt_c.

iCANIO_c& IsoAgLib::iCANIO_c::operator<< iCANPkg_c rrefc_src  )  [inline]
 

function for sending data out of iCANPkg if send puffer is full a local loop waits till puffer has enough space (every 100ms the watchdog is triggered, to avoid watchdog reset)

possible errors: Err_c::hwConfig on wrong configured CAN obj, not init BUS or no configured send obj Err_c::range on undef BUS or BIOS send obj nr Err_c::can_warn on physical CAN-BUS problems Err_c::can_off on physical CAN-BUS off state

See also:
iCANPkg_c
Parameters:
rrefc_src iCANPkg_c which holds the to be sent data
Returns:
reference to this iCANIO_c instance ==> needed by commands like "c_can_io << pkg_1 << pkg_2 ... << pkg_n;"

Definition at line 265 of file icanio_c.h.

bool IsoAgLib::iCANIO_c::processMsg  )  [inline]
 

initiate processing of all received msg check all active MsgObj_c for received CAN msg and initiate their processing

Returns:
true -> all active CAN buffers are processed in time

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 128 of file icanio_c.h.

bool IsoAgLib::iCANIO_c::reconfigureMsgObj  )  [inline]
 

reconfigure the MsgObj after insert/delete of FilterBox

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 233 of file icanio_c.h.

void IsoAgLib::iCANIO_c::sendCanClearbuf Ident_c::identType_t  ren_identType = DEFAULT_IDENT_TYPE  )  [inline]
 

clear the send buffer

Parameters:
ren_identType type of searched ident: standard 11bit or extended 29bit (default DEFAULT_IDENT_TYPE set in isoaglib_config.h)

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 155 of file icanio_c.h.

uint8_t IsoAgLib::iCANIO_c::sendCanFreecnt Ident_c::identType_t  ren_identType = DEFAULT_IDENT_TYPE  )  [inline]
 

deliver the numbers which can be placed at the moment in the send puffer

Parameters:
ren_identType type of searched ident: standard 11bit or extended 29bit (default DEFAULT_IDENT_TYPE set in isoaglib_config.h)
Returns:
number of msgs which fit into send buffer

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 148 of file icanio_c.h.

References uint8_t.

void IsoAgLib::iCANIO_c::setSendpause uint16_t  rui16_minDelay  )  const [inline]
 

set the minimum delay in msec.

between two sent CAN messages

Parameters:
rui16_minDelay minimum time between two CAN messages [msec.]

Reimplemented from __IsoAgLib::CANIO_c.

Definition at line 140 of file icanio_c.h.

References uint16_t.


Friends And Related Function Documentation

iCANIO_c& getIcanInstance void   )  [friend]
 

allow getIcanInstance() access to shielded base class.

otherwise __IsoAgLib::getCanInstance() wouldn't be accepted by compiler

Definition at line 304 of file icanio_c.h.


The documentation for this class was generated from the following file:
Generated on Wed Oct 13 15:46:26 2004 for IsoAgLib by  doxygen 1.3.8-20040913