Remove wrong space- MQTT payload, more memory ctrl

This commit is contained in:
2022-01-21 01:01:46 +03:00
parent 2b3c77bf03
commit b7c6eaaff1
2 changed files with 13 additions and 2 deletions

View File

@@ -887,6 +887,11 @@ int Item::Ctrl(itemCmd cmd, char* subItem, bool allowRecursion)
}
if (itemType==CH_GROUP)
{
if (fr<350)
{
errorSerial<<F("Not enough memory for group operation")<<endl;
return -1;
}
if (allowRecursion && itemArg->type == aJson_Array && operation)
{
digGroup(itemArg,&cmd,subItem);

View File

@@ -1076,13 +1076,18 @@ char * itemCmd::toString(char * Buffer, int bufLen, int sendFlags, bool scale100
{
int len;
strncpy_P(Buffer, commands_P[cmd.cmdCode], bufLen);
strncat(Buffer, " ", bufLen);
//strncat(Buffer, " ", bufLen);
len=strlen(Buffer);
argPtr+=len;
bufLen-=len;
bufLen--;
}
if (sendFlags & SEND_PARAMETERS)
if (isValue() && (sendFlags & SEND_PARAMETERS))
{
strncat(Buffer, " ", bufLen);
bufLen--;
argPtr++;
switch (cmd.itemArgType)
{ short colorTemp;
@@ -1142,6 +1147,7 @@ char * itemCmd::toString(char * Buffer, int bufLen, int sendFlags, bool scale100
default:
;
}
}
return Buffer;
}