Mr-Markus / ZigbeeNet

A .NET Standard library for working with ZigBee
Eclipse Public License 1.0
130 stars 46 forks source link

Handling of signed integers changed to use signed Convert functions #147

Closed reinux closed 3 years ago

reinux commented 3 years ago

Thermostat.SetpointRaiseLowerCommand takes an Amount parameter, which is a signed byte indicating the temperature up or down in tenths of centigrade.

This throws an exception:

   at System.Convert.ThrowByteOverflowException()
   at System.SByte.System.IConvertible.ToByte(IFormatProvider provider)
   at <StartupCode$FSI_0012>.$FSI_0012.main@()

I've changed DefaultSerializer to handle signed integers separately from unsigned integers.

Tested with a Sinope thermostat.