]> rtime.felk.cvut.cz Git - rpp-test-sw.git/blobdiff - rpp-test-sw/commands/cmd_can.c
candump: Do not filter messages, show them all
[rpp-test-sw.git] / rpp-test-sw / commands / cmd_can.c
index f5195e94e25567b9f6b274f0cda93d4ff85e5967..3a65e3272d8686034afbcf9057d8baf7c6a98064 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2014 Czech Technical University in Prague
+ * Copyright (C) 2012-2014, 2016 Czech Technical University in Prague
  *
  * Created on: 28.2.2013
  *
@@ -115,22 +115,22 @@ static struct rpp_can_rx_config rx_config[] = {
                .type = RPP_CAN_MIXED,
                .controller = 1,
                .msg_obj = 1,
-               .id = 1,
-               .mask = 0x7fffff,
+               .id = 0,
+               .mask = 0,
        },
        {
                .type = RPP_CAN_MIXED,
                .controller = 2,
                .msg_obj = 1,
-               .id = 1,
-               .mask = 0x7fffff,
+               .id = 0,
+               .mask = 0,
        },
        {
                .type = RPP_CAN_MIXED,
                .controller = 3,
                .msg_obj = 1,
-               .id = 1,
-               .mask = 0x7fffff,
+               .id = 0,
+               .mask = 0,
        }
 };
 
@@ -737,6 +737,11 @@ int cmd_do_can_dump(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
                return 1;
        }
 
+       if (controller_id < 1 || controller_id > 3) {
+               rpp_sci_printf("Invalid controller ID\n");
+               return -CMDERR_NODEV;
+       }
+
        rpp_can_init(&can_config);
 
        while (cmd_io->getc(cmd_io) < 0) {