Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Adafruit_GFX MODSERIAL mbed-rtos mbed
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] canInterface The 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:
-
\c True if the state should be switched. \c False 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] data The content of the Iso Tp message. [in] length The 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] messageSize Total bytes included in the consequtive transfer. [in] data Always 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] message The 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] The new state.
Definition at line 210 of file IsoTpHandler.cpp.
Generated on Tue Jul 12 2022 21:25:01 by
1.7.2