Update doc revision and pdf cover.
[apps/low-level-can-service.git] / CAN-binder / libs / isotp-c / src / isotp / isotp.h
1 #ifndef __ISOTP_H__
2 #define __ISOTP_H__
3
4 #include <isotp/isotp_types.h>
5 #include <isotp/send.h>
6 #include <isotp/receive.h>
7 #include <stdint.h>
8 #include <stdbool.h>
9 #include <stdio.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 /* Public: Initialize an IsoTpShims with the given callback functions.
16  *
17  * If any callbacks are not to be used, set them to NULL. For documentation of
18  * the function type signatures, see isotp_types.h. This struct is a handy
19  * encapsulation used to pass the shims around to the various isotp_* functions.
20  *
21  * Returns a struct with the fields initailized to the callbacks.
22  */
23 IsoTpShims isotp_init_shims(LogShim log,
24         SendCanMessageShim send_can_message,
25         SetTimerShim set_timer);
26
27 /* Public: Render an IsoTpMessage as a string into the given buffer.
28  *
29  * message - the message to convert to a string, for debug logging.
30  * destination - the target string buffer.
31  * destination_length - the size of the destination buffer, i.e. the max size
32  *      for the rendered string.
33  */
34 void isotp_message_to_string(const IsoTpMessage* message, char* destination,
35         size_t destination_length);
36
37 #ifdef __cplusplus
38 }
39 #endif
40
41 #endif // __ISOTP_H__