Christian Taedcke / Mbed 2 deprecated ObdDisplay

Dependencies:   Adafruit_GFX MODSERIAL mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

IsoTpHandler Class Reference

IsoTpHandler Class Reference

http://en.wikipedia.org/wiki/ISO_15765-2 More...

#include <IsoTpHandler.h>

Public Member Functions

 IsoTpHandler (CAN *canInterface)
 Constructor.
void processCanMessage (const CANMessage *message)
 Processes the given can message.
void handle_decoded_packet (const uint8_t *data, uint16_t length)
 This method is called when a complete Iso Tp message was received.
void init_consequtive_reading (uint16_t messageSize, const uint8_t *data)
uint8_t getExpectedIndex () const
 Returns the next expected index value of the can packet.
void incrementExpectedIndex ()
 Increments the expected index.
bool appendReceivedData (const uint8_t *data, uint8_t length)
 Appends the given data to the internal consequtive transfer buffer.
void setState (const State *state)
 Modifies the internal state.

Detailed Description

http://en.wikipedia.org/wiki/ISO_15765-2

Definition at line 9 of file IsoTpHandler.h.


Constructor & Destructor Documentation

IsoTpHandler ( CAN *  canInterface )

Constructor.

Parameters:
[in]canInterfaceThe can interface the packets should be sent to. It must not be NULL.

Definition at line 148 of file IsoTpHandler.cpp.


Member Function Documentation

bool appendReceivedData ( const uint8_t *  data,
uint8_t  length 
)

Appends the given data to the internal consequtive transfer buffer.

Return values:
\cTrue if the state should be switched.
\cFalse if the state not change.

Definition at line 252 of file IsoTpHandler.cpp.

uint8_t getExpectedIndex (  ) const

Returns the next expected index value of the can packet.

Returns:
The next expected index value.

Definition at line 238 of file IsoTpHandler.cpp.

void handle_decoded_packet ( const uint8_t *  data,
uint16_t  length 
)

This method is called when a complete Iso Tp message was received.

Currently the packet is only printed out. Later a user callback must be executed from here.

Parameters:
[in]dataThe content of the Iso Tp message.
[in]lengthThe amount of bytes in data.

Definition at line 175 of file IsoTpHandler.cpp.

void incrementExpectedIndex (  )

Increments the expected index.

This method ensures an automatic wrap around from 15 to 0.

Definition at line 243 of file IsoTpHandler.cpp.

void init_consequtive_reading ( uint16_t  messageSize,
const uint8_t *  data 
)
Parameters:
[in]messageSizeTotal bytes included in the consequtive transfer.
[in]dataAlways 6 bytes.

Definition at line 189 of file IsoTpHandler.cpp.

void processCanMessage ( const CANMessage *  message )

Processes the given can message.

This is the main method. It must be called for every received IsoTp can packet. It updates the internal state and sends the can response.

Parameters:
[in]messageThe received can message. It must not be NULL.

Definition at line 155 of file IsoTpHandler.cpp.

void setState ( const State *  state )

Modifies the internal state.

Should not be used externally.

Parameters:
[in]Thenew state.

Definition at line 210 of file IsoTpHandler.cpp.