aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-16 00:21:26 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-19 11:36:42 +0200
commit4175b4d28fe79e5a01d04625b5a50da6214b86b1 (patch)
treeaf2d964bbd67aef7d9f45b5739111bab88044824 /CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp
parent6f872acf6a3a6c3a7a1a1885e5e66bb7231660b2 (diff)
Reworking diagnostic manager to use BCM sockets.
Use 2 sockets: - TX sockets on active_diagnostic_request class as we need X sockets using the same CAN ID "7DF" with different timing settings - RX socket on diagnostic_manager object as we need to read the same CAN ID and process them the same way, there isn't so much need to split them. Change-Id: I7338fd751a033a1d0e8912ee554e2c72c43961c3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp')
-rw-r--r--CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp b/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp
index a160c9c8..65ff0cb5 100644
--- a/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp
+++ b/CAN-binder/low-can-binding/diagnostic/diagnostic-manager.hpp
@@ -21,6 +21,7 @@
#include <map>
#include <vector>
+#include "../utils/socketcan-bcm.hpp"
#include "uds/uds.h"
#include "openxc.pb.h"
#include "../can/can-bus.hpp"
@@ -55,15 +56,18 @@ private:
std::vector<active_diagnostic_request_t*> non_recurring_requests_; /*!< nonrecurringRequests - A list of active one-time diagnostic requests. When a
* response is received for a non-recurring request or it times out, it is removed*/
bool initialized_; /*!< * initialized - True if the DiagnosticsManager has been initialized with shims. It will interface with the uds-c lib*/
+ utils::socketcan_bcm_t socket_; ///< rx_socket_ - a BCM socket with 8 RX_SETUP jobs for the 8 CAN ID on which ECU could respond.
void init_diagnostic_shims();
void reset();
+ int add_rx_filter(uint32_t can_id);
public:
diagnostic_manager_t();
bool initialize();
- std::shared_ptr<can_bus_dev_t> get_can_bus_dev();
+ std::string get_can_bus();
+ active_diagnostic_request_t* get_last_recurring_requests() const;
DiagnosticShims& get_shims();
void find_and_erase(active_diagnostic_request_t* entry, std::vector<active_diagnostic_request_t*>& requests_list);
@@ -76,11 +80,11 @@ public:
const DiagnosticResponse& response, float parsedPayload);
// Subscription parts
- bool add_request(DiagnosticRequest* request, const std::string name,
+ active_diagnostic_request_t* add_request(DiagnosticRequest* request, const std::string name,
bool waitForMultipleResponses, const DiagnosticResponseDecoder decoder,
const DiagnosticResponseCallback callback);
bool validate_optional_request_attributes(float frequencyHz);
- bool add_recurring_request(DiagnosticRequest* request, const char* name,
+ active_diagnostic_request_t* add_recurring_request(DiagnosticRequest* request, const char* name,
bool waitForMultipleResponses, const DiagnosticResponseDecoder decoder,
const DiagnosticResponseCallback callback, float frequencyHz);