- Remove now unused forward declaration of active_diagnostic_request_t
- Factorize calling the signals_manager at binding initialization.
- retab...
Bug-AGL: SPEC-2386
Change-Id: I418fddd80ef8b856c198dc697760a6edf0918012
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
can_bus_manager.set_can_devices();
can_bus_manager.start_threads();
can_bus_manager.set_can_devices();
can_bus_manager.start_threads();
+ utils::signals_manager_t& sm = utils::signals_manager_t::instance();
/// Initialize Diagnostic manager that will handle obd2 requests.
/// We pass by default the first CAN bus device to its Initialization.
/// Initialize Diagnostic manager that will handle obd2 requests.
/// We pass by default the first CAN bus device to its Initialization.
// Add a recurring dignostic message request to get engine speed at all times.
openxc_DynamicField search_key = build_DynamicField("diagnostic_messages.engine.speed");
// Add a recurring dignostic message request to get engine speed at all times.
openxc_DynamicField search_key = build_DynamicField("diagnostic_messages.engine.speed");
- struct utils::signals_found sf = utils::signals_manager_t::instance().find_signals(search_key);
+ struct utils::signals_found sf = sm.find_signals(search_key);
if(sf.signals.empty() && sf.diagnostic_messages.size() == 1)
{
if(sf.signals.empty() && sf.diagnostic_messages.size() == 1)
{
struct event_filter_t event_filter;
event_filter.frequency = sf.diagnostic_messages.front()->get_frequency();
struct event_filter_t event_filter;
event_filter.frequency = sf.diagnostic_messages.front()->get_frequency();
- utils::signals_manager_t& sm = utils::signals_manager_t::instance();
std::map<int, std::shared_ptr<low_can_subscription_t> >& s = sm.get_subscribed_signals();
subscribe_unsubscribe_diagnostic_messages(request, true, sf.diagnostic_messages, event_filter, s, true);
std::map<int, std::shared_ptr<low_can_subscription_t> >& s = sm.get_subscribed_signals();
subscribe_unsubscribe_diagnostic_messages(request, true, sf.diagnostic_messages, event_filter, s, true);
std::shared_ptr<utils::socketcan_j1939_t> socket = std::make_shared<utils::socketcan_j1939_t>();
ret = socket->open(subscription.signal_->get_message()->get_bus_device_name(), name, pgn, addr);
subscription.socket_ = socket;
std::shared_ptr<utils::socketcan_j1939_t> socket = std::make_shared<utils::socketcan_j1939_t>();
ret = socket->open(subscription.signal_->get_message()->get_bus_device_name(), name, pgn, addr);
subscription.socket_ = socket;
- }
- else if ( !bus_name.empty())
- {
+ }
+ else if ( !bus_name.empty())
+ {
std::shared_ptr<utils::socketcan_j1939_t> socket = std::make_shared<utils::socketcan_j1939_t>();
ret = socket->open(bus_name, name, pgn, addr);
subscription.socket_ = socket;
std::shared_ptr<utils::socketcan_j1939_t> socket = std::make_shared<utils::socketcan_j1939_t>();
ret = socket->open(bus_name, name, pgn, addr);
subscription.socket_ = socket;
- }
- subscription.index_ = (int)subscription.socket_->socket();
+ }
+ subscription.index_ = (int)subscription.socket_->socket();
* limitations under the License.
*/
* limitations under the License.
*/
-#include "./j1939-message.hpp"
#include <cstring>
#include "../../binding/low-can-hat.hpp"
#include <cstring>
#include "../../binding/low-can-hat.hpp"
+#include "j1939-message.hpp"
///
/// @brief Class constructor
///
/// @brief Class constructor
#include <linux/can/j1939.h>
#include <linux/can/j1939.h>
-#include "./message.hpp"
+#include "message.hpp"
+#include "../../utils/socketcan-j1939.hpp"
#define J1939_MAX_MULTIPACKETS 255
#define J1939_MAX_DLEN J1939_MAX_MULTIPACKETS * CAN_MAX_DLEN
#define J1939_MAX_MULTIPACKETS 255
#define J1939_MAX_DLEN J1939_MAX_MULTIPACKETS * CAN_MAX_DLEN
struct bcm_msg get_bcm_msg();
void set_bcm_msg(struct bcm_msg bcm_msg);
};
struct bcm_msg get_bcm_msg();
void set_bcm_msg(struct bcm_msg bcm_msg);
};
#include "../binding/application.hpp"
#include "../utils/signals.hpp"
#include "can-decoder.hpp"
#include "../binding/application.hpp"
#include "../utils/signals.hpp"
#include "can-decoder.hpp"
-#include "message/can-message.hpp"
#include "can-bus.hpp"
#include "../diagnostic/diagnostic-message.hpp"
#include "canutil/write.h"
#include "can-bus.hpp"
#include "../diagnostic/diagnostic-message.hpp"
#include "canutil/write.h"
#include "openxc.pb.h"
#include "message-definition.hpp"
#include "../utils/timer.hpp"
#include "openxc.pb.h"
#include "message-definition.hpp"
#include "../utils/timer.hpp"
-#include "../utils/socketcan-bcm.hpp"
-#include "message/can-message.hpp"
#include "../diagnostic/diagnostic-message.hpp"
#define MESSAGE_SET_ID 0
#include "../diagnostic/diagnostic-message.hpp"
#define MESSAGE_SET_ID 0
* limitations under the License.
*/
* limitations under the License.
*/
#include "active-diagnostic-request.hpp"
#include "active-diagnostic-request.hpp"
- std::shared_ptr<message_t> msg = std::make_shared<can_message_t>();
+ std::shared_ptr<can_message_t> msg = std::make_shared<can_message_t>();
msg->set_bcm_msg(bcm_msg);
msg->set_bcm_msg(bcm_msg);
///
#define DIAGNOSTIC_RESPONSE_ARBITRATION_ID_OFFSET 0x8
///
#define DIAGNOSTIC_RESPONSE_ARBITRATION_ID_OFFSET 0x8
-class active_diagnostic_request_t;
-
///
/// @brief The core structure for running the diagnostics module of the binding.
///
///
/// @brief The core structure for running the diagnostics module of the binding.
///