]> rtime.felk.cvut.cz Git - canping.git/commitdiff
Merge branch 'master' of git://rtime.felk.cvut.cz/canping
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 10 Sep 2009 06:57:43 +0000 (08:57 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 10 Sep 2009 06:57:43 +0000 (08:57 +0200)
src/vca_canping.c

index 23bdf9883fcf3b6dea9b5666f5caa745e91e9ca4..50c19df83b249af54cf4af51d984ee6795f24f7c 100644 (file)
@@ -248,8 +248,9 @@ void *master_thread(void *arg)
        struct canfilt_t canfilt; /* filter for received messages */
 
        if (!option_open_once) {
-               /* Open can driver */
-               if(vca_open_handle(&vcah, option_device, NULL, 0) < 0) {
+               /* Open the CAN driver and disable (D) reception of
+                * all messages until we setup a filter below. */
+               if(vca_open_handle(&vcah, option_device, "D", 0) < 0) {
                        perror("open");
                        fprintf(stderr, "Error opening %s (for id %d)\n", option_device, ping_id);
                        exit(EXIT_CANNOT_OPEN); 
@@ -466,8 +467,9 @@ void *slave_thread(void *arg)
        struct canfilt_t canfilt; /* filter for received messages */
 
        if (!option_open_once) {
-               /* Open the CAN driver */
-               if(vca_open_handle(&vcah, option_device, NULL, 0) < 0) {
+               /* Open the CAN driver and disable (D) reception of
+                * all messages until we setup a filter below. */
+               if(vca_open_handle(&vcah, option_device, "D", 0) < 0) {
                        perror("open");
                        printf("Error opening %s (for id %d)\n", option_device, ping_id);
                        exit(EXIT_CANNOT_OPEN);