From da3592bf320465c3dd178a25dce0c51eab741e1a Mon Sep 17 00:00:00 2001 From: Uriah Date: Sun, 18 Dec 2016 20:41:55 -0800 Subject: [PATCH] correct can_mask --- canopen/can-if.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/canopen/can-if.c b/canopen/can-if.c index 3dff01a..7146106 100644 --- a/canopen/can-if.c +++ b/canopen/can-if.c @@ -4,7 +4,7 @@ // // This file is part of the rSCADA system. // -// rSCADA +// rSCADA // http://www.rSCADA.se // info@rscada.se // @@ -15,11 +15,11 @@ #include #include #include - + #include #include -#include +#include #include #include #include @@ -49,7 +49,7 @@ can_socket_open_timeout(char *interface, unsigned int timeout_sec) fprintf(stderr, "Error: Failed to create socket.\n"); return -1; } - + // set a timeoute for read if (timeout_sec != 0) { @@ -62,7 +62,7 @@ can_socket_open_timeout(char *interface, unsigned int timeout_sec) addr.can_family = AF_CAN; addr.can_ifindex = ifr.ifr_ifindex; bind(sock, (struct sockaddr*)&addr, sizeof(addr)); // XXX Add check - + return sock; } @@ -79,7 +79,7 @@ can_filter_node_set(int sock, uint8_t node) struct can_filter rfilter[1]; rfilter[0].can_id = node; - rfilter[0].can_mask = 0x00; + rfilter[0].can_mask = 0x7f; // seems not to work to chance filters after bind setsockopt(sock, SOL_CAN_RAW, CAN_RAW_FILTER, &rfilter, sizeof(rfilter));