aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--low-can-binding/can/can-bus.cpp2
-rw-r--r--low-can-binding/utils/openxc-utils.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/low-can-binding/can/can-bus.cpp b/low-can-binding/can/can-bus.cpp
index be40aab5..d5ad485f 100644
--- a/low-can-binding/can/can-bus.cpp
+++ b/low-can-binding/can/can-bus.cpp
@@ -109,6 +109,8 @@ void can_bus_t::process_diagnostic_signals(diagnostic_manager_t& manager, const
int subscription_id = can_message.get_sub_id();
openxc_VehicleMessage vehicle_message = manager.find_and_decode_adr(can_message);
+ if (can_message.get_timestamp())
+ {vehicle_message.timestamp = can_message.get_timestamp();}
if( (vehicle_message.has_simple_message && vehicle_message.simple_message.has_name) &&
s.find(subscription_id) != s.end() && afb_event_is_valid(s[subscription_id]->get_event()))
{
diff --git a/low-can-binding/utils/openxc-utils.cpp b/low-can-binding/utils/openxc-utils.cpp
index 35b7d9c9..3db964d8 100644
--- a/low-can-binding/utils/openxc-utils.cpp
+++ b/low-can-binding/utils/openxc-utils.cpp
@@ -366,7 +366,7 @@ bool jsonify_vehicle(const openxc_VehicleMessage& v_msg, json_object* json)
{
if(v_msg.has_timestamp)
{
- json_object_object_add(json, "timestamp", json_object_new_double(v_msg.timestamp));
+ json_object_object_add(json, "timestamp", json_object_new_int64(v_msg.timestamp));
return true;
}
return true;