* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
- * Send feedback to <socketcan-users@lists.berlios.de>
+ * Send feedback to <linux-can@vger.kernel.org>
*
*/
fprintf(stderr, " -n <count> (terminate after receiption of <count> CAN frames)\n");
fprintf(stderr, " -r <size> (set socket receive buffer to <size>)\n");
fprintf(stderr, " -d (monitor dropped CAN frames)\n");
+ fprintf(stderr, " -e (dump CAN error frames in human-readable format)\n");
fprintf(stderr, "\n");
fprintf(stderr, "Up to %d CAN interfaces with optional filter sets can be specified\n", MAXSOCK);
fprintf(stderr, "on the commandline in the form: <ifname>[,filter]*\n");
last_tv.tv_sec = 0;
last_tv.tv_usec = 0;
- while ((opt = getopt(argc, argv, "t:ciaSs:b:B:u:ldLn:r:h?")) != -1) {
+ while ((opt = getopt(argc, argv, "t:ciaSs:b:B:u:ldLn:r:he?")) != -1) {
switch (opt) {
case 't':
timestamp = optarg[0];
view |= CANLIB_VIEW_SWAP;
break;
+ case 'e':
+ view |= CANLIB_VIEW_ERROR;
+ break;
+
case 's':
silent = atoi(optarg);
if (silent > SILENT_ON) {
return 1;
}
- if (nbytes < sizeof(struct can_frame)) {
+ if ((size_t)nbytes < sizeof(struct can_frame)) {
fprintf(stderr, "read: incomplete CAN frame\n");
return 1;
}
if (nbytes < 0) {
perror("bridge write");
return 1;
- } else if (nbytes < sizeof(struct can_frame)) {
+ } else if ((size_t)nbytes < sizeof(struct can_frame)) {
fprintf(stderr,"bridge write: incomplete CAN frame\n");
return 1;
}