openxc-utils : Add json value for DynamicField
[apps/agl-service-can-low-level.git] / low-can-binding / utils / openxc-utils.hpp
index d36b359..cf04d22 100644 (file)
 #include <sys/timeb.h>
 
 #include "openxc.pb.h"
+#include "../can/signals.hpp"
 #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<uint8_t> &array);
+const openxc_DynamicField build_DynamicField_json(json_object *value);
 
-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, std::shared_ptr<signal_t> sig, json_object* json);