From a6b0a256fba90034f4fbb30af6ec166ba483563e Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sun, 10 May 2015 20:28:28 +0300 Subject: [PATCH] Byte order fix in logging --- .../dynamic_node_id_server/allocation_request_manager.hpp | 2 +- .../include/uavcan/protocol/dynamic_node_id_server/event.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/allocation_request_manager.hpp b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/allocation_request_manager.hpp index 7bd852dd96..a1c2f05b2f 100644 --- a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/allocation_request_manager.hpp +++ b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/allocation_request_manager.hpp @@ -200,7 +200,7 @@ class AllocationRequestManager uint64_t event_agrument = 0; for (uint8_t i = 0; i < 8; i++) { - event_agrument |= static_cast(unique_id[i]) << (i * 8U); + event_agrument |= static_cast(unique_id[i]) << (56U - i * 8U); } trace(TraceAllocationExchangeComplete, static_cast(event_agrument)); } diff --git a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/event.hpp b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/event.hpp index b83eff1f87..6a61b8dfdb 100644 --- a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/event.hpp +++ b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/event.hpp @@ -63,7 +63,7 @@ enum TraceCode TraceAllocationUnexpectedStage, // stage number in the request - 1, 2, or 3 // 35 TraceAllocationRequestAccepted, // number of bytes of unique ID after request - TraceAllocationExchangeComplete, // first 8 bytes of unique ID interpreted as signed 64 bit little endian + TraceAllocationExchangeComplete, // first 8 bytes of unique ID interpreted as signed 64 bit big endian TraceAllocationResponse, // allocated node ID Trace11, Trace12,