summaryrefslogtreecommitdiffstats
path: root/src/isotp/isotp.c
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-30 18:30:13 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-30 18:30:13 -0500
commitbc7c0205d8dd7550060f6f0bbe8e2064d28ace8c (patch)
treebd68ac749b67fe0c5f592196e562600954417d51 /src/isotp/isotp.c
parent368d36cc15b69882e9d21803f3b8aa7a1c97736e (diff)
Don't use debug function directly in library.
Diffstat (limited to 'src/isotp/isotp.c')
-rw-r--r--src/isotp/isotp.c16
1 files changed, 5 insertions, 11 deletions
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);
}