diff --git a/lighthub/inputs.cpp b/lighthub/inputs.cpp index be006d9..bbf6e05 100644 --- a/lighthub/inputs.cpp +++ b/lighthub/inputs.cpp @@ -117,7 +117,7 @@ void Input::Parse(aJsonObject * configObj) itemBuffer = aJson.getObjectItem(inputObj, "S"); if (!itemBuffer) { debugSerial<valueint; diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 059d1fe..d7e3014 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -243,7 +243,7 @@ void Item::Parse() { // Todo - avoid static enlarge for every types for (int i = aJson.getArraySize(itemArr); i < 4; i++) aJson.addItemToArray(itemArr, aJson.createItem( - int(defval[i]))); //Enlarge item to 4 elements. VAL=int if no other definition in conf + (long int)defval[i])); //Enlarge item to 4 elements. VAL=int if no other definition in conf itemType = aJson.getArrayItem(itemArr, I_TYPE)->valueint; itemArg = aJson.getArrayItem(itemArr, I_ARG); itemVal = aJson.getArrayItem(itemArr, I_VAL); @@ -462,7 +462,7 @@ void Item::setExt(long int par) // Only store if VAL is int (autogenerated or c if (!itemExt) { for (int i = aJson.getArraySize(itemArr); i <= 4; i++) - aJson.addItemToArray(itemArr, itemExt=aJson.createItem(0)); + aJson.addItemToArray(itemArr, itemExt=aJson.createItem((long int) 0)); //itemExt = aJson.getArrayItem(itemArr, I_EXT); }; @@ -484,7 +484,7 @@ chPersistent * Item::setPersistent(chPersistent * par) if (!itemExt) { for (int i = aJson.getArraySize(itemArr); i <= 4; i++) - aJson.addItemToArray(itemArr, itemExt = aJson.createItem(0)); + aJson.addItemToArray(itemArr, itemExt = aJson.createItem((long int) 0)); //itemExt = aJson.getArrayItem(itemArr, I_EXT); }; @@ -1893,17 +1893,17 @@ int Item::checkFM() { debugSerial<<_HEX(data)<type == aJson_Array) { aJsonObject *airGateObj = aJson.getArrayItem(itemArg, 1); if (airGateObj && airGateObj->type == aJson_String) { @@ -1919,11 +1919,11 @@ int Item::checkFM() { if (node.getResponseBuffer(0) & 8) //Active fault { result = node.readHoldingRegisters(2111 - 1, 1); - if (result == node.ku8MBSuccess) aJson.addNumberToObject(out, "flt", (int) node.getResponseBuffer(0)); + if (result == node.ku8MBSuccess) aJson.addNumberToObject(out, "flt", (long int) node.getResponseBuffer(0)); modbusBusy=0; if (isActive()>0) Ctrl(CMD_OFF); //Shut down /// modbusBusy=1; - } else aJson.addNumberToObject(out, "flt", 0); + } else aJson.addNumberToObject(out, "flt", (long int) 0); delay(50); result = node.readHoldingRegisters(20 - 1, 4); @@ -1945,7 +1945,7 @@ int Item::checkFM() { int16_t pwr = node.getResponseBuffer(3); if (pwr > 0) aJson.addNumberToObject(out, "pwr", pwr / 10.); - else aJson.addNumberToObject(out, "pwr", 0); + else aJson.addNumberToObject(out, "pwr", (long int) 0); if (ftemp > FM_OVERHEAT_CELSIUS && set) { if (mqttClient.connected() && !ethernetIdleCount) diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 4d0ad57..809500d 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -2160,7 +2160,7 @@ short thermoSetCurTemp(char *name, float t) { extArray = aJson.createArray(); //Create Ext Array aJsonObject *ocurt = aJson.createItem(t); //Create float - aJsonObject *oattempts = aJson.createItem(T_ATTEMPTS); //Create int + aJsonObject *oattempts = aJson.createItem((long int) T_ATTEMPTS); //Create int aJson.addItemToArray(extArray, ocurt); aJson.addItemToArray(extArray, oattempts); aJson.addItemToArray(thermoItem, extArray); //Adding to thermoItem