protected override void Decode() { if (data == null) { return; } using var ms = new MemoryStream(data); using var br = new BinaryReader(ms); ControllerID = br.ReadInt32(); for (int i = 0; i < 2; i++) { MinSetPoint[i] = br.ReadByte(); MaxSetPoint[i] = br.ReadByte(); } DegC = br.ReadByte(); ControllerType = br.ReadByte(); HWType = br.ReadByte(); ControllerData = br.ReadByte(); EquipFlags = br.ReadInt32(); GenCircuitName = HLMessageTypeHelper.ExtractString(br); CircuitCount = br.ReadInt32(); BodyArray = new BodyDataStructure[CircuitCount]; for (int i = 0; i < CircuitCount; i++) { BodyArray[i] = new BodyDataStructure() { CircuitID = br.ReadInt32(), Name = HLMessageTypeHelper.ExtractString(br), NameIndex = br.ReadByte(), Function = br.ReadByte(), Interface = br.ReadByte(), Flags = br.ReadByte(), ColorSet = br.ReadByte(), ColorPos = br.ReadByte(), ColorStagger = br.ReadByte(), DeviceID = br.ReadByte(), DfaultRT = br.ReadInt16(), Pad1 = br.ReadByte(), Pad2 = br.ReadByte(), }; } ColorCount = br.ReadInt32(); ColorArray = new PentLightColor[ColorCount]; for (int i = 0; i < ColorCount; i++) { ColorArray[i] = new PentLightColor(HLMessageTypeHelper.ExtractString(br), HLMessageTypeHelper.ExtractColor(br)); } for (int i = 0; i < PUM_CIRC_COUNT; i++) { PumpCircArray[i] = br.ReadByte(); } InterfaceTabFlags = br.ReadInt32(); ShowAlarms = br.ReadInt32(); }
public static void WritePrefixLength(this BinaryWriter bw, string val) { bw.Write(val.Length); bw.Write(Encoding.ASCII.GetBytes(val)); var boundaryBufferLen = HLMessageTypeHelper.AlignToNext4Boundary(val.Length); for (int i = 0; i < boundaryBufferLen; i++) { bw.Write((byte)0); } }
protected override void Decode() { if (data == null) { return; } using var ms = new MemoryStream(data); using var br = new BinaryReader(ms); GatewayFound = br.ReadBoolean(); LicenseOK = br.ReadBoolean(); IPAddr = HLMessageTypeHelper.ExtractString(br); Port = br.ReadInt16(); PortOpen = br.ReadBoolean(); RelayOn = br.ReadBoolean(); }
protected override void Decode() { ChallengeStr = HLMessageTypeHelper.ExtractString(data); }