Page 1 of 1

BUG: Temp SetPoint is 1 bytes, buffer overread

Posted: 19 Oct 2019 21:37
by bdaradt2
Hi there,

Spent hours debugging why I was getting garbage values in my setter callback. Apparently, the packets sent when doing a Set Setpoint in Homeseer is only 1 byte long for the data, and the code expect two. Is it 1) a bug in homeseer, 2) a bug in the GetCapabilities callback or 3) a bug in the Setpoint callback?

More info:
Z-Uno bootloader version:2.1.5
Security:none
Frequency:us
Device included:yes/
Device included securely by controller:no
Controller:Homeseer
Connected peripherals:
Mostly, a DS18B20 with the sample code from the ShieldConfigurator.

Code:
I tweaked the code in ZWSupport.ucxt to make it work, and demonstrate the problem:

Code: Select all

            
            case ZUNO_CALLBACK_COMMANDHANDLER_THERMOSTAT_SETPOINT_SET:
                LOGGING_UART.println("SetPoint set");
                if(!mapThermoMode())
                    break;
                // Temperature
                if (callback_data.param1.bParam == 5){
                    LOGGING_UART.println("One Byte"); // THIS IS WHAT IS BEING HIT!
                    g_channel_value.buffParam[0] = g_cmd[4];
                    g_channel_value.buffParam[1] = 0;
                }
                else {
                    LOGGING_UART.println("Two bytes");
                    g_channel_value.buffParam[0] = g_cmd[5];
                    g_channel_value.buffParam[1] = g_cmd[4];
                }
Debug output:
callback_data.param1.bParam is 5, so I get "One Byte" in the output, and it works with the code below, but I'm limited to one byte... which is odd, because the temperature sensor itself it working fine with two bytes, and if I set the value manually in code the Get_Setpoint will successfully send two bytes in the result. But Homeseer sends only one byte...

Re: BUG: Temp SetPoint is 1 bytes, buffer overread

Posted: 20 Oct 2019 11:27
by PoltoS
According to our spec and to ThermostatSetpoint CapabilitiesReport the size is 2 bytes. It is a bug in HS I suppose.

Please report it to HS support team