From bc7c0205d8dd7550060f6f0bbe8e2064d28ace8c Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Mon, 30 Dec 2013 18:30:13 -0500 Subject: Don't use debug function directly in library. --- src/isotp/isotp.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/isotp/isotp.c') diff --git a/src/isotp/isotp.c b/src/isotp/isotp.c index 7c12d430..f303e214 100644 --- a/src/isotp/isotp.c +++ b/src/isotp/isotp.c @@ -39,15 +39,9 @@ IsoTpHandler isotp_init(IsoTpShims* shims, uint16_t arbitration_id, return handler; } -// TODO this would be better as a "isotp_message_to_string" -void log_isotp_message(const IsoTpMessage* message) { - debug("ID: 0x%02x", message->arbitration_id); - if(message->size > 0) { - debug("Payload:"); - for(int i = 0; i < message->size; i++) { - debug("0x%x", message->payload[i]); - } - } else { - debug("(no payload)"); - } +void isotp_message_to_string(const IsoTpMessage* message, char* destination, + size_t destination_length) { + snprintf(destination, destination_length,"ID: 0x%02x, Payload: 0x%llx", + // TODO the payload may be backwards here + message->arbitration_id, message->payload); } -- cgit 1.2.3-korg