mirror of https://github.com/rusefi/isotp-c.git
Move some functions to main isotp.h file to simplify includes for now.
This commit is contained in:
parent
10a35b0a7c
commit
6bbc83bd1d
|
@ -111,6 +111,12 @@ void isotp_receive_can_frame(IsoTpShims* shims, IsoTpHandle* handle,
|
|||
void isotp_message_to_string(const IsoTpMessage* message, char* destination,
|
||||
size_t destination_length);
|
||||
|
||||
IsoTpHandle isotp_send(IsoTpShims* shims, const uint16_t arbitration_id,
|
||||
const uint8_t* payload, uint16_t size,
|
||||
IsoTpMessageSentHandler callback);
|
||||
|
||||
IsoTpHandle isotp_receive(IsoTpShims* shims, const uint16_t arbitration_id,
|
||||
IsoTpMessageReceivedHandler callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -14,9 +14,6 @@ void isotp_complete_receive(IsoTpHandle* handle, IsoTpMessage* message);
|
|||
void isotp_handle_single_frame(IsoTpHandle* handle,
|
||||
IsoTpMessage* message);
|
||||
|
||||
IsoTpHandle isotp_receive(IsoTpShims* shims, const uint16_t arbitration_id,
|
||||
IsoTpMessageReceivedHandler callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -83,8 +83,7 @@ void can_frame_sent(const uint16_t arbitration_id, const uint8_t* payload,
|
|||
|
||||
void setup() {
|
||||
SHIMS = isotp_init_shims(debug, mock_send_can, mock_set_timer);
|
||||
// TODO
|
||||
/* HANDLE = isotp_receive(&SHIMS, 0x2a, message_received); */
|
||||
HANDLE = isotp_receive(&SHIMS, 0x2a, message_received);
|
||||
last_message_sent_payload = malloc(MAX_ISO_TP_MESSAGE_SIZE);
|
||||
last_message_received_payload = malloc(MAX_ISO_TP_MESSAGE_SIZE);
|
||||
memset(last_can_payload_sent, 0, sizeof(last_can_payload_sent));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <isotp/isotp.h>
|
||||
#include <isotp/receive.h>
|
||||
#include <check.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
@ -30,7 +30,7 @@ extern void setup();
|
|||
START_TEST (test_send_empty_payload)
|
||||
{
|
||||
uint16_t arbitration_id = 0x2a;
|
||||
IsoTpHandle foo = isotp_send(&SHIMS, arbitration_id, NULL, 0, message_sent);
|
||||
IsoTpHandle handle = isotp_send(&SHIMS, arbitration_id, NULL, 0, message_sent);
|
||||
fail_unless(handle.success);
|
||||
fail_unless(handle.completed);
|
||||
ck_assert_int_eq(last_message_sent_arb_id, arbitration_id);
|
||||
|
|
Loading…
Reference in New Issue