fix error with servicecode rendering

This commit is contained in:
proddy
2019-03-12 22:58:14 +01:00
parent 007f8c1da1
commit fb4b23d2cc
3 changed files with 24 additions and 23 deletions

View File

@@ -327,7 +327,7 @@ void showInfo() {
_renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow); _renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow);
_renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr); _renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr);
_renderFloatValue("System pressure", "bar", EMS_Boiler.sysPress); _renderFloatValue("System pressure", "bar", EMS_Boiler.sysPress);
myDebug(" System Service Code: %s(%d)", EMS_Boiler.serviceCodeChar, EMS_Boiler.serviceCode); myDebug(" System Service Code: %s (%d)", EMS_Boiler.serviceCodeChar, EMS_Boiler.serviceCode);
// UBAParametersMessage // UBAParametersMessage
_renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp); _renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp);
@@ -994,7 +994,7 @@ void initEMSESP() {
// call PublishValues without forcing, so using CRC to see if we really need to publish // call PublishValues without forcing, so using CRC to see if we really need to publish
void do_publishValues() { void do_publishValues() {
// don't publish if we're not connected to the EMS bus // don't publish if we're not connected to the EMS bus
if ((ems_getBusConnected()) && (!myESP.getUseSerial()) && myESP.isMQTTConnected() ) { if ((ems_getBusConnected()) && (!myESP.getUseSerial()) && myESP.isMQTTConnected()) {
publishValues(false); publishValues(false);
} }
} }

View File

@@ -950,6 +950,7 @@ void _process_UBAMonitorFast(uint8_t type, uint8_t * data, uint8_t length) {
// read the service code / installation status as appears on the display // read the service code / installation status as appears on the display
EMS_Boiler.serviceCodeChar[0] = char(data[18]); // ascii character 1 EMS_Boiler.serviceCodeChar[0] = char(data[18]); // ascii character 1
EMS_Boiler.serviceCodeChar[1] = char(data[19]); // ascii character 2 EMS_Boiler.serviceCodeChar[1] = char(data[19]); // ascii character 2
EMS_Boiler.serviceCodeChar[2] = '\0'; // null terminate string
// read error code // read error code
EMS_Boiler.serviceCode = (data[20] << 8) + data[21]; EMS_Boiler.serviceCode = (data[20] << 8) + data[21];
@@ -1514,7 +1515,7 @@ void ems_printAllTypes() {
*/ */
void ems_doReadCommand(uint8_t type, uint8_t dest, bool forceRefresh) { void ems_doReadCommand(uint8_t type, uint8_t dest, bool forceRefresh) {
// if not a valid type of boiler is not accessible then quits // if not a valid type of boiler is not accessible then quits
if ( (type == EMS_ID_NONE) || (dest == EMS_ID_NONE) ) { if ((type == EMS_ID_NONE) || (dest == EMS_ID_NONE)) {
return; return;
} }
@@ -1561,13 +1562,13 @@ void ems_sendRawTelegram(char * telegram) {
EMS_Sys_Status.txRetryCount = 0; // reset retry counter EMS_Sys_Status.txRetryCount = 0; // reset retry counter
// get first value, which should be the src // get first value, which should be the src
if ( (p = strtok(telegram, " ,")) ) { // delimiter if ((p = strtok(telegram, " ,"))) { // delimiter
strlcpy(value, p, sizeof(value)); strlcpy(value, p, sizeof(value));
EMS_TxTelegram.data[0] = (uint8_t)strtol(value, 0, 16); EMS_TxTelegram.data[0] = (uint8_t)strtol(value, 0, 16);
} }
// and interate until end // and interate until end
while (p != 0) { while (p != 0) {
if ( (p = strtok(NULL, " ,")) ) { if ((p = strtok(NULL, " ,"))) {
strlcpy(value, p, sizeof(value)); strlcpy(value, p, sizeof(value));
uint8_t val = (uint8_t)strtol(value, 0, 16); uint8_t val = (uint8_t)strtol(value, 0, 16);
EMS_TxTelegram.data[++count] = val; EMS_TxTelegram.data[++count] = val;

View File

@@ -172,7 +172,7 @@ typedef struct { // UBAParameterWW
uint8_t curBurnPow; // Burner current power uint8_t curBurnPow; // Burner current power
float flameCurr; // Flame current in micro amps float flameCurr; // Flame current in micro amps
float sysPress; // System pressure float sysPress; // System pressure
char serviceCodeChar[2]; // 2 character status/service code char serviceCodeChar[3]; // 2 character status/service code
uint16_t serviceCode; // error/service code uint16_t serviceCode; // error/service code
// UBAMonitorSlow // UBAMonitorSlow