diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-02 18:31:52 -0500 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-02 18:31:52 -0500 |
commit | fe5f39179f7c85a2924c288149b5ecc8488918b1 (patch) | |
tree | 5c8f5250b136c58dc58338507446f47c2683631e /src | |
parent | 3b25a0491ce9ef9b55c903c6c7f0929bc2910d1a (diff) |
Attempt to print entire payload and fail.
Diffstat (limited to 'src')
-rw-r--r-- | src/isotp/isotp.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/isotp/isotp.c b/src/isotp/isotp.c index 67c644f1..6522f7aa 100644 --- a/src/isotp/isotp.c +++ b/src/isotp/isotp.c @@ -21,15 +21,17 @@ IsoTpShims isotp_init_shims(LogShim log, SendCanMessageShim send_can_message, void isotp_message_to_string(const IsoTpMessage* message, char* destination, size_t destination_length) { - char payload_string[message->size * 2 + 1]; - memset(payload_string, 0, sizeof(payload_string)); - for(int i = 0; i < message->size; i++) { - // TODO, bah this isn't working because snprintf hits the NULL char that - // it wrote the last time and stops cold - /* snprintf(&payload_string[i * 2], 2, "%02x", message->payload[i]); */ - } - snprintf(destination, destination_length, "ID: 0x%02x, Payload: 0x%s", - message->arbitration_id, payload_string); + // TODO why is this still not printing the entire payload? + snprintf(destination, destination_length, "ID: 0x%02x, Payload: 0x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + message->arbitration_id, + message->payload[0], + message->payload[1], + message->payload[2], + message->payload[3], + message->payload[4], + message->payload[5], + message->payload[6], + message->payload[7]); } IsoTpMessage isotp_receive_can_frame(IsoTpShims* shims, IsoTpHandle* handle, |