Porting mros2 as an Mbed library.
Dependents: mbed-os-example-mros2 example-mbed-mros2-sub-pose example-mbed-mros2-pub-twist example-mbed-mros2-mturtle-teleop
Diff: embeddedRTPS/include/rtps/utils/printutils.h
- Revision:
- 0:580aba13d1a1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/embeddedRTPS/include/rtps/utils/printutils.h Thu Dec 30 21:06:29 2021 +0900 @@ -0,0 +1,29 @@ +// +// Created by andreas on 13.01.19. +// + +#ifndef RTPS_PRINTUTILS_H +#define RTPS_PRINTUTILS_H + +#include "rtps/common/types.h" + +inline void printEntityId(rtps::EntityId_t id) { + for (const auto byte : id.entityKey) { + printf("%i", byte); + } + printf("%i", static_cast<uint8_t>(id.entityKind)); +} + +inline void printGuidPrefix(rtps::GuidPrefix_t prefix) { + for (const auto byte : prefix.id) { + printf("%i", byte); + } +} + +inline void printGuid(rtps::Guid guid) { + printGuidPrefix(guid.prefix); + printf(":"); + printEntityId(guid.entityId); +} + +#endif // RTPS_PRINTUTILS_H