X-Git-Url: https://rtime.felk.cvut.cz/gitweb/canping.git/blobdiff_plain/92214b2447fbe0ccee1f1bdb64e051709089ca0e..9c02efb698d2072ac7de98f5f606b44280c40518:/src/vca_canping.c diff --git a/src/vca_canping.c b/src/vca_canping.c index 23bdf98..50c19df 100644 --- a/src/vca_canping.c +++ b/src/vca_canping.c @@ -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);