![]() |
Kvaser ISO-TP SDK
|
Wrapper class for loading and using the Kvaser Iso-TP library. More...
#include <kvisotplib_wrapper.h>
Public Member Functions | |
| IsoTpWrapper () | |
| Constructor for the IsoTpWrapper class. | |
| ~IsoTpWrapper () | |
| Destroy the IsoTpWrapper object. | |
| bool | load_library (const char *lib_path) |
| Load the Kvaser ISO-TP library. | |
| void | unload_library () |
| Unload the Kvaser ISO-TP library. | |
| bool | start_log () |
| Starts the logger for the library. | |
| int | create (const struct CreateParams *create_params) |
| Creates and opens a new ISO-TP channel. | |
| void | destroy (int isotp_handle) |
| Closes and removes the ISO-TP channel with the specified handle. | |
| bool | register_callbacks (int isotp_handle, FFIndicationCallback ff_indication_callback, IndicationCallback indication_callback, ConfirmCallback confirm_callback) |
| Registers callback functions to be used by the ISO-TP channel to inform the upper layers on events. | |
| bool | set_full_duplex (int isotp_handle, bool value) |
| Sets the full_duplex settings. | |
| bool | set_j1939_priority_masking (int isotp_handle, bool value) |
| Sets the j1939_priority_masking settings. | |
| bool | set_pad_value (int isotp_handle, uint8_t value) |
| Sets the pad_value settings. | |
| bool | set_block_size (int isotp_handle, uint8_t value) |
| Sets the block_size settings. | |
| bool | set_min_separation_time (int isotp_handle, uint8_t value) |
| Sets the min_separation_time settings. | |
| bool | set_block_size_override (int isotp_handle, uint8_t value) |
| Sets the block_size_override settings. | |
| bool | set_min_separation_time_override (int isotp_handle, uint8_t value) |
| Sets the min_separation_time_override settings. | |
| bool | set_cr_max (int isotp_handle, unsigned int value) |
| Sets the cr_max settings. | |
| bool | set_a_max (int isotp_handle, unsigned int value) |
| Sets the a_max settings. | |
| bool | set_bs_max (int isotp_handle, unsigned int value) |
| Sets the bs_max settings. | |
| bool | set_wft_max (int isotp_handle, unsigned int value) |
| Sets the wft_max settings. | |
| int | open (int isotp_handle) |
| Opens the specified ISO-TP channel and takes its CAN channel bus-on. | |
| int | close (int isotp_handle) |
| Closes this channel and takes its CAN channel off-bus. | |
| bool | write (int isotp_handle, const struct WriteParams *write_params) |
| Sends a message. | |
Wrapper class for loading and using the Kvaser Iso-TP library.
This class handles loading the library, unloading it, and providing access to its functions.
|
inline |
Closes this channel and takes its CAN channel off-bus.
| isotp_handle | The handle to the ISO-TP channel. |
|
inline |
Creates and opens a new ISO-TP channel.
| create_params | The parameters for creating the ISO-TP channel. |
|
inline |
Closes and removes the ISO-TP channel with the specified handle.
| isotp_handle | The handle to the ISO-TP channel to be removed. |
|
inline |
Load the Kvaser ISO-TP library.
| lib_path | The path to the library file. Pass NULL to use default names, "kvisotplib.dll" on Windows and "libkvisotplib.so" on Linux. |
|
inline |
Opens the specified ISO-TP channel and takes its CAN channel bus-on.
| isotp_handle | The handle to the ISO-TP channel. |
|
inline |
Registers callback functions to be used by the ISO-TP channel to inform the upper layers on events.
| isotp_handle | The handle to the ISO-TP channel to add callbacks to. |
| ff_indication_callback | The FirstFrame (FF) indication callback. |
| indication_callback | The message received indication callback. |
| confirm_callback | The message transmitted confirmation callback. |
|
inline |
Sets the a_max settings.
Max time allowed between a request and its confirmation, N_As_Max and N_Ar_Max. Specified as milliseconds.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the block_size settings.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the block_size_override settings.
An optional block size override. If set, then this value will be used instead of the value specified in the flow control frame.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the bs_max settings.
Max allowed time until reception of next flow control frame, N_Bs_Max. Specified as milliseconds.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the cr_max settings.
Max allowed time until reception of the next consecutive frame, N_Cr_Max. Specified as milliseconds.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the full_duplex settings.
True if full duplex is used.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the j1939_priority_masking settings.
When this flag is set, the J1939 priority bits (28-26 of the CAN ID) shall be masked on all received messages. The priority bits shall be masked on all received ISO 15765 flow control messages and will be ignored if they are included in the LocalAddressInfo. However, transmitted ISO 15765 flow control messages shall include any priority bits set in the RemoteAddressInfo structure.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the min_separation_time settings.
This value is coded according to ISO 15765-2, 0x00 to 0x7F is 0 to 127 milliseconds, 0xF1 to 0xF9 is 100 to 900 microseconds, all other values will be interpreted as 127 milliseconds.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the min_separation_time_override settings.
An optional minimum separation time override. If set, then this value will be used instead of the value specified in the flow control frame.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the pad_value settings.
The value to be used when padding messages.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Sets the wft_max settings.
Max number of FC.WAIT frames that can be sent in a row. If set to 0, then there is no limit.
| isotp_handle | The handle to the ISO-TP channel. |
| value | The new value. |
|
inline |
Starts the logger for the library.
This function configures the logger to log messages to both the console and a file named kvisotplib.log.
|
inline |
Sends a message.
The call returns immediately after queuing the message to the driver, so the message has not necessarily been transmitted.
| isotp_handle | The handle to the ISO-TP channel. |
| write_params | The parameters containing the message to send. |