X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Fbinding%2Flow-can-cb.cpp;h=4be7261e008c4abee759886c2e17a4b4ff02cf31;hb=e28ae5f481c3a0d78bb7d6c21416dc38be541a4d;hp=5e03c754cfa511d06977ba7b3e4d3803fb774440;hpb=cc48ab799cf5357f4d573d80c07f6843e50bc8e8;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp index 5e03c754..4be7261e 100644 --- a/low-can-binding/binding/low-can-cb.cpp +++ b/low-can-binding/binding/low-can-cb.cpp @@ -126,9 +126,7 @@ static int subscribe_unsubscribe_signal(afb_req_t request, * subsciptions. */ if(! request) - { return 0; - } // Event doesn't exist , so let's create it if ((ret = can_subscription->subscribe(request)) < 0) @@ -314,6 +312,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); @@ -482,35 +483,6 @@ void unsubscribe(afb_req_t request) do_subscribe_unsubscribe(request, false); } -/* -static int send_frame(struct canfd_frame& cfd, const std::string& bus_name, socket_type type) -{ - if(bus_name.empty()) - { - return -1; - } - - std::map >& cd = application_t::instance().get_can_devices(); - - if( cd.count(bus_name) == 0) - { - cd[bus_name] = std::make_shared(low_can_subscription_t()); - } - - - if(type == socket_type::BCM) - { - return low_can_subscription_t::tx_send(*cd[bus_name], cfd, bus_name); - } - else if(type == socket_type::J1939) - { - return low_can_subscription_t::j1939_send(*cd[bus_name], cfd, bus_name); - } - else{ - return -1; - } -} -*/ static int send_message(message_t *message, const std::string& bus_name, uint32_t flags, event_filter_t &event_filter, std::shared_ptr signal) { if(bus_name.empty())