realigned to maintain code structure
This commit is contained in:
@@ -93,7 +93,7 @@ void incomingMQTT(char* topic, byte* payload,
|
|||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
// Command type
|
// Command type
|
||||||
command = atoi(str);
|
command = atoi(str);
|
||||||
mSetCommand(_mqttMsg, command);
|
mSetCommand(_mqttMsg, command);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -105,9 +105,8 @@ void incomingMQTT(char* topic, byte* payload,
|
|||||||
case 5: {
|
case 5: {
|
||||||
// Sub type
|
// Sub type
|
||||||
_mqttMsg.type = atoi(str);
|
_mqttMsg.type = atoi(str);
|
||||||
|
// Add payload
|
||||||
// Add payload
|
if (command == C_STREAM) {
|
||||||
if (command == C_STREAM) {
|
|
||||||
blen = 0;
|
blen = 0;
|
||||||
uint8_t val;
|
uint8_t val;
|
||||||
while (*payload) {
|
while (*payload) {
|
||||||
@@ -116,14 +115,14 @@ void incomingMQTT(char* topic, byte* payload,
|
|||||||
bvalue[blen] = val;
|
bvalue[blen] = val;
|
||||||
blen++;
|
blen++;
|
||||||
}
|
}
|
||||||
_mqttMsg.set(bvalue, blen);
|
_mqttMsg.set(bvalue, blen);
|
||||||
} else {
|
} else {
|
||||||
char* ca;
|
char* ca;
|
||||||
ca = (char *) payload;
|
ca = (char *) payload;
|
||||||
ca += length;
|
ca += length;
|
||||||
*ca = '\0';
|
*ca = '\0';
|
||||||
_mqttMsg.set((const char*) payload);
|
_mqttMsg.set((const char*) payload);
|
||||||
}
|
}
|
||||||
_available = true;
|
_available = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user