diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-02 17:51:18 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-02 17:51:18 +0200 |
commit | f44a5b1549bc4c8a84d0dedf4a8b1e4220a34f42 (patch) | |
tree | 2368f764aa2f10bf9927096f5222dc4cab94a838 /CAN-binder/libs/isotp-c/src/isotp/isotp.h | |
parent | d170c9faeae2cf29c19f3523714ecdf58be73bed (diff) | |
parent | ee24440b7c123ab1b0317e57be33e837a1cb51f1 (diff) |
Add 'CAN-binder/libs/isotp-c/' from commit 'ee24440b7c123ab1b0317e57be33e837a1cb51f1'
git-subtree-dir: CAN-binder/libs/isotp-c
git-subtree-mainline: d170c9faeae2cf29c19f3523714ecdf58be73bed
git-subtree-split: ee24440b7c123ab1b0317e57be33e837a1cb51f1
Diffstat (limited to 'CAN-binder/libs/isotp-c/src/isotp/isotp.h')
-rw-r--r-- | CAN-binder/libs/isotp-c/src/isotp/isotp.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/CAN-binder/libs/isotp-c/src/isotp/isotp.h b/CAN-binder/libs/isotp-c/src/isotp/isotp.h new file mode 100644 index 00000000..3a3658c7 --- /dev/null +++ b/CAN-binder/libs/isotp-c/src/isotp/isotp.h @@ -0,0 +1,41 @@ +#ifndef __ISOTP_H__ +#define __ISOTP_H__ + +#include <isotp/isotp_types.h> +#include <isotp/send.h> +#include <isotp/receive.h> +#include <stdint.h> +#include <stdbool.h> +#include <stdio.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Public: Initialize an IsoTpShims with the given callback functions. + * + * If any callbacks are not to be used, set them to NULL. For documentation of + * the function type signatures, see isotp_types.h. This struct is a handy + * encapsulation used to pass the shims around to the various isotp_* functions. + * + * Returns a struct with the fields initailized to the callbacks. + */ +IsoTpShims isotp_init_shims(LogShim log, + SendCanMessageShim send_can_message, + SetTimerShim set_timer); + +/* Public: Render an IsoTpMessage as a string into the given buffer. + * + * message - the message to convert to a string, for debug logging. + * destination - the target string buffer. + * destination_length - the size of the destination buffer, i.e. the max size + * for the rendered string. + */ +void isotp_message_to_string(const IsoTpMessage* message, char* destination, + size_t destination_length); + +#ifdef __cplusplus +} +#endif + +#endif // __ISOTP_H__ |