18 UINT16 length = stringValue.length();
19 strcpy((
char*) &buffer[pos], stringValue.c_str());
28 strcpy((
char*) buffer, stringValue.c_str());
38 return std::string((
char *) &buffer[start], length);
45 std::string str((
char *) &buffer[0], length);
54 return std::string((
char*) &buffer[9], 2);
64 if (buffer[11] == 0x20)
76 if (i == bufferLength - 2)
82 if (buffer[i] == 0x20)
94 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);
133 UINT16 width =
sizeof(double);
136 double* valuePtr = (
double*)buffer;
137 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)
std::string getIdentifierFromBuffer(UINT8 *buffer, UINT16 &nextData, UINT16 bufferLength)
double getDoubleFromBuffer(UINT8 *buffer, UINT16 &pos)