+int low_can_subscription_t::create_rx_filter(std::shared_ptr<signal_t> sig)
+{
+ #ifdef USE_FEATURE_J1939
+ if(sig->get_message()->is_j1939())
+ {
+ return low_can_subscription_t::create_rx_filter_j1939(*this, sig);
+ }
+ else
+ {
+ #endif
+ return low_can_subscription_t::create_rx_filter_can(*this, sig);
+ #ifdef USE_FEATURE_J1939
+ }
+ #endif
+}
+
+
+/// @brief Create a RX_SETUP receive job to be used by the BCM socket for a
+/// diagnostic message subscription.
+///
+/// @return 0 if ok else -1
+int low_can_subscription_t::create_rx_filter(std::shared_ptr<diagnostic_message_t> sig)
+{
+ diagnostic_message_.push_back(sig);
+
+ struct timeval freq = frequency_clock_t(event_filter_.frequency).get_timeval_from_period();
+ //struct timeval timeout = frequency_clock_t(10).get_timeval_from_period();
+ struct timeval timeout = {0,0};
+
+ struct bcm_msg bcm_msg = make_bcm_head(RX_SETUP, OBD2_FUNCTIONAL_BROADCAST_ID, SETTIMER|RX_NO_AUTOTIMER|RX_FILTER_ID, timeout, freq);
+ return create_rx_filter_bcm(*this, bcm_msg);