10 #define _CRT_SECURE_NO_WARNINGS 24 strcpy((
char*) &buffer[pos], stringValue.c_str());
33 strcpy((
char*) buffer, stringValue.c_str());
43 return std::string((
char *) &buffer[start], length);
50 std::string str((
char *) &buffer[0], length);
58 return std::string((
char*) &buffer[9], 2);
66 if (buffer[11] == 0x20)
78 if (i == bufferLength - 2)
84 if (buffer[i] == 0x20)
96 return std::string((
char*) &buffer[start], length);
105 sendBuffer[pos++] = 0x02;
106 sendBuffer[pos++] = 0x02;
107 sendBuffer[pos++] = 0x02;
108 sendBuffer[pos++] = 0x02;
110 colab::addIntegerToBuffer<UINT32>(sendBuffer, pos, length + 1);
111 sendBuffer[pos++] =
's';
114 memcpy(&(sendBuffer[pos]), cmdBuffer, length);
118 UINT8 checksum = sendBuffer[8];
119 for (
int i = 9; i < pos; i++)
121 checksum = checksum ^ sendBuffer[i];
123 colab::addIntegerToBuffer<UINT8>(sendBuffer, pos, checksum);
131 UINT16 width =
sizeof(double);
134 double* valuePtr = (
double*)buffer;
135 double value = *valuePtr;
UINT16 decodeUINT16(BYTE *buffer)
std::string getStringFromBuffer(UINT8 *buffer, UINT16 &pos, UINT16 length)
void addStringToBuffer(UINT8 *buffer, UINT16 &pos, const std::string &stringValue)
void addFrameToBuffer(UINT8 *sendBuffer, UINT8 *cmdBuffer, UINT16 *len)
std::string getCommandStringFromBuffer(UINT8 *buffer)
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
std::string getIdentifierFromBuffer(UINT8 *buffer, UINT16 &nextData, UINT16 bufferLength)
double getDoubleFromBuffer(UINT8 *buffer, UINT16 &pos)