Functions | |
template<typename T > | |
void | addFloatToBuffer (UINT8 *buffer, UINT16 &pos, T floatValue) |
void | addFrameToBuffer (UINT8 *sendBuffer, UINT8 *cmdBuffer, UINT16 *len) |
template<typename T > | |
void | addIntegerToBuffer (UINT8 *buffer, UINT16 &pos, T intValue) |
void | addStringToBuffer (UINT8 *buffer, UINT16 &pos, const std::string &stringValue) |
void | addStringToBuffer (BYTE *buffer, const std::string &stringValue) |
UINT16 | decodeUINT16 (BYTE *buffer) |
std::string | getCommandStringFromBuffer (UINT8 *buffer) |
double | getDoubleFromBuffer (UINT8 *buffer, UINT16 &pos) |
std::string | getIdentifierFromBuffer (UINT8 *buffer, UINT16 &nextData, UINT16 bufferLength) |
template<typename T > | |
T | getIntegerFromBuffer (UINT8 *buffer, UINT16 &pos) |
std::string | getStringFromBuffer (UINT8 *buffer, UINT16 &pos, UINT16 length) |
std::string | getStringFromBuffer (BYTE *&buffer, UINT16 length) |
Accepts all integer types (any bit width and sign). If width of intValue is greater than given type T, the higher bytes are truncated.
The intValue will be stored in BigEndian byte order (as required for CoLaB). pos points then to the first byte of the next data field..
Stores the given stringValue to the given buffer. The string is inserted at position pos, and pos is increased by the number of bytes that were written. If the length of stringValue is longer than the remaining space of the buffer, than filling stopps at the end of buffer.
void colab::addStringToBuffer | ( | BYTE * | buffer, |
const std::string & | stringValue | ||
) |
std::string colab::getCommandStringFromBuffer | ( | UINT8 * | buffer | ) |
std::string colab::getIdentifierFromBuffer | ( | UINT8 * | buffer, |
UINT16 & | nextData, | ||
UINT16 | bufferLength | ||
) |
buffer should point to the BEGIN of the buffer (incl. magic word), bufferLength is the length of the full buffer (incl. magic word and checksum).
Returns the variable or method identifier from buffer. pos points to the begin of the next data after identifier. is pos == 0, there is no more data