mirror of
https://github.com/anklimov/lighthub
synced 2025-12-08 12:49:50 +03:00
Merge pull request #12 from livello/patch
lighthub/main.cpp:201:77: error: invalid conversion from 'byte* {aka unsigned char*}' to 'const char*' [-fpermissive]
This commit is contained in:
@@ -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);
|
||||||
@@ -522,6 +523,7 @@ void Changed(int i, DeviceAddress addr, int val) {
|
|||||||
void cmdFunctionHelp(int arg_cnt, char **args)
|
void cmdFunctionHelp(int arg_cnt, char **args)
|
||||||
//(char* tokens)
|
//(char* tokens)
|
||||||
{
|
{
|
||||||
|
printFirmwareVersionAndBuildOptions();
|
||||||
Serial.println(F("Use the commands: 'help' - this text\n"
|
Serial.println(F("Use the commands: 'help' - this text\n"
|
||||||
"'set de:ad:be:ef:fe:00' set and store MAC-address in EEPROM\n"
|
"'set de:ad:be:ef:fe:00' set and store MAC-address in EEPROM\n"
|
||||||
"'save' - save config in NVRAM\n"
|
"'save' - save config in NVRAM\n"
|
||||||
@@ -906,21 +908,61 @@ void printFirmwareVersionAndBuildOptions() {
|
|||||||
#endif
|
#endif
|
||||||
Serial.print(F("Config server:"));
|
Serial.print(F("Config server:"));
|
||||||
Serial.println(F(CONFIG_SERVER));
|
Serial.println(F(CONFIG_SERVER));
|
||||||
// Serial.print(F("Firmware MAC Address "));
|
Serial.print(F("Firmware MAC Address "));
|
||||||
// Serial.println(F(QUOTE(CUSTOM_FIRMWARE_MAC))); //Q Macros didn't working with 6 args
|
Serial.println(F(QUOTE(CUSTOM_FIRMWARE_MAC))); //Q Macros didn't working with 6 args
|
||||||
#ifdef DISABLE_FREERAM_PRINT
|
#ifdef DISABLE_FREERAM_PRINT
|
||||||
Serial.println(F("(-)FreeRam printing"));
|
Serial.println(F("(-)FreeRam printing"));
|
||||||
#else
|
#else
|
||||||
Serial.println(F("(+)FreeRam printing"));
|
Serial.println(F("(+)FreeRam printing"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_1W_PIN
|
||||||
|
Serial.print(F("(-)DS2482-100 USE_1W_PIN="));
|
||||||
|
Serial.println(QUOTE(USE_1W_PIN));
|
||||||
|
#else
|
||||||
|
Serial.println(F("(+)DS2482-100"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef Wiz5500
|
||||||
|
Serial.println(F("(+)WizNet5500"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DMX_DISABLE
|
||||||
|
Serial.println(F("(-)DMX"));
|
||||||
|
#else
|
||||||
|
Serial.println(F("(+)DMX"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODBUS_DISABLE
|
||||||
|
Serial.println(F("(-)MODBUS"));
|
||||||
|
#else
|
||||||
|
Serial.println(F("(+)MODBUS"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef OWIRE_DISABLE
|
||||||
|
Serial.println(F("(-)OWIRE"));
|
||||||
|
#else
|
||||||
|
Serial.println(F("(+)OWIRE"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SD_CARD_INSERTED
|
||||||
|
Serial.println(F("(+)SDCARD"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupMacAddress() {
|
void setupMacAddress() {
|
||||||
byte firmwareMacAddress[6]=CUSTOM_FIRMWARE_MAC;
|
|
||||||
// const char *macStr = QUOTE(CUSTOM_FIRMWARE_MAC);
|
#ifdef DEFAULT_FIRMWARE_MAC
|
||||||
// parseBytes(macStr, ':', firmwareMacAddress, 6, 16);
|
byte firmwareMacAddress[6] = DEFAULT_FIRMWARE_MAC;//comma(,) separated hex-array, hard-coded
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CUSTOM_FIRMWARE_MAC
|
||||||
|
byte firmwareMacAddress[6];
|
||||||
|
const char *macStr = QUOTE(CUSTOM_FIRMWARE_MAC);//colon(:) separated from build options
|
||||||
|
parseBytes(macStr, ':', firmwareMacAddress, 6, 16);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool isMacValid = false;
|
bool isMacValid = false;
|
||||||
for (short i = 0; i < 6; i++) {
|
for (short i = 0; i < 6; i++) {
|
||||||
@@ -1088,9 +1130,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);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CUSTOM_FIRMWARE_MAC
|
#ifndef CUSTOM_FIRMWARE_MAC
|
||||||
#define CUSTOM_FIRMWARE_MAC {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0}
|
#define DEFAULT_FIRMWARE_MAC {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user