lighthub/main.cpp:201:77: error: invalid conversion from 'byte* {aka unsigned char*}' to 'const char*' [-fpermissive]

This commit is contained in:
livello
2018-04-03 13:28:45 +03:00
parent 50ee8a7c6d
commit 499e74be85

View File

@@ -178,7 +178,8 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) {
Item item(subtopic); Item item(subtopic);
if (item.isValid()) { if (item.isValid()) {
if (item.itemType==CH_GROUP && retaining) return; //Do not restore group channels - they consist not relevant data if (item.itemType == CH_GROUP && retaining)
return; //Do not restore group channels - they consist not relevant data
switch (cmd) { switch (cmd) {
case 0: { case 0: {
short i = 0; short i = 0;
@@ -197,8 +198,8 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) {
case -3: //RGB color in #RRGGBB notation case -3: //RGB color in #RRGGBB notation
{ {
CRGB rgb; CRGB rgb;
if (sscanf(payload,"#%2X%2X%2X",&rgb.r,&rgb.g,&rgb.b)==3) if (sscanf((const char*)payload, "#%2X%2X%2X", &rgb.r, &rgb.g, &rgb.b) == 3) {
{ int Par[3]; int Par[3];
CHSV hsv = rgb2hsv_approximate(rgb); CHSV hsv = rgb2hsv_approximate(rgb);
Par[0] = map(hsv.h, 0, 255, 0, 365); Par[0] = map(hsv.h, 0, 255, 0, 365);
Par[1] = map(hsv.s, 0, 255, 0, 100); Par[1] = map(hsv.s, 0, 255, 0, 100);
@@ -1088,9 +1089,7 @@ void thermoLoop(void) {
Serial.print(F(" Curtemp:")); Serial.print(F(" Curtemp:"));
Serial.print(curtemp); Serial.print(curtemp);
Serial.print(F(" cmd:")); Serial.print(F(" cmd:"));
Serial.print(itemCommand), Serial.print(itemCommand), pinMode(itemPin, OUTPUT);
pinMode(itemPin, OUTPUT);
if (itemCommand == CMD_OFF || itemCommand == CMD_HALT || if (itemCommand == CMD_OFF || itemCommand == CMD_HALT ||
aJson.getArrayItem(itemExtensionArray, IET_ATTEMPTS)->valueint == 0) { aJson.getArrayItem(itemExtensionArray, IET_ATTEMPTS)->valueint == 0) {
digitalWrite(itemPin, LOW); digitalWrite(itemPin, LOW);