Fix double digit numbers not being supported
This commit is contained in:
parent
22c93557fd
commit
61b57c8a9e
1 changed files with 8 additions and 3 deletions
|
@ -35,17 +35,22 @@ __SIZE_TYPE__ StreamCommunicator::calculateMessageOutSize(__SIZE_TYPE__ numberOf
|
|||
|
||||
void StreamCommunicator::parseIDs(const int values[], __SIZE_TYPE__ numberOfValues, char *output)
|
||||
{
|
||||
String out = "";
|
||||
__SIZE_TYPE__ outputSize = calculateMessageOutSize(numberOfValues);
|
||||
__SIZE_TYPE__ outputCharPointer = 0;
|
||||
output[outputSize - 1] = '\0';
|
||||
|
||||
for (__SIZE_TYPE__ i = 0; i < numberOfValues; i++)
|
||||
{
|
||||
output[outputCharPointer++] = values[i] + '0';
|
||||
out += values[i];
|
||||
outputCharPointer++;
|
||||
if (outputCharPointer < outputSize - 1)
|
||||
output[outputCharPointer++] = ',';
|
||||
{
|
||||
out += ',';
|
||||
outputCharPointer++;
|
||||
}
|
||||
}
|
||||
strcpy(output, out.c_str());
|
||||
}
|
||||
|
||||
char *StreamCommunicator::getBuffer()
|
||||
{
|
||||
|
|
Reference in a new issue