Bytes -> Binary

This commit is contained in:
Pascal Serrarens 2025-01-16 09:24:49 +01:00
parent c2aff1ee9a
commit 49f5011823
3 changed files with 4 additions and 4 deletions

View File

@ -238,7 +238,7 @@ namespace Passer.Control.Core {
protected virtual void Process(CustomMsg msg) { protected virtual void Process(CustomMsg msg) {
Thing thing = Thing.Get(msg.networkId, msg.thingId); Thing thing = Thing.Get(msg.networkId, msg.thingId);
thing?.ProcessBytes(msg.bytes); thing?.ProcessBinary(msg.bytes);
} }
protected virtual void Process(TextMsg temsgxt) { } protected virtual void Process(TextMsg temsgxt) { }

View File

@ -6,7 +6,7 @@ namespace Passer.Control.Core {
public TemperatureSensor(byte networkId, byte thingId) : base(null, networkId, thingId, (byte)Type.TemperatureSensor) { public TemperatureSensor(byte networkId, byte thingId) : base(null, networkId, thingId, (byte)Type.TemperatureSensor) {
} }
public override void ProcessBytes(byte[] bytes) { public override void ProcessBinary(byte[] bytes) {
byte ix = 0; byte ix = 0;
float temp = LowLevelMessages.ReceiveFloat16(bytes, ref ix); float temp = LowLevelMessages.ReceiveFloat16(bytes, ref ix);
Console.WriteLine($"temperature {this.name} = {temp} C"); Console.WriteLine($"temperature {this.name} = {temp} C");

View File

@ -160,9 +160,9 @@ namespace Passer.Control.Core {
// should recurse over children... // should recurse over children...
} }
public virtual byte[] GenerateBytes() { return new byte[0]; } public virtual byte[] GenerateBinary() { return new byte[0]; }
public virtual void ProcessBytes(byte[] bytes) { public virtual void ProcessBinary(byte[] bytes) {
//if (sensor != null) //if (sensor != null)
// sensor.ProcessBytes(bytes); // sensor.ProcessBytes(bytes);
} }