summaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding/low-can-cb.cpp
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-cb.cpp
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-cb.cpp')
-rw-r--r--low-can-binding/binding/low-can-cb.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp
index 5e03c754..5d5a5170 100644
--- a/low-can-binding/binding/low-can-cb.cpp
+++ b/low-can-binding/binding/low-can-cb.cpp
@@ -314,6 +314,9 @@ static event_filter_t generate_filter(json_object* args)
if (json_object_object_get_ex(filter, "max", &obj)
&& (json_object_is_type(obj, json_type_double) || json_object_is_type(obj, json_type_int)))
event_filter.max = (float)json_object_get_double(obj);
+ if (json_object_object_get_ex(filter, "promisc", &obj)
+ && (json_object_is_type(obj, json_type_boolean)))
+ event_filter.promisc = (bool)json_object_get_boolean(obj);
if (json_object_object_get_ex(filter, "rx_id", &obj)
&& (json_object_is_type(obj, json_type_int)))
event_filter.rx_id = (canid_t) json_object_get_int(obj);