212 unsigned char address_extension,
214 unsigned long long timestamp);
243 unsigned char address_extension,
245 unsigned long long timestamp,
246 const unsigned char *payload,
247 unsigned int payload_length,
275 unsigned char address_extension,
276 unsigned long long timestamp,
278 unsigned int request_handle);
395 unsigned char value);
723 FreeLibrary((HMODULE)pApi->
handle);
743 HMODULE handle = LoadLibraryA(lib_path != NULL ? lib_path :
"kvisotplib.dll");
747 if (!get_api || !get_api(&api))
756 void *handle = dlopen(lib_path != NULL ? lib_path :
"libkvisotplib.so", RTLD_LAZY);
760 if (!get_api || !get_api(&api))
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 segmen...
Definition kvisotplib.h:209
bool(WINAPI * isotp_start_log_t)()
Function prototype for starting the logger for the library.
Definition kvisotplib.h:287
bool(WINAPI * isotp_set_min_separation_time_t)(int isotp_handle, unsigned char value)
Function prototype for setting the min_separation_time settings.
Definition kvisotplib.h:394
int(WINAPI * isotp_open_t)(int isotp_handle)
Function prototype for opening the specified ISO-TP channel and taking its CAN channel bus-on.
Definition kvisotplib.h:496
bool(WINAPI * isotp_set_full_duplex_t)(int isotp_handle, bool value)
Function prototype for setting the full_duplex settings.
Definition kvisotplib.h:333
NResult
The result of the reception or transmission of a message.
Definition kvisotplib.h:65
@ Ok
The reception or transmission was successful.
Definition kvisotplib.h:67
@ BufferOvflw
Indicates that the receiver has transmitted a FlowControl (FC) frame with FlowStatus = OVFLW.
Definition kvisotplib.h:83
@ TimeoutBs
Indicates that the timer N_Bs has passed its timeout value N_Bsmax.
Definition kvisotplib.h:71
@ Error
This is a general error code that indicates that the reception or transmission failed.
Definition kvisotplib.h:85
@ TimeoutA
Indicates that the timer N_Ar/N_As has passed its timeout value N_Armax/N_Asmax.
Definition kvisotplib.h:69
@ WftOvrn
Indicates that the receiver has transmitted N_WFTmax FlowControl (FC) frames with FlowStatus = WAIT i...
Definition kvisotplib.h:81
@ WrongSN
Indicates that the received sequence number is wrong.
Definition kvisotplib.h:75
@ InvalidFS
Indicates that an invalid or unknown FlowStatus was received in a FlowControl (FC) frame.
Definition kvisotplib.h:77
@ TimeoutCr
Indicates that the timer N_Cr has passed its timeout value N_Crmax.
Definition kvisotplib.h:73
@ UnexpPDU
Indicates that an unexpected PDU was received.
Definition kvisotplib.h:79
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.
Definition kvisotplib.h:317
bool(WINAPI * isotp_set_cr_max_t)(int isotp_handle, unsigned int value)
Function prototype for setting the cr_max settings.
Definition kvisotplib.h:444
IsoTpApi load_library(const char *lib_path)
Load the Kvaser ISO-TP library.
Definition kvisotplib.h:737
TAType
The type of target addressing used for the message.
Definition kvisotplib.h:92
@ FunctionalCanStandard
Functional addressing over classical CAN with standard (11-bit) identifier.
Definition kvisotplib.h:96
@ PhysicalCanStandard
Physical addressing over classical CAN with standard (11-bit) identifier.
Definition kvisotplib.h:94
@ PhysicalCanFdExtended
Physical addressing over CAN FD with extended (29-bit) identifier.
Definition kvisotplib.h:106
@ FunctionalCanFdExtended
Functional addressing over CAN FD with extended (29-bit) identifier.
Definition kvisotplib.h:108
@ PhysicalCanFdStandard
Physical addressing over CAN FD with standard (11-bit) identifier.
Definition kvisotplib.h:98
@ FunctionalCanExtended
Functional addressing over classical CAN with extended (29-bit) identifier.
Definition kvisotplib.h:104
@ FunctionalCanFdStandard
Functional addressing over CAN FD with standard (11-bit) identifier.
Definition kvisotplib.h:100
@ PhysicalCanExtended
Physical addressing over classical CAN with extended (29-bit) identifier.
Definition kvisotplib.h:102
bool(WINAPI * isotp_set_block_size_t)(int isotp_handle, unsigned char value)
Function prototype for setting the block_size settings.
Definition kvisotplib.h:378
bool(WINAPI * isotp_set_j1939_priority_masking_t)(int isotp_handle, bool value)
Function prototype for setting the j1939_priority_masking settings.
Definition kvisotplib.h:351
bool(WINAPI * isotp_set_pad_value_t)(int isotp_handle, unsigned char value)
Function prototype for setting the pad_value settings.
Definition kvisotplib.h:365
void(WINAPI * isotp_destroy_t)(int isotp_handle)
Function prototype for closing and removing the ISO-TP channel with the specified handle.
Definition kvisotplib.h:303
bool(WINAPI * isotp_get_api_t)(IsoTpApi *pApi)
Get the ISO-TP API.
Definition kvisotplib.h:705
IsoTpApi create_api()
Create a new ISO-TP API structure.
Definition kvisotplib.h:692
bool(WINAPI * isotp_set_bs_max_t)(int isotp_handle, unsigned int value)
Function prototype for setting the bs_max settings.
Definition kvisotplib.h:472
bool(WINAPI * isotp_set_wft_max_t)(int isotp_handle, unsigned int value)
Function prototype for setting the wft_max settings.
Definition kvisotplib.h:486
int(WINAPI * isotp_close_t)(int isotp_handle)
Function prototype for closing this channel and taking its CAN channel off-bus.
Definition kvisotplib.h:505
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 comp...
Definition kvisotplib.h:272
CanMode
Possible CAN modes.
Definition kvisotplib.h:40
@ CanFdNonIso
CAN FD Non-ISO mode.
Definition kvisotplib.h:46
@ Can
Classic CAN mode.
Definition kvisotplib.h:42
@ CanFd
CAN FD mode.
Definition kvisotplib.h:44
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.
Definition kvisotplib.h:431
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 r...
Definition kvisotplib.h:240
bool(WINAPI * isotp_set_a_max_t)(int isotp_handle, unsigned int value)
Function prototype for setting the a_max settings.
Definition kvisotplib.h:458
bool(WINAPI * isotp_set_block_size_override_t)(int isotp_handle, unsigned char value)
Function prototype for setting the block_size_override settings.
Definition kvisotplib.h:411
bool(WINAPI * isotp_write_t)(int isotp_handle, const struct WriteParams *write_params)
Function prototype for sending a message.
Definition kvisotplib.h:521
void clear_api(IsoTpApi *pApi)
Clears the contents of an ISO-TP API structure.
Definition kvisotplib.h:663
void unload_library(IsoTpApi *pApi)
Unload the Kvaser ISO-TP library and clear the API structure.
Definition kvisotplib.h:712
MType
The type of message to be sent.
Definition kvisotplib.h:53
@ Diagnostics
A message that is sent using normal addressing.
Definition kvisotplib.h:55
@ RemoteDiagnostics
A message that is sent using extended addressing.
Definition kvisotplib.h:57
int(WINAPI * isotp_create_t)(const struct CreateParams *create_params)
Function prototype for creating and opening a new ISO-TP channel.
Definition kvisotplib.h:296
ISO-TP address information.
Definition kvisotplib.h:115
bool use_padding
True if message padding should be used.
Definition kvisotplib.h:125
unsigned char address_extension
Address extension.
Definition kvisotplib.h:121
unsigned int id
CAN identifier.
Definition kvisotplib.h:117
bool extended_id
True if the CAN identifier is an extended (29-bit) identifier.
Definition kvisotplib.h:119
bool use_address_extension
True if the message is using extended addressing.
Definition kvisotplib.h:123
A struct that holds the parameters for creating an ISO-TP channel.
Definition kvisotplib.h:132
unsigned int channel
The number of the channel. The CANlib channel number to use.
Definition kvisotplib.h:134
enum CanMode can_mode
The CAN mode to use.
Definition kvisotplib.h:136
unsigned int data_phase_bit_rate
The data phase bit rate to use for the channel. This is only used if the channel is opened with CAN F...
Definition kvisotplib.h:144
struct AddressInfo local_address_info
Contains the CAN ID and address extension (if applicable) for the device end point of the ISO 15765 c...
Definition kvisotplib.h:148
struct AddressInfo remote_address_info
Contains the CAN ID and address extension (if applicable) for the remote/vehicle end point of the ISO...
Definition kvisotplib.h:153
unsigned int bit_rate
The bit rate to use for the channel. If CAN FD, then this is the bit rate used in arbitration....
Definition kvisotplib.h:141
bool support_virtual
True if virtual channels are supported.
Definition kvisotplib.h:138
A struct with all function pointers for the ISO-TP API.
Definition kvisotplib.h:575
isotp_open_t isotp_open
Open the ISO-TP channel.
Definition kvisotplib.h:647
isotp_set_cr_max_t isotp_set_cr_max
Set N_Cr_Max timeout.
Definition kvisotplib.h:631
isotp_set_block_size_override_t isotp_set_block_size_override
Set block size override.
Definition kvisotplib.h:623
isotp_set_block_size_t isotp_set_block_size
Set block size.
Definition kvisotplib.h:615
isotp_destroy_t isotp_destroy
Destroy an existing ISO-TP channel.
Definition kvisotplib.h:595
isotp_start_log_t isotp_start_log
Start logging.
Definition kvisotplib.h:587
isotp_set_full_duplex_t isotp_set_full_duplex
Set full duplex mode.
Definition kvisotplib.h:603
isotp_write_t isotp_write
Write a message to the ISO-TP channel.
Definition kvisotplib.h:655
isotp_set_pad_value_t isotp_set_pad_value
Set padding value.
Definition kvisotplib.h:611
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_set_wft_max_t isotp_set_wft_max
Set wft_max setting.
Definition kvisotplib.h:643
isotp_set_min_separation_time_override_t isotp_set_min_separation_time_override
Set minimum separation time override.
Definition kvisotplib.h:627
isotp_set_min_separation_time_t isotp_set_min_separation_time
Set minimum separation time.
Definition kvisotplib.h:619
isotp_close_t isotp_close
Close the ISO-TP channel.
Definition kvisotplib.h:651
isotp_register_callbacks_t isotp_register_callbacks
Register callback functions.
Definition kvisotplib.h:599
void * handle
Handle to the loaded library.
Definition kvisotplib.h:579
isotp_set_bs_max_t isotp_set_bs_max
Set N_Bs_Max timeout.
Definition kvisotplib.h:639
isotp_set_j1939_priority_masking_t isotp_set_j1939_priority_masking
Set J1939 priority masking.
Definition kvisotplib.h:607
isotp_set_a_max_t isotp_set_a_max
Set N_As_Max and N_Ar_Max timeout.
Definition kvisotplib.h:635
A struct that holds the parameters for an ISO-TP write request.
Definition kvisotplib.h:160
bool use_bit_rate_switch
True if the message should be sent as a CAN FD message and should use bit rate switching....
Definition kvisotplib.h:183
unsigned int can_id
The CAN ID to be used for the message.
Definition kvisotplib.h:165
unsigned char address_extension
The address extension to be used for the message. This field is ignored if the message type is not Re...
Definition kvisotplib.h:174
unsigned int request_handle
A unique request handle, if set to 0 then ConfirmCallback won't be called.
Definition kvisotplib.h:185
enum MType m_type
The message type, diagnostics or remote diagnostics. This is used to determine if the message should ...
Definition kvisotplib.h:163
enum TAType ta_type
The target addressing type. This is used to determine if the message should use standard (11-bit) ide...
Definition kvisotplib.h:170
const unsigned char * payload
The message data to be sent.
Definition kvisotplib.h:176
bool use_padding
True if the message should be padded.
Definition kvisotplib.h:180
unsigned int payload_length
The length of the message data to be sent.
Definition kvisotplib.h:178