diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-02 19:45:01 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-02 19:45:01 +0200 |
commit | 4ab2164774bdb9a29b2f180a9013c26c0155628d (patch) | |
tree | eb2e92eb8270c6556f58c1fa21d0159a76d4f8b9 /CAN-binder/low-can-binding/can | |
parent | 7929a62962cff8bbb456bd0c3761dc68afc3d766 (diff) |
Get diag manager's socket into subscription obj
Subscription index map is the socket ID which implies the following:
- All diagnostic messages subscriptions are stored into a vector
holding diagnostic_message and there is 1 socket for all like the
diag manager did.
- Reworked workflow to open a BCM socket and adding an RX filter more flexible.
- Separated methods to handle on_no_clients event.
- Cleaning diagnostic manager code to remove all unneeded stuff now.
- Embed diagnostic response in VehicleMessage decoded message to be able
transmits the PID in event push thread. This is needed by to correctly handle case
when there is no clients subscribed to an AFB event. Else we can't find
the diagnostic message to remove from low_can_subscription vector.
Change-Id: Iab13fd556cda3c69827bcd67f3a23a03cb6a2cf2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-bus.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CAN-binder/low-can-binding/can/can-bus.cpp b/CAN-binder/low-can-binding/can/can-bus.cpp index 9ee649c..78a823c 100644 --- a/CAN-binder/low-can-binding/can/can-bus.cpp +++ b/CAN-binder/low-can-binding/can/can-bus.cpp @@ -189,7 +189,11 @@ void can_bus_t::can_event_push() jo = json_object_new_object(); jsonify_simple(s_message, jo); if(afb_event_push(s[v_message.first]->get_event(), jo) == 0) - on_no_clients(std::string(s_message.name)); + { + if(v_message.second.has_diagnostic_response) + {on_no_clients(s[v_message.first], v_message.second.diagnostic_response.pid);} + on_no_clients(s[v_message.first]); + } } } } |