CanESD Class Reference
#include <CanESD.h>
List of all members.
Detailed Description
Driver of the CAN controller of ESD.
Definition at line 77 of file CanESD.h.
Constructor & Destructor Documentation
CanESD::CanESD |
( |
const char * |
cIniFile, |
|
|
bool |
bObjectMode = false | |
|
) |
| | |
Destructor. Release the allocated resources.
Definition at line 76 of file CanESD.cpp.
Member Function Documentation
int CanESD::canIdAddGroup |
( |
NTCAN_HANDLE |
handle, |
|
|
int |
id | |
|
) |
| | [protected] |
Add a group of CAN identifier to the handle, so it can be received. The identifiers are generated by inverting the id and adding each value between 0 and 7 This is used for generating the answer commands by the RCS5000.
- Parameters:
-
| handle | The handle to add the identifiers to. |
| id | The command id sent to the RCS5000. |
- Returns:
- NTCAN_SUCESS if ok, or an error code.
Definition at line 303 of file CanESD.cpp.
std::string CanESD::GetErrorStr |
( |
int |
ntstatus |
) |
const [protected] |
void CanESD::init |
( |
|
) |
[inline, virtual] |
Initializes the CAN bus.
Implements CanItf.
Definition at line 95 of file CanESD.h.
void CanESD::initIntern |
( |
|
) |
[private] |
CanESD::invert |
( |
int |
id |
) |
[inline, protected] |
Invert a give ID in 1-complement. Note: Only 11 bits are used, i.e. the range is from 0x00 to 0x7FF.
- Parameters:
-
| id | The id to be inverted. |
- Returns:
- The inverted id.
Definition at line 112 of file CanESD.h.
bool CanESD::isObjectMode |
( |
|
) |
[inline, virtual] |
Check if the current CAN interface was opened on OBJECT mode.
- Returns:
- true if opened in OBJECT mode, false if not.
Implements CanItf.
Definition at line 99 of file CanESD.h.
bool CanESD::isTransmitError |
( |
|
) |
[inline] |
int CanESD::readEvent |
( |
|
) |
[protected] |
Check if errors occured on the CAN bus.
- Returns:
- - 0 if everthing is fine.
- -1 if an error occured.
- -3 if messages were lost.
- -5 if a FIFO overflow occured.
- -6 if the CAN controller is BUS OFF.
- -7 if the CAN controller is WARN, i.e. error passive.
Definition at line 367 of file CanESD.cpp.
bool CanESD::receiveMsg |
( |
CanMsg * |
pCMsg |
) |
[virtual] |
Reads a CAN message.
- Returns:
- true if a message is available
Implements CanItf.
Definition at line 214 of file CanESD.cpp.
bool CanESD::receiveMsgRetry |
( |
CanMsg * |
pCMsg, |
|
|
int |
iNrOfRetry | |
|
) |
| | [virtual] |
Reads a CAN message. The function blocks between the attempts.
- Parameters:
-
| pCMsg | CAN message |
| iNrOfRetry | number of retries |
- Returns:
- true if a message is available
Implements CanItf.
Definition at line 171 of file CanESD.cpp.
bool CanESD::transmitMsg |
( |
CanMsg |
CMsg, |
|
|
bool |
bBlocking = true | |
|
) |
| | [virtual] |
Transmit a message via the CAN bus. Additionally, an error flag is set internally if the transmission does not succeed.
- Parameters:
-
| CMsg | Structure containing the CAN message. |
- Returns:
- true on success, false on failure.
Implements CanItf.
Definition at line 138 of file CanESD.cpp.
Member Data Documentation
The documentation for this class was generated from the following files: