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

embeddedRTPS/include/rtps/utils/printutils.h

Committer:
smoritaemb
Date:
2021-12-30
Revision:
0:580aba13d1a1

File content as of revision 0:580aba13d1a1:

//
// 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