aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--low-can-binding/utils/socketcan-j1939/socketcan-j1939.cpp6
-rw-r--r--low-can-binding/utils/socketcan-j1939/socketcan-j1939.hpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/low-can-binding/utils/socketcan-j1939/socketcan-j1939.cpp b/low-can-binding/utils/socketcan-j1939/socketcan-j1939.cpp
index e8d85b56..90e68218 100644
--- a/low-can-binding/utils/socketcan-j1939/socketcan-j1939.cpp
+++ b/low-can-binding/utils/socketcan-j1939/socketcan-j1939.cpp
@@ -40,7 +40,7 @@ namespace utils
* @param pgn_mask - The mask to apply to the pgn (No mask : J1939_NO_PGN)
* @param addr_mask - The mask to apply to the addr (No mask : J1939_NO_ADDR)
*/
- void socketcan_j1939_t::add_filter(name_t name, pgn_t pgn, uint8_t addr, name_t name_mask, pgn_t pgn_mask, uint8_t addr_mask)
+ int socketcan_j1939_t::add_filter(name_t name, pgn_t pgn, uint8_t addr, name_t name_mask, pgn_t pgn_mask, uint8_t addr_mask)
{
// AFB_DEBUG("[socketcan_j1939_t][add_filter] PGN : %" PRIu32 " ; NAME : %" PRIu64 " ; ADDR : %" PRIu8, pgn,(long unsigned int)name, addr);
// AFB_DEBUG("PGN_MASK : %" PRIu32 " ; NAME_MASK : %" PRIu64 "; ADDR_MASK : %" PRIu8, pgn_mask,(long unsigned int)name_mask, addr_mask);
@@ -79,7 +79,9 @@ namespace utils
}
if(filter_on)
- setopt(SOL_CAN_J1939, SO_J1939_FILTER, &filter, sizeof(filter));
+ return setopt(SOL_CAN_J1939, SO_J1939_FILTER, &filter, sizeof(filter));
+
+ return 0;
}
/**
diff --git a/low-can-binding/utils/socketcan-j1939/socketcan-j1939.hpp b/low-can-binding/utils/socketcan-j1939/socketcan-j1939.hpp
index f9132972..1ae8d1c9 100644
--- a/low-can-binding/utils/socketcan-j1939/socketcan-j1939.hpp
+++ b/low-can-binding/utils/socketcan-j1939/socketcan-j1939.hpp
@@ -60,7 +60,7 @@ namespace utils
static std::mutex mutex_claiming_;
static std::condition_variable signal_address_claiming_;
void define_tx_address(std::string device_name, name_t name, pgn_t pgn, uint8_t addr);
- void add_filter(name_t name, pgn_t pgn, uint8_t addr, name_t name_mask, pgn_t pgn_mask, uint8_t addr_mask);
+ int add_filter(name_t name, pgn_t pgn, uint8_t addr, name_t name_mask, pgn_t pgn_mask, uint8_t addr_mask);
void define_opt(bool promisc = true, bool recv_own_msgs = true, bool broadcast = true);
};