summaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding/low-can-subscription.hpp
diff options
context:
space:
mode:
authorArthur GUYADER <arthur.guyader@iot.bzh>2019-12-12 18:12:01 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 16:25:36 +0100
commit43cc23cd9d0986ae370f5839aa952c6e3eb196d0 (patch)
tree0e99d6a235d50731a0f55c15a722e51887b9555a /low-can-binding/binding/low-can-subscription.hpp
parentc57722b34d38c9843a728829204d2711aaadacbb (diff)
j1939: Follow updates of the kernel
This commit patch j1939 feature after the update of the kernel from linux-can-next to mainline. Now promisc option removes filter of the bind. The option is now a parameter in the event_filter. The feature recv_own isn't available, you can't receive on the same socket an emit frame from you. Not a big problem because receive and send method use two different sockets in the implementation. Change-Id: I5ac410177c1512090827870300b8aa1679477b84 Signed-off-by: Arthur GUYADER <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/binding/low-can-subscription.hpp')
-rw-r--r--low-can-binding/binding/low-can-subscription.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/low-can-binding/binding/low-can-subscription.hpp b/low-can-binding/binding/low-can-subscription.hpp
index fa6b795e..972b6d61 100644
--- a/low-can-binding/binding/low-can-subscription.hpp
+++ b/low-can-binding/binding/low-can-subscription.hpp
@@ -35,12 +35,13 @@ struct event_filter_t
float frequency; ///< frequency - Maximum frequency which will be received and pushed to a subscribed event.
float min; ///< min - Minimum value that the signal doesn't have to go below to be pushed.
float max; ///< max - Maximum value that the signal doesn't have to go above to be pushed.
+ bool promisc; //<promisc - Active mode promisc on socket that permit this feature (j1939)
canid_t rx_id; ///< rx_id - RX_ID for ISO_TP protocol
canid_t tx_id; ///< tx_id - TX_ID for ISO_TP protocol
- event_filter_t() : frequency{0}, min{-__FLT_MAX__}, max{__FLT_MAX__}, rx_id{NO_CAN_ID}, tx_id{NO_CAN_ID} {};
+ event_filter_t() : frequency{0}, min{-__FLT_MAX__}, max{__FLT_MAX__}, promisc{false}, rx_id{NO_CAN_ID}, tx_id{NO_CAN_ID} {};
bool operator==(const event_filter_t& ext) const {
- return frequency == ext.frequency && min == ext.min && max == ext.max && rx_id == ext.rx_id && tx_id == ext.tx_id;
+ return frequency == ext.frequency && min == ext.min && max == ext.max && promisc == ext.promisc && rx_id == ext.rx_id && tx_id == ext.tx_id;
}
};
@@ -87,6 +88,7 @@ public:
float get_frequency() const;
float get_min() const;
float get_max() const;
+ bool get_promisc() const;
canid_t get_rx_id() const;
canid_t get_tx_id() const;
std::shared_ptr<utils::socketcan_t> get_socket();
@@ -95,6 +97,7 @@ public:
void set_min(float min);
void set_max(float max);
void set_index(int index);
+ void set_promisc(bool promisc);
void set_rx_id(canid_t rx_id);
void set_tx_id(canid_t tx_id);
void set_signal(std::shared_ptr<signal_t> signal);