diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-09 13:06:56 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:10:40 +0100 |
commit | e2411259c39a880338bd2435e994c21268eb3e5c (patch) | |
tree | 454c3e49c3d95e2f013ac3e7fe9f555b218988d2 /src/diagnostic/diagnostic-manager.cpp | |
parent | da7ef40a3eb25f1b74ce5b1ea91b09e29f24a497 (diff) |
Add necessary to be able to initialize diagnostic manager shims.
We have to conform to functions signatures from isotp-c
to have it working.
Change-Id: I429def66f54e53277e87aa99e66292cdb47c1c5f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/diagnostic/diagnostic-manager.cpp')
-rw-r--r-- | src/diagnostic/diagnostic-manager.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/diagnostic/diagnostic-manager.cpp b/src/diagnostic/diagnostic-manager.cpp index b811eda5..1feac97a 100644 --- a/src/diagnostic/diagnostic-manager.cpp +++ b/src/diagnostic/diagnostic-manager.cpp @@ -17,7 +17,8 @@ #include "obd2/diagnostic-manager.hpp" -#include "low-can-binding.hpp" +#include "../configuration.hpp" +#include "../low-can-binding.hpp" diagnostic_manager_t::diagnostic_manager_t() {} @@ -26,6 +27,12 @@ diagnostic_manager_t::diagnostic_manager_t(can_bus_dev_t& bus) : bus_(&bus) {} +bool shims_send(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size) +{ + can_bus_dev_t *can_bus_dev = config->get_diagnostic_manager().get_can_bus_dev(); + return can_bus_dev->shims_send(arbitration_id, data, size); +} + void diagnostic_manager_t::shims_logger(const char* m, ...) { DEBUG(binder_interface, "%s", m); @@ -34,6 +41,10 @@ void diagnostic_manager_t::shims_logger(const char* m, ...) void diagnostic_manager_t::shims_timer() {} +can_bus_dev_t* diagnostic_manager_t::get_can_bus_dev() +{ + return bus_; +} /** * @brief initialize shims used by UDS lib and set initialized_ to true. * It is needed before used the diagnostic manager fully because shims are @@ -41,6 +52,6 @@ void diagnostic_manager_t::shims_timer() */ void diagnostic_manager_t::init_diagnostic_shims() { - DiagnosticShims shims_ = diagnostic_init_shims(shims_logger, bus_.send_can_message, NULL); + DiagnosticShims shims_ = diagnostic_init_shims(shims_logger, shims_send, NULL); initialized_ = true; }
\ No newline at end of file |