Kvaser ISO-TP SDK
Loading...
Searching...
No Matches
kvisotplib.h File Reference

Kvaser ISO-TP API. More...

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <dlfcn.h>

Go to the source code of this file.

Data Structures

struct  AddressInfo
 ISO-TP address information. More...
 
struct  CreateParams
 A struct that holds the parameters for creating an ISO-TP channel. More...
 
struct  WriteParams
 A struct that holds the parameters for an ISO-TP write request. More...
 
struct  IsoTpApi
 A struct with all function pointers for the ISO-TP API. More...
 

Typedefs

typedef enum CanMode CanMode
 Possible CAN modes.
 
typedef enum MType MType
 The type of message to be sent.
 
typedef enum NResult NResult
 The result of the reception or transmission of a message.
 
typedef enum TAType TAType
 The type of target addressing used for the message.
 
typedef struct AddressInfo AddressInfo
 ISO-TP address information.
 
typedef struct CreateParams CreateParams
 A struct that holds the parameters for creating an ISO-TP channel.
 
typedef struct WriteParams WriteParams
 A struct that holds the parameters for an ISO-TP write request.
 
typedef void(WINAPI * FFIndicationCallback) (enum MType m_type, unsigned int can_id, enum TAType ta_type, unsigned char address_extension, unsigned int length, unsigned long long timestamp)
 This callback prototype is used for indicating to the upper layers that a FirstFrame (FF) of a segmented message has been received.
 
typedef void(WINAPI * IndicationCallback) (enum MType m_type, unsigned int can_id, enum TAType ta_type, unsigned char address_extension, unsigned int length, unsigned long long timestamp, const unsigned char *payload, unsigned int payload_length, enum NResult result)
 This callback prototype is used for indicating to the upper layers that a complete message has been received, either a SingleFrame (SF) message or a segmented message.
 
typedef void(WINAPI * ConfirmCallback) (enum MType m_type, unsigned int can_id, enum TAType ta_type, unsigned char address_extension, unsigned long long timestamp, enum NResult result, unsigned int request_handle)
 This callback prototype is used for confirming to the upper layers that a write request has been completed, either a SingleFrame (SF) write request or a segmented data transfer request.
 
typedef bool(WINAPI * isotp_start_log_t) ()
 Function prototype for starting the logger for the library.
 
typedef int(WINAPI * isotp_create_t) (const struct CreateParams *create_params)
 Function prototype for creating and opening a new ISO-TP channel.
 
typedef void(WINAPI * isotp_destroy_t) (int isotp_handle)
 Function prototype for closing and removing the ISO-TP channel with the specified handle.
 
typedef bool(WINAPI * isotp_register_callbacks_t) (int isotp_handle, FFIndicationCallback ff_indication_callback, IndicationCallback indication_callback, ConfirmCallback confirm_callback)
 Function prototype for registering callback functions for the ISO-TP channel.
 
typedef bool(WINAPI * isotp_set_full_duplex_t) (int isotp_handle, bool value)
 Function prototype for setting the full_duplex settings.
 
typedef bool(WINAPI * isotp_set_j1939_priority_masking_t) (int isotp_handle, bool value)
 Function prototype for setting the j1939_priority_masking settings.
 
typedef bool(WINAPI * isotp_set_pad_value_t) (int isotp_handle, unsigned char value)
 Function prototype for setting the pad_value settings.
 
typedef bool(WINAPI * isotp_set_block_size_t) (int isotp_handle, unsigned char value)
 Function prototype for setting the block_size settings.
 
typedef bool(WINAPI * isotp_set_min_separation_time_t) (int isotp_handle, unsigned char value)
 Function prototype for setting the min_separation_time settings.
 
typedef bool(WINAPI * isotp_set_block_size_override_t) (int isotp_handle, unsigned char value)
 Function prototype for setting the block_size_override settings.
 
typedef bool(WINAPI * isotp_set_min_separation_time_override_t) (int isotp_handle, unsigned char value)
 Function prototype for setting the min_separation_time_override settings.
 
typedef bool(WINAPI * isotp_set_cr_max_t) (int isotp_handle, unsigned int value)
 Function prototype for setting the cr_max settings.
 
typedef bool(WINAPI * isotp_set_a_max_t) (int isotp_handle, unsigned int value)
 Function prototype for setting the a_max settings.
 
typedef bool(WINAPI * isotp_set_bs_max_t) (int isotp_handle, unsigned int value)
 Function prototype for setting the bs_max settings.
 
typedef bool(WINAPI * isotp_set_wft_max_t) (int isotp_handle, unsigned int value)
 Function prototype for setting the wft_max settings.
 
typedef int(WINAPI * isotp_open_t) (int isotp_handle)
 Function prototype for opening the specified ISO-TP channel and taking its CAN channel bus-on.
 
typedef int(WINAPI * isotp_close_t) (int isotp_handle)
 Function prototype for closing this channel and taking its CAN channel off-bus.
 
typedef bool(WINAPI * isotp_write_t) (int isotp_handle, const struct WriteParams *write_params)
 Function prototype for sending a message.
 
typedef struct IsoTpApi IsoTpApi
 A struct with all function pointers for the ISO-TP API.
 
typedef bool(WINAPI * isotp_get_api_t) (IsoTpApi *pApi)
 Get the ISO-TP API.
 

Enumerations

enum  CanMode { Can , CanFd , CanFdNonIso }
 Possible CAN modes. More...
 
enum  MType { Diagnostics = 1 , RemoteDiagnostics = 2 }
 The type of message to be sent. More...
 
enum  NResult {
  Ok = 0 , TimeoutA = 1 , TimeoutBs = 2 , TimeoutCr = 3 ,
  WrongSN = 4 , InvalidFS = 5 , UnexpPDU = 6 , WftOvrn = 7 ,
  BufferOvflw = 8 , Error = 9
}
 The result of the reception or transmission of a message. More...
 
enum  TAType {
  PhysicalCanStandard = 1 , FunctionalCanStandard = 2 , PhysicalCanFdStandard = 3 , FunctionalCanFdStandard = 4 ,
  PhysicalCanExtended = 5 , FunctionalCanExtended = 6 , PhysicalCanFdExtended = 7 , FunctionalCanFdExtended = 8
}
 The type of target addressing used for the message. More...
 

Functions

void clear_api (IsoTpApi *pApi)
 Clears the contents of an ISO-TP API structure.
 
IsoTpApi create_api ()
 Create a new ISO-TP API structure.
 
void unload_library (IsoTpApi *pApi)
 Unload the Kvaser ISO-TP library and clear the API structure.
 
IsoTpApi load_library (const char *lib_path)
 Load the Kvaser ISO-TP library.
 

Detailed Description

Kvaser ISO-TP API.

This header file defines the Kvaser ISO-TP API, which provides functions for creating and managing ISO-TP channels.

Typedef Documentation

◆ ConfirmCallback

typedef void(WINAPI * ConfirmCallback) (enum MType m_type, unsigned int can_id, enum TAType ta_type, unsigned char address_extension, unsigned long long timestamp, enum NResult result, unsigned int request_handle)

This callback prototype is used for confirming to the upper layers that a write request has been completed, either a SingleFrame (SF) write request or a segmented data transfer request.

Parameters
m_typeThe message type.
  • 1: Diagnostic messages.
  • 2: Remote-diagnostic messages.
can_idThe CAN identifier.
ta_typeThe target address type.
  • 1: Physical addressing over classical CAN with standard (11-bit) identifier.
  • 2: Functional addressing over classical CAN with standard (11-bit) identifier.
  • 3: Physical addressing over CAN FD with standard (11-bit) identifier.
  • 4: Functional addressing over CAN FD with standard (11-bit) identifier.
  • 5: Physical addressing over classical CAN with extended (29-bit) identifier.
  • 6: Functional addressing over classical CAN with extended (29-bit) identifier.
  • 7: Physical addressing over CAN FD with extended (29-bit) identifier.
  • 8: Functional addressing over CAN FD with extended (29-bit) identifier.
address_extensionThe address extension, ignored if m_type is not RemoteDiagnostics.
timestampThe timestamp (in microseconds) of when the complete message has been transmitted.
resultThe result of the transmission.
request_handleA unique request handle, copied from the original isotp_write call.

◆ FFIndicationCallback

typedef void(WINAPI * FFIndicationCallback) (enum MType m_type, unsigned int can_id, enum TAType ta_type, unsigned char address_extension, unsigned int length, unsigned long long timestamp)

This callback prototype is used for indicating to the upper layers that a FirstFrame (FF) of a segmented message has been received.

Parameters
m_typeThe message type.
  • 1: Diagnostic messages.
  • 2: Remote-diagnostic messages.
can_idThe CAN identifier.
ta_typeThe target address type.
  • 1: Physical addressing over classical CAN with standard (11-bit) identifier.
  • 2: Functional addressing over classical CAN with standard (11-bit) identifier.
  • 3: Physical addressing over CAN FD with standard (11-bit) identifier.
  • 4: Functional addressing over CAN FD with standard (11-bit) identifier.
  • 5: Physical addressing over classical CAN with extended (29-bit) identifier.
  • 6: Functional addressing over classical CAN with extended (29-bit) identifier.
  • 7: Physical addressing over CAN FD with extended (29-bit) identifier.
  • 8: Functional addressing over CAN FD with extended (29-bit) identifier.
address_extensionThe address extension, ignored if m_type is not RemoteDiagnostics.
lengthThe total length of the message that is being received.
timestampThe timestamp (in microseconds) of the first frame.

◆ IndicationCallback

typedef void(WINAPI * IndicationCallback) (enum MType m_type, unsigned int can_id, enum TAType ta_type, unsigned char address_extension, unsigned int length, unsigned long long timestamp, const unsigned char *payload, unsigned int payload_length, enum NResult result)

This callback prototype is used for indicating to the upper layers that a complete message has been received, either a SingleFrame (SF) message or a segmented message.

Parameters
m_typeThe message type.
  • 1: Diagnostic messages.
  • 2: Remote-diagnostic messages.
can_idThe CAN identifier.
ta_typeThe target address type.
  • 1: Physical addressing over classical CAN with standard (11-bit) identifier.
  • 2: Functional addressing over classical CAN with standard (11-bit) identifier.
  • 3: Physical addressing over CAN FD with standard (11-bit) identifier.
  • 4: Functional addressing over CAN FD with standard (11-bit) identifier.
  • 5: Physical addressing over classical CAN with extended (29-bit) identifier.
  • 6: Functional addressing over classical CAN with extended (29-bit) identifier.
  • 7: Physical addressing over CAN FD with extended (29-bit) identifier.
  • 8: Functional addressing over CAN FD with extended (29-bit) identifier.
address_extensionThe address extension, ignored if m_type is not RemoteDiagnostics.
lengthThe total length of the message that has been received.
timestampThe timestamp (in microseconds) of the last frame of the message.
payloadThe data payload of the message.
payload_lengthThe length of the data payload.
resultThe result of the reception.

◆ isotp_close_t

typedef int(WINAPI * isotp_close_t) (int isotp_handle)

Function prototype for closing this channel and taking its CAN channel off-bus.

Parameters
isotp_handleThe handle to the ISO-TP channel.
Returns
Zero if success, or an error code if failure.

◆ isotp_create_t

typedef int(WINAPI * isotp_create_t) (const struct CreateParams *create_params)

Function prototype for creating and opening a new ISO-TP channel.

Parameters
create_paramsThe parameters for creating the ISO-TP channel.
Returns
The ISO-TP handle to be used in subsequent calls to this API.

◆ isotp_destroy_t

typedef void(WINAPI * isotp_destroy_t) (int isotp_handle)

Function prototype for closing and removing the ISO-TP channel with the specified handle.

Parameters
isotp_handleThe handle to the ISO-TP channel to be removed.

◆ isotp_get_api_t

typedef bool(WINAPI * isotp_get_api_t) (IsoTpApi *pApi)

Get the ISO-TP API.

Parameters
pApiPointer to the IsoTpApi structure to fill.
Returns
true if the API was successfully retrieved; otherwise false.

◆ isotp_open_t

typedef int(WINAPI * isotp_open_t) (int isotp_handle)

Function prototype for opening the specified ISO-TP channel and taking its CAN channel bus-on.

Parameters
isotp_handleThe handle to the ISO-TP channel.
Returns
Zero if success, or an error code if failure.

◆ isotp_register_callbacks_t

typedef bool(WINAPI * isotp_register_callbacks_t) (int isotp_handle, FFIndicationCallback ff_indication_callback, IndicationCallback indication_callback, ConfirmCallback confirm_callback)

Function prototype for registering callback functions for the ISO-TP channel.

Call this function after creating the ISO-TP channel and before opening it.

Parameters
isotp_handleThe handle to the ISO-TP channel to add callbacks to.
ff_indication_callbackThe FirstFrame (FF) indication callback.
indication_callbackThe message received indication callback.
confirm_callbackThe message transmitted confirmation callback.
Returns
True if succeeded; otherwise false.

◆ isotp_set_a_max_t

typedef bool(WINAPI * isotp_set_a_max_t) (int isotp_handle, unsigned int value)

Function prototype for setting the a_max settings.

Max time allowed between a request and its confirmation, N_As_Max and N_Ar_Max. Specified as milliseconds.

Call this function after creating the ISO-TP channel and before opening it to set the N_As_Max and N_Ar_Max timeout. Default is 1000 milliseconds.

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_block_size_override_t

typedef bool(WINAPI * isotp_set_block_size_override_t) (int isotp_handle, unsigned char value)

Function prototype for setting 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.

Call this function after creating the ISO-TP channel and before opening it to set the block size override. Default is not set (no override).

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_block_size_t

typedef bool(WINAPI * isotp_set_block_size_t) (int isotp_handle, unsigned char value)

Function prototype for setting the block_size settings.

Call this function after creating the ISO-TP channel and before opening it to set the block size. Default is 0.

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_bs_max_t

typedef bool(WINAPI * isotp_set_bs_max_t) (int isotp_handle, unsigned int value)

Function prototype for setting the bs_max settings.

Max allowed time until reception of next flow control frame, N_Bs_Max. Specified as milliseconds.

Call this function after creating the ISO-TP channel and before opening it to set the N_Bs_Max timeout. Default is 1000 milliseconds.

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_cr_max_t

typedef bool(WINAPI * isotp_set_cr_max_t) (int isotp_handle, unsigned int value)

Function prototype for setting the cr_max settings.

Max allowed time until reception of the next consecutive frame, N_Cr_Max. Specified as milliseconds.

Call this function after creating the ISO-TP channel and before opening it to set the N_Cr_Max timeout. Default is 1000 milliseconds.

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_full_duplex_t

typedef bool(WINAPI * isotp_set_full_duplex_t) (int isotp_handle, bool value)

Function prototype for setting the full_duplex settings.

Call this function after creating the ISO-TP channel and before opening it to set the full duplex mode. Default is true.

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_j1939_priority_masking_t

typedef bool(WINAPI * isotp_set_j1939_priority_masking_t) (int isotp_handle, bool value)

Function prototype for setting 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.

Call this function after creating the ISO-TP channel and before opening it to set the J1939 priority masking. Default is false.

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_min_separation_time_override_t

typedef bool(WINAPI * isotp_set_min_separation_time_override_t) (int isotp_handle, unsigned char value)

Function prototype for setting 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.

  • If this value is <= 0x7F then it is specified as milliseconds.
  • If this value is >= 0xF1 and <= 0xF9 then it is specified as a multiple of 100 microseconds.
  • All other values are invalid and will result in a separation time of 127 milliseconds.

Call this function after creating the ISO-TP channel and before opening it to set the minimum separation time override. Default is not set (no override).

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_min_separation_time_t

typedef bool(WINAPI * isotp_set_min_separation_time_t) (int isotp_handle, unsigned char value)

Function prototype for setting 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.

Call this function after creating the ISO-TP channel and before opening it to set the minimum separation time. Default is 0.

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_pad_value_t

typedef bool(WINAPI * isotp_set_pad_value_t) (int isotp_handle, unsigned char value)

Function prototype for setting the pad_value settings.

The value to be used when padding messages.

Call this function after creating the ISO-TP channel and before opening it to set the padding value. Default is 0xCC.

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_set_wft_max_t

typedef bool(WINAPI * isotp_set_wft_max_t) (int isotp_handle, unsigned int value)

Function prototype for setting 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.

Call this function after creating the ISO-TP channel and before opening it to set the wft_max setting. Default is 0 (no limit).

Parameters
isotp_handleThe handle to the ISO-TP channel.
valueThe new value.
Returns
True if succeeded; otherwise false.

◆ isotp_start_log_t

typedef bool(WINAPI * isotp_start_log_t) ()

Function prototype for starting the logger for the library.

This function configures the logger to log messages to both the console and a file named kvisotplib.log.

Returns
True if succeeded; otherwise false.

◆ isotp_write_t

typedef bool(WINAPI * isotp_write_t) (int isotp_handle, const struct WriteParams *write_params)

Function prototype for sending a message.

The call returns immediately after queuing the message to the driver, so the message has not necessarily been transmitted.

Note
The message has been queued for transmission when this call returns. It has not necessarily been sent.
The Confirm callback will be called when the message has been sent.
Parameters
isotp_handleThe handle to the ISO-TP channel.
write_paramsThe parameters containing the message to send.
Returns
True if succeeded; otherwise false.

◆ IsoTpApi

typedef struct IsoTpApi IsoTpApi

A struct with all function pointers for the ISO-TP API.

Code Snippet:
// Load the Kvaser Iso-TP library
IsoTpApi api = load_library(LIBRARY_PATH);
if (!api.is_valid)
{
fprintf(stderr, "Failed to load Kvaser Iso-TP library!\n");
return 1;
}
// Create an ISO-TP channel
AddressInfo local_address = {0x7E8, false, 0, false, false};
AddressInfo remote_address = {0x7E0, false, 0, false, false};
CanMode can_mode = data_phase_bit_rate == 0 ? Can : CanFd;
CreateParams create_params = {
channel,
can_mode,
true, // support_virtual
bit_rate,
data_phase_bit_rate,
local_address,
remote_address,
};
int isotp_handle = api.isotp_create(&create_params);
if (isotp_handle < 0)
{
fprintf(stderr, "Failed to create ISO-TP channel!\n");
return 1;
}
// Close the ISO-TP channel
if (api.isotp_close(isotp_handle) != 0)
{
fprintf(stderr, "Failed to close ISO-TP channel!\n");
}
else
{
printf("ISO-TP channel closed successfully!\n");
}
// Destroy the ISO-TP channel
api.isotp_destroy(isotp_handle);
IsoTpApi load_library(const char *lib_path)
Load the Kvaser ISO-TP library.
Definition kvisotplib.h:737
CanMode
Possible CAN modes.
Definition kvisotplib.h:40
@ Can
Classic CAN mode.
Definition kvisotplib.h:42
@ CanFd
CAN FD mode.
Definition kvisotplib.h:44
void unload_library(IsoTpApi *pApi)
Unload the Kvaser ISO-TP library and clear the API structure.
Definition kvisotplib.h:712
ISO-TP address information.
Definition kvisotplib.h:115
A struct that holds the parameters for creating an ISO-TP channel.
Definition kvisotplib.h:132
A struct with all function pointers for the ISO-TP API.
Definition kvisotplib.h:575
isotp_destroy_t isotp_destroy
Destroy an existing ISO-TP channel.
Definition kvisotplib.h:595
bool is_valid
A flag indicating if the library was successfully loaded and if the API is available.
Definition kvisotplib.h:583
isotp_create_t isotp_create
Create a new ISO-TP channel.
Definition kvisotplib.h:591
isotp_close_t isotp_close
Close the ISO-TP channel.
Definition kvisotplib.h:651
See also
load_library

◆ NResult

typedef enum NResult NResult

The result of the reception or transmission of a message.

This enum is used to inform about the result of the reception or transmission of a message.

Enumeration Type Documentation

◆ CanMode

enum CanMode

Possible CAN modes.

Enumerator
Can 

Classic CAN mode.

CanFd 

CAN FD mode.

CanFdNonIso 

CAN FD Non-ISO mode.

◆ MType

enum MType

The type of message to be sent.

Enumerator
Diagnostics 

A message that is sent using normal addressing.

RemoteDiagnostics 

A message that is sent using extended addressing.

◆ NResult

enum NResult

The result of the reception or transmission of a message.

This enum is used to inform about the result of the reception or transmission of a message.

Enumerator
Ok 

The reception or transmission was successful.

TimeoutA 

Indicates that the timer N_Ar/N_As has passed its timeout value N_Armax/N_Asmax.

TimeoutBs 

Indicates that the timer N_Bs has passed its timeout value N_Bsmax.

TimeoutCr 

Indicates that the timer N_Cr has passed its timeout value N_Crmax.

WrongSN 

Indicates that the received sequence number is wrong.

InvalidFS 

Indicates that an invalid or unknown FlowStatus was received in a FlowControl (FC) frame.

UnexpPDU 

Indicates that an unexpected PDU was received.

WftOvrn 

Indicates that the receiver has transmitted N_WFTmax FlowControl (FC) frames with FlowStatus = WAIT in a row.

BufferOvflw 

Indicates that the receiver has transmitted a FlowControl (FC) frame with FlowStatus = OVFLW.

Error 

This is a general error code that indicates that the reception or transmission failed.

◆ TAType

enum TAType

The type of target addressing used for the message.

Enumerator
PhysicalCanStandard 

Physical addressing over classical CAN with standard (11-bit) identifier.

FunctionalCanStandard 

Functional addressing over classical CAN with standard (11-bit) identifier.

PhysicalCanFdStandard 

Physical addressing over CAN FD with standard (11-bit) identifier.

FunctionalCanFdStandard 

Functional addressing over CAN FD with standard (11-bit) identifier.

PhysicalCanExtended 

Physical addressing over classical CAN with extended (29-bit) identifier.

FunctionalCanExtended 

Functional addressing over classical CAN with extended (29-bit) identifier.

PhysicalCanFdExtended 

Physical addressing over CAN FD with extended (29-bit) identifier.

FunctionalCanFdExtended 

Functional addressing over CAN FD with extended (29-bit) identifier.

Function Documentation

◆ clear_api()

void clear_api ( IsoTpApi *  pApi)

Clears the contents of an ISO-TP API structure.

Parameters
pApiPointer to the IsoTpApi structure to clear.

◆ create_api()

IsoTpApi create_api ( )

Create a new ISO-TP API structure.

Returns
A new IsoTpApi structure.

◆ load_library()

IsoTpApi load_library ( const char *  lib_path)

Load the Kvaser ISO-TP library.

Parameters
lib_pathThe path to the library to load. Pass NULL to use default names, "kvisotplib.dll" on Windows and "libkvisotplib.so" on Linux.
Returns
An IsoTpApi structure containing the loaded API functions, or an invalid structure on failure. Check the is_valid field to determine success.
Examples
/examples/c_obd_reader/obd_reader.c.

◆ unload_library()

void unload_library ( IsoTpApi *  pApi)

Unload the Kvaser ISO-TP library and clear the API structure.

Parameters
pApiPointer to the IsoTpApi structure to unload.
Examples
/examples/c_obd_reader/obd_reader.c.