Go to the documentation of this file.
26 m_buffer.push_back(
static_cast<uint8_t
>(sInt));
40 reinterpret_cast<const uint8_t*
>(&bigEndianValue),
41 reinterpret_cast<const uint8_t*
>(&bigEndianValue) + 2);
49 reinterpret_cast<const uint8_t*
>(&bigEndianValue),
50 reinterpret_cast<const uint8_t*
>(&bigEndianValue) + 2);
58 reinterpret_cast<const uint8_t*
>(&bigEndianValue),
59 reinterpret_cast<const uint8_t*
>(&bigEndianValue) + 4);
67 reinterpret_cast<const uint8_t*
>(&bigEndianValue),
68 reinterpret_cast<const uint8_t*
>(&bigEndianValue) + 4);
76 reinterpret_cast<const uint8_t*
>(&bigEndianValue),
77 reinterpret_cast<const uint8_t*
>(&bigEndianValue) + 4);
85 reinterpret_cast<const uint8_t*
>(&bigEndianValue),
86 reinterpret_cast<const uint8_t*
>(&bigEndianValue) + 8);
92 *this << static_cast<uint8_t>(
boolean);
98 uint32_t valueUDInt = 0;
103 int byte0 = byteData[0] ^ byteData[4] ^ byteData[8] ^ byteData[12];
104 int byte1 = byteData[1] ^ byteData[5] ^ byteData[9] ^ byteData[13];
105 int byte2 = byteData[2] ^ byteData[6] ^ byteData[10] ^ byteData[14];
106 int byte3 = byteData[3] ^ byteData[7] ^ byteData[11] ^ byteData[15];
107 valueUDInt =
static_cast<uint32_t
>(byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24));
118 const size_t slen = str.length();
119 const size_t max_slen = std::numeric_limits<uint16_t>::max();
120 const size_t efflen = std::min(slen, max_slen);
125 m_buffer.end(), str.begin(), str.begin() +
static_cast<std::string::iterator::difference_type
>(efflen));
184 std::vector<uint8_t> buffer =
m_buffer;
220 *
this << name <<
" ";
CoLaParameterWriter & operator<<(const char *str)
Add a string parameter, must be null-terminated.
CoLaParameterWriter & parameterUSInt(const uint8_t uSInt)
Add a unsigned short (8-bit, range [0, 255]).
CoLaParameterWriter & parameterInt(const int16_t integer)
Add a signed int (16-bit).
Builder for constructing CoLaCommands.
CoLaParameterWriter & parameterBool(const bool boolean)
Add a boolean as a byte, with 0 representing false, and 1 representing true.
CoLaParameterWriter(CoLaCommandType::Enum type, const char *name)
Construct a new CoLaParameterWriter.
CoLaParameterWriter & parameterFlexString(const std::string &str)
Add a string as a flex string.
T nativeToBigEndian(const T &val)
std::vector< uint8_t > m_buffer
CoLaParameterWriter & parameterUDInt(const uint32_t uDInt)
Add an unsigned double int (32-bit, range [0, 4294967295]).
CoLaCommandType::Enum m_type
@ WRITE_VARIABLE_RESPONSE
const unsigned char * getDigest() const
CoLaParameterWriter & parameterSInt(const int8_t sInt)
Add a signed short (8-bit, range [-128, 127]).
CoLaParameterWriter & parameterUInt(const uint16_t uInt)
Add a unsigned int (16-bit, range [0, 65535]).
CoLaParameterWriter & parameterLReal(const double lReal)
Add a IEEE-754 double precision (64-bit).
CoLaParameterWriter & parameterReal(const float real)
Add a IEEE-754 single precision (32-bit).
CoLaParameterWriter & parameterPasswordMD5(const std::string &str)
Add the given password as a UDInt, using MD5 hashing.
void writeHeader(CoLaCommandType::Enum type, const char *name)
CoLaParameterWriter & parameterDInt(const int32_t dInt)
Add an signed double int (32-bit).
const CoLaCommand build()
sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:38:05