summaryrefslogtreecommitdiffstats
path: root/src/isotp/isotp.c
diff options
context:
space:
mode:
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);
}