using ProGauge_StartItaliana_Probe.MessageEntity.Outgoing; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ProGauge_StartItaliana_Probe.MessageEntity.Incoming { public class TemperatureResponse { /// /// The first number is always 0. /// Then you have temperature in 10th of degree starting from the bottom side /// position in the probe up to the top. Each temperature is signed number /// in case the temperature is negative. /// public IReadOnlyList Values { get; private set; } /// /// /// /// Each number is referred to a temperature sensor inside the probe. public static TemperatureResponse Parse(byte[] raw) { var response = new TemperatureResponse(); var msg = Encoding.ASCII.GetString(raw); var parts = msg.Split(' '); response.Values = parts.Select(p => double.Parse(p)).ToList(); return response; } } }