X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Futils%2Fopenxc-utils.hpp;h=61f365b0889b6ce2c9e7fafd5cbaa5a92a55f3a4;hb=fae627b646e9ab709adbd0c60d7582176375e0c3;hp=d36b359bcb700317e63c99addc8120d00e7636ba;hpb=9e444ade872bc436cf12bc12d03c3a5d51ac0b9e;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/utils/openxc-utils.hpp b/low-can-binding/utils/openxc-utils.hpp index d36b359b..61f365b0 100644 --- a/low-can-binding/utils/openxc-utils.hpp +++ b/low-can-binding/utils/openxc-utils.hpp @@ -25,18 +25,27 @@ #include "openxc.pb.h" #include "../diagnostic/active-diagnostic-request.hpp" -openxc_VehicleMessage build_VehicleMessage(active_diagnostic_request_t* request, const DiagnosticResponse& response, float parsed_value); -openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& message); +const openxc_VehicleMessage build_VehicleMessage(active_diagnostic_request_t* request, const DiagnosticResponse& response, float parsed_value); +const openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& message, uint64_t timestamp); +const openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& message); openxc_VehicleMessage build_VehicleMessage(); bool is_valid(const openxc_VehicleMessage& v); -openxc_SimpleMessage build_SimpleMessage(const std::string& name, const openxc_DynamicField& value); -openxc_DynamicField build_DynamicField(const std::string& value); -openxc_DynamicField build_DynamicField(double value); -openxc_DynamicField build_DynamicField(bool value); +const openxc_SimpleMessage build_SimpleMessage(const std::string& name, const openxc_DynamicField& value); +const openxc_DynamicField build_DynamicField(json_object* value); +const openxc_DynamicField build_DynamicField(const char* value); +const openxc_DynamicField build_DynamicField(const std::string& value); +const openxc_DynamicField build_DynamicField(double value); +const openxc_DynamicField build_DynamicField(bool value); +const openxc_DynamicField build_DynamicField(std::vector &array); -openxc_SimpleMessage get_simple_message(const openxc_VehicleMessage& v_msg); +int get_bool_from_DynamicField(const openxc_VehicleMessage& v_msg, bool& ret); +double get_numerical_from_DynamicField(const openxc_VehicleMessage& v_msg); +const std::string get_string_from_DynamicField(const openxc_VehicleMessage& v_msg); +const openxc_SimpleMessage get_simple_message(const openxc_VehicleMessage& v_msg); void jsonify_DynamicField(const openxc_DynamicField& field, json_object* value); -bool jsonify_simple(const openxc_SimpleMessage& s_msg, json_object* json); \ No newline at end of file +bool jsonify_simple(const openxc_SimpleMessage& s_msg, json_object* json); + +bool jsonify_vehicle(const openxc_VehicleMessage& v_msg, json_object* json);