17 lines
536 B
C#
17 lines
536 B
C#
using System;
|
|
|
|
namespace Passer.Control.Core {
|
|
|
|
public class TemperatureSensor : Thing {
|
|
public float temp = 0;
|
|
|
|
public TemperatureSensor(Participant participant, byte networkId, byte thingId) : base(participant, networkId, thingId, (byte)Type.TemperatureSensor) {}
|
|
|
|
public override void ProcessBinary(byte[] bytes) {
|
|
byte ix = 0;
|
|
this.temp = LowLevelMessages.ReceiveFloat16(bytes, ref ix);
|
|
Console.WriteLine($"temperature {this.name} = {this.temp} C");
|
|
}
|
|
}
|
|
|
|
} |