Go to the documentation of this file.
40 m_buffer.push_back(
static_cast<uint8_t
>(sInt));
54 reinterpret_cast<const uint8_t*
>(&value),
55 reinterpret_cast<const uint8_t*
>(&value) + 2);
63 reinterpret_cast<const uint8_t*
>(&value),
64 reinterpret_cast<const uint8_t*
>(&value) + 2);
72 reinterpret_cast<const uint8_t*
>(&value),
73 reinterpret_cast<const uint8_t*
>(&value) + 4);
81 reinterpret_cast<const uint8_t*
>(&value),
82 reinterpret_cast<const uint8_t*
>(&value) + 4);
90 reinterpret_cast<const uint8_t*
>(&value),
91 reinterpret_cast<const uint8_t*
>(&value) + 4);
99 reinterpret_cast<const uint8_t*
>(&value),
100 reinterpret_cast<const uint8_t*
>(&value) + 8);
106 *this << static_cast<uint8_t>(
boolean);
112 uint32_t valueUDInt = 0;
119 md5_append(&md5_state,
reinterpret_cast<unsigned char const*
>(str.c_str()), str.size());
124 int byte0 = byteData[0] ^ byteData[4] ^ byteData[8] ^ byteData[12];
125 int byte1 = byteData[1] ^ byteData[5] ^ byteData[9] ^ byteData[13];
126 int byte2 = byteData[2] ^ byteData[6] ^ byteData[10] ^ byteData[14];
127 int byte3 = byteData[3] ^ byteData[7] ^ byteData[11] ^ byteData[15];
128 valueUDInt =
static_cast<uint32_t
>(byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24));
201 std::vector<uint8_t> buffer =
m_buffer;
237 *
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.
void md5_finish(md5_state_t *pms, md5_byte_t digest[16])
CoLaParameterWriter(CoLaCommandType::Enum type, const char *name)
Construct a new CoLaParameterWriter.
void md5_init(md5_state_t *pms)
CoLaParameterWriter & parameterFlexString(const std::string &str)
Add a string as a flex string.
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
void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
@ WRITE_VARIABLE_RESPONSE
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]).
T nativeToColaByteOrder(T x)
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()