diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-02-22 13:06:24 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-02-22 15:28:12 +0100 |
commit | 836feaecd602e86ea6d954ae018a2d7bbc04aa7a (patch) | |
tree | 4bb43361e8fe8a58505a64fd50ade04000c18d60 /src/can_event_push.cpp | |
parent | 747d58ad84d230f6cf11ac818bab65019df83611 (diff) |
Change way to convert simplemessage into a json
object.
Improve doxygen comments
Change-Id: I794bdc10f9e1ce66ebd4e68dbd6e0c465e3ca5c4
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can_event_push.cpp')
-rw-r--r-- | src/can_event_push.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/can_event_push.cpp b/src/can_event_push.cpp index 703a242c..2842c630 100644 --- a/src/can_event_push.cpp +++ b/src/can_event_push.cpp @@ -22,6 +22,7 @@ void can_event_push(can_bus_t& can_bus) { openxc_VehicleMessage v_message; openxc_SimpleMessage s_message; + json_object* jo; while(can_bus.has_vehicle_message()) { @@ -30,6 +31,10 @@ void can_event_push(can_bus_t& can_bus) std::map<std::string, struct afb_event> subscribed_signals = get_subscribed_signals(); const auto& it_event = subscribed_signals.find(s_message.name); if(it_event != subscribed_signals.end() && afb_event_is_valid(it_event->second)) - afb_event_push(it_event->second, jsonify_simple(s_message)); + { + jo = json_object_new_object(); + jsonify_simple(s_message, jo); + afb_event_push(it_event->second, jo); + } } -} +}
\ No newline at end of file |