diff options
author | David Lamparter <equinox@diac24.net> | 2014-04-27 17:53:27 +0000 |
---|---|---|
committer | root <root@beaglebone.local.sublab.org> | 2014-04-27 17:57:40 +0000 |
commit | bc69d53152f7b8fd5ddd8afbee9ec88f47a19a0b (patch) | |
tree | 66d57ed263bfb273a31c690c96b8fda227829db1 /cethcan/can.c | |
parent | 08bac0acd7769ea6087454dd75e16a5b6ddf0afe (diff) |
Miscellaneous foo
Diffstat (limited to 'cethcan/can.c')
-rw-r--r-- | cethcan/can.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cethcan/can.c b/cethcan/can.c index 5145871..39da3f1 100644 --- a/cethcan/can.c +++ b/cethcan/can.c @@ -40,10 +40,12 @@ void can_broadcast(struct can_user *origin, struct can_message *msg) lprintf("invalid CAN message (DLC = %zu)", msg->dlc); return; } - for (size_t i = 0; i < msg->dlc; i++) - sprintf(buf + 3 * i, " %02x", msg->bytes[i]); - lprintf("%s: %08x (%zu)%s", origin->name, - (unsigned)msg->daddr, msg->dlc, buf); + if (verbosity >= 1) { + for (size_t i = 0; i < msg->dlc; i++) + sprintf(buf + 3 * i, " %02x", msg->bytes[i]); + lprintf("%s: %08x (%zu)%s", origin->name, + (unsigned)msg->daddr, msg->dlc, buf); + } for (u = users; u; u = u->next) if (u != origin) |