This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
sdk:scripts:candump [2015/05/05 15:04] 127.0.0.1 external edit |
sdk:scripts:candump [2022/10/21 10:37] (current) schmitt |
||
---|---|---|---|
Line 40: | Line 40: | ||
} | } | ||
- | for (count = 0; count < MAX_MESSAGES;) { | + | for (count = 0; count < MAX_MESSAGES;count++) { |
msg = nb_can_recvmsg(sock, 5); | msg = nb_can_recvmsg(sock, 5); | ||
if (is_void(msg)) continue; | if (is_void(msg)) continue; | ||
Line 80: | Line 80: | ||
timestamp = strftime("%Y-%m-%d %H:%M:%S", now); | timestamp = strftime("%Y-%m-%d %H:%M:%S", now); | ||
fwrite(fp, sprintf("%s %08x: ", timestamp, id)); | fwrite(fp, sprintf("%s %08x: ", timestamp, id)); | ||
- | for (i = 0; i < strlen(data); i++) { | + | for (i = 0; i < len; i++) { |
fwrite(fp, sprintf("%02x ", data[i])); | fwrite(fp, sprintf("%02x ", data[i])); | ||
} | } |