//using System;
namespace RoboidControl {
///
/// A temperature sensor
///
public class TemperatureSensor : Thing {
///
/// The measured temperature
///
public float temperature = 0;
///
/// Create a temperature sensor with the given ID
///
/// The participant for with the sensor is needed
/// The network ID of the sensor
/// The ID of the thing
public TemperatureSensor(Participant participant, byte networkId, byte thingId) : base(participant, networkId, thingId, (byte)Type.TemperatureSensor) {}
///
/// Function to extract the temperature received in the binary message
///
/// The byte array
public override void ProcessBinary(byte[] bytes) {
byte ix = 0;
this.temperature = LowLevelMessages.ReceiveFloat16(bytes, ref ix);
//Console.WriteLine($"temperature {this.name} = {this.temperature} C");
}
}
}