Replaced use of Thing type with the values

This commit is contained in:
Pascal Serrarens 2024-12-05 14:11:58 +01:00
parent 6f12854d4f
commit 9919aa6578

View File

@ -144,16 +144,13 @@ namespace Passer.Control {
parentId = data[ix]; parentId = data[ix];
} }
public static bool Send(Client client, Thing obj) { public static bool Send(Client client, byte networkId, byte thingId, byte thingType) {
if (obj == null)
return false;
byte[] data = new byte[4]; byte[] data = new byte[4];
data[0] = ThingMsg.Id; data[0] = ThingMsg.Id;
data[1] = obj.networkId; data[1] = networkId;
data[2] = obj.thingId; data[2] = thingId;
data[3] = obj.objectType; data[3] = thingType;
data[4] = 0x00; // not supported yet data[4] = 0x00; // parent not supported yet
return SendMsg(client, data); return SendMsg(client, data);
} }
public static async Task<bool> Receive(Stream dataStream, Client client, byte packetSize) { public static async Task<bool> Receive(Stream dataStream, Client client, byte packetSize) {