22#ifndef KVISOTPLIB_WRAPPER_H
23#define KVISOTPLIB_WRAPPER_H
92 throw std::runtime_error(
"isotp_start_log: Library not loaded or function not found");
128 throw std::runtime_error(
"isotp_create: Library not loaded or function not found");
159 throw std::runtime_error(
"isotp_destroy: Library not loaded or function not found");
198 throw std::runtime_error(
"isotp_register_callbacks: Library not loaded or function not found");
234 throw std::runtime_error(
"isotp_set_full_duplex: Library not loaded or function not found");
276 throw std::runtime_error(
"isotp_set_j1939_priority_masking: Library not loaded or function not found");
312 throw std::runtime_error(
"isotp_set_pad_value: Library not loaded or function not found");
348 throw std::runtime_error(
"isotp_set_block_size: Library not loaded or function not found");
388 throw std::runtime_error(
"isotp_set_min_separation_time: Library not loaded or function not found");
427 throw std::runtime_error(
"isotp_set_block_size_override: Library not loaded or function not found");
470 throw std::runtime_error(
"isotp_set_min_separation_time_override: Library not loaded or function not found");
507 throw std::runtime_error(
"isotp_set_cr_max: Library not loaded or function not found");
544 throw std::runtime_error(
"isotp_set_a_max: Library not loaded or function not found");
581 throw std::runtime_error(
"isotp_set_bs_max: Library not loaded or function not found");
618 throw std::runtime_error(
"isotp_set_wft_max: Library not loaded or function not found");
654 throw std::runtime_error(
"isotp_open: Library not loaded or function not found");
691 throw std::runtime_error(
"isotp_close: Library not loaded or function not found");
746 throw std::runtime_error(
"isotp_write: Library not loaded or function not found");
747 return api.
isotp_write(isotp_handle, write_params);
Wrapper class for loading and using the Kvaser Iso-TP library.
Definition kvisotplib_wrapper.h:34
IsoTpWrapper()
Constructor for the IsoTpWrapper class.
Definition kvisotplib_wrapper.h:39
int close(int isotp_handle)
Closes this channel and takes its CAN channel off-bus.
Definition kvisotplib_wrapper.h:688
int open(int isotp_handle)
Opens the specified ISO-TP channel and takes its CAN channel bus-on.
Definition kvisotplib_wrapper.h:651
bool set_block_size_override(int isotp_handle, uint8_t value)
Sets the block_size_override settings.
Definition kvisotplib_wrapper.h:424
bool set_min_separation_time(int isotp_handle, uint8_t value)
Sets the min_separation_time settings.
Definition kvisotplib_wrapper.h:384
bool set_block_size(int isotp_handle, uint8_t value)
Sets the block_size settings.
Definition kvisotplib_wrapper.h:345
bool set_pad_value(int isotp_handle, uint8_t value)
Sets the pad_value settings.
Definition kvisotplib_wrapper.h:309
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.
Definition kvisotplib_wrapper.h:192
void unload_library()
Unload the Kvaser ISO-TP library.
Definition kvisotplib_wrapper.h:77
int create(const struct CreateParams *create_params)
Creates and opens a new ISO-TP channel.
Definition kvisotplib_wrapper.h:125
void destroy(int isotp_handle)
Closes and removes the ISO-TP channel with the specified handle.
Definition kvisotplib_wrapper.h:156
bool start_log()
Starts the logger for the library.
Definition kvisotplib_wrapper.h:89
bool set_a_max(int isotp_handle, unsigned int value)
Sets the a_max settings.
Definition kvisotplib_wrapper.h:540
bool set_wft_max(int isotp_handle, unsigned int value)
Sets the wft_max settings.
Definition kvisotplib_wrapper.h:614
bool set_j1939_priority_masking(int isotp_handle, bool value)
Sets the j1939_priority_masking settings.
Definition kvisotplib_wrapper.h:272
bool load_library(const char *lib_path)
Load the Kvaser ISO-TP library.
Definition kvisotplib_wrapper.h:68
bool set_full_duplex(int isotp_handle, bool value)
Sets the full_duplex settings.
Definition kvisotplib_wrapper.h:231
bool set_min_separation_time_override(int isotp_handle, uint8_t value)
Sets the min_separation_time_override settings.
Definition kvisotplib_wrapper.h:467
bool set_cr_max(int isotp_handle, unsigned int value)
Sets the cr_max settings.
Definition kvisotplib_wrapper.h:503
~IsoTpWrapper()
Destroy the IsoTpWrapper object.
Definition kvisotplib_wrapper.h:48
bool write(int isotp_handle, const struct WriteParams *write_params)
Sends a message.
Definition kvisotplib_wrapper.h:742
bool set_bs_max(int isotp_handle, unsigned int value)
Sets the bs_max settings.
Definition kvisotplib_wrapper.h:577
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
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
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
void clear_api(IsoTpApi *pApi)
Clears the contents of an ISO-TP API structure.
Definition kvisotplib.h:663
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_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
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