File isotp_defines.h¶
FileList > inc > isotp_defines.h
Go to the source code of this file
Internal protocol definitions and type structures for ISO-TP. More...
#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | IsoTpCanMessage |
| struct | IsoTpConsecutiveFrame Consecutive frame layout. |
| struct | IsoTpDataArray |
| struct | IsoTpFirstFrameShort First frame (short) layout. |
| struct | IsoTpFlowControl Flow control frame layout. |
| struct | IsoTpPciType CAN frame definitions. |
| struct | IsoTpSingleFrame Single frame layout. |
Public Types¶
| Type | Name |
|---|---|
| enum | IsoTpFlowStatus Protocol Control Information (PCI) flow control identifiers. |
| enum | IsoTpProtocolControlInformation Protocol-specific defines. |
| enum | IsoTpReceiveStatusTypes ISOTP receiver status. |
| enum | IsoTpSendStatusTypes ISOTP sender status. |
Public Functions¶
| Type | Name |
|---|---|
| ISOTP_PACKED_STRUCT ({ uint8_t set_to_zero_high :4;uint8_t type :4;uint8_t set_to_zero_low;uint32_t FF_DL;uint8_t data[2];} IsoTpFirstFrameLong) First frame (long) layout. |
Macros¶
| Type | Name |
|---|---|
| define | ISOTP_INVALID_BS 0xFFFFInvalid block size marker. |
| define | ISOTP_MAX_ERROR_MSG_SIZE 128Max number of characters allowed in an error message. |
| define | ISOTP_PROTOCOL_RESULT_BUFFER_OVFLW -8 |
| define | ISOTP_PROTOCOL_RESULT_ERROR -9 |
| define | ISOTP_PROTOCOL_RESULT_INVALID_FS -5 |
| define | ISOTP_PROTOCOL_RESULT_OK 0Network layer result codes. |
| define | ISOTP_PROTOCOL_RESULT_TIMEOUT_A -1 |
| define | ISOTP_PROTOCOL_RESULT_TIMEOUT_BS -2 |
| define | ISOTP_PROTOCOL_RESULT_TIMEOUT_CR -3 |
| define | ISOTP_PROTOCOL_RESULT_UNEXP_PDU -6 |
| define | ISOTP_PROTOCOL_RESULT_WFT_OVRN -7 |
| define | ISOTP_PROTOCOL_RESULT_WRONG_SN -4 |
| define | ISOTP_RET_ERROR -1 |
| define | ISOTP_RET_INPROGRESS -2 |
| define | ISOTP_RET_LENGTH -7 |
| define | ISOTP_RET_NOSPACE -8 |
| define | ISOTP_RET_NO_DATA -5 |
| define | ISOTP_RET_OK 0Internal return codes. |
| define | ISOTP_RET_OVERFLOW -3 |
| define | ISOTP_RET_TIMEOUT -6 |
| define | ISOTP_RET_WRONG_SN -4 |
| define | IsoTpTimeAfter (a, b) ((int32\_t) ((int32\_t) (b) - (int32\_t) (a)) < 0)Returns true if time a is after timeb . |
| define | LE32TOH (le) /* multi line expression */Compiler-specific defines. |
Detailed Description¶
Project: ISO-TP-C - Embedded-Grade Refactoring & Optimization Author: Anton Vynohradov Email: avynohradov@systemfromscratch.com
Copyright:
Copyright (c) 2026 Anton Vynohradov @license MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SPDX-License-Identifier: MIT
Public Types Documentation¶
enum IsoTpFlowStatus¶
Protocol Control Information (PCI) flow control identifiers.
enum IsoTpFlowStatus {
PCI_FLOW_STATUS_CONTINUE = 0x0,
PCI_FLOW_STATUS_WAIT = 0x1,
PCI_FLOW_STATUS_OVERFLOW = 0x2
};
enum IsoTpProtocolControlInformation¶
Protocol-specific defines.
enum IsoTpProtocolControlInformation {
ISOTP_PCI_TYPE_SINGLE = 0x0,
ISOTP_PCI_TYPE_FIRST_FRAME = 0x1,
TSOTP_PCI_TYPE_CONSECUTIVE_FRAME = 0x2,
ISOTP_PCI_TYPE_FLOW_CONTROL_FRAME = 0x3,
ISOTP_PCI_TYPE_CONSECUTIVE_FRAME = 0x2
};
Protocol Control Information (PCI) types for identifying ISO-TP frames.
enum IsoTpReceiveStatusTypes¶
ISOTP receiver status.
enum IsoTpReceiveStatusTypes {
ISOTP_RECEIVE_STATUS_IDLE,
ISOTP_RECEIVE_STATUS_INPROGRESS,
ISOTP_RECEIVE_STATUS_FULL
};
enum IsoTpSendStatusTypes¶
ISOTP sender status.
enum IsoTpSendStatusTypes {
ISOTP_SEND_STATUS_IDLE,
ISOTP_SEND_STATUS_INPROGRESS,
ISOTP_SEND_STATUS_ERROR
};
Public Functions Documentation¶
function ISOTP_PACKED_STRUCT¶
First frame (long) layout.
ISOTP_PACKED_STRUCT (
{ uint8_t set_to_zero_high :4;uint8_t type :4;uint8_t set_to_zero_low;uint32_t FF_DL;uint8_t data[2];} IsoTpFirstFrameLong
)
+-------------------------+-----------------------+---------+---------+---------+---------+
| byte #0 | byte #1 | byte #2 | byte #3 | byte #4 | byte #5 |
+-------------------------+-----------+-----------+---------+---------+---------+---------+
| nibble #0 | nibble #1 | nibble #2 | nibble #3 | ... |
+-------------+-----------+-----------+-----------+---------------------------------------+
| PCIType = 1 | unused=0 | escape sequence = 0 | FF_DL |
+-------------+-----------+-----------------------+---------------------------------------+
Macro Definition Documentation¶
define ISOTP_INVALID_BS¶
Invalid block size marker.
#define ISOTP_INVALID_BS `0xFFFF`
define ISOTP_MAX_ERROR_MSG_SIZE¶
Max number of characters allowed in an error message.
#define ISOTP_MAX_ERROR_MSG_SIZE `128`
define ISOTP_PROTOCOL_RESULT_BUFFER_OVFLW¶
#define ISOTP_PROTOCOL_RESULT_BUFFER_OVFLW `-8`
define ISOTP_PROTOCOL_RESULT_ERROR¶
#define ISOTP_PROTOCOL_RESULT_ERROR `-9`
define ISOTP_PROTOCOL_RESULT_INVALID_FS¶
#define ISOTP_PROTOCOL_RESULT_INVALID_FS `-5`
define ISOTP_PROTOCOL_RESULT_OK¶
Network layer result codes.
#define ISOTP_PROTOCOL_RESULT_OK `0`
define ISOTP_PROTOCOL_RESULT_TIMEOUT_A¶
#define ISOTP_PROTOCOL_RESULT_TIMEOUT_A `-1`
define ISOTP_PROTOCOL_RESULT_TIMEOUT_BS¶
#define ISOTP_PROTOCOL_RESULT_TIMEOUT_BS `-2`
define ISOTP_PROTOCOL_RESULT_TIMEOUT_CR¶
#define ISOTP_PROTOCOL_RESULT_TIMEOUT_CR `-3`
define ISOTP_PROTOCOL_RESULT_UNEXP_PDU¶
#define ISOTP_PROTOCOL_RESULT_UNEXP_PDU `-6`
define ISOTP_PROTOCOL_RESULT_WFT_OVRN¶
#define ISOTP_PROTOCOL_RESULT_WFT_OVRN `-7`
define ISOTP_PROTOCOL_RESULT_WRONG_SN¶
#define ISOTP_PROTOCOL_RESULT_WRONG_SN `-4`
define ISOTP_RET_ERROR¶
#define ISOTP_RET_ERROR `-1`
define ISOTP_RET_INPROGRESS¶
#define ISOTP_RET_INPROGRESS `-2`
define ISOTP_RET_LENGTH¶
#define ISOTP_RET_LENGTH `-7`
define ISOTP_RET_NOSPACE¶
#define ISOTP_RET_NOSPACE `-8`
define ISOTP_RET_NO_DATA¶
#define ISOTP_RET_NO_DATA `-5`
define ISOTP_RET_OK¶
Internal return codes.
#define ISOTP_RET_OK `0`
define ISOTP_RET_OVERFLOW¶
#define ISOTP_RET_OVERFLOW `-3`
define ISOTP_RET_TIMEOUT¶
#define ISOTP_RET_TIMEOUT `-6`
define ISOTP_RET_WRONG_SN¶
#define ISOTP_RET_WRONG_SN `-4`
define IsoTpTimeAfter¶
Returns true if time a is after timeb .
#define IsoTpTimeAfter (
a,
b
) `((int32_t) ((int32_t) (b) - (int32_t) (a)) < 0)`
define LE32TOH¶
Compiler-specific defines.
#define LE32TOH (
le
) `/* multi line expression */`
OS-specific defines.
Convert a 32-bit value from little-endian to host byte order.
The documentation for this class was generated from the following file inc/isotp_defines.h