protected override void Parse(Span <byte> data)
        {
            var pos = 0;

            do
            {
                var uuid  = data.Slice(pos + 0, 16);
                var lUuid = new LoxoneUuid(uuid);

                var lastUpdate     = data.Slice(pos + 16, 4);
                var lastUpdateUint = BitConverter.ToUInt32(lastUpdate);

                var entriesCountB = data.Slice(pos + 20, 4);
                var entriesCount  = BitConverter.ToInt32(entriesCountB);

                var weather = new Weather(lastUpdateUint);

                for (int i = 0; i < entriesCount; i++)
                {
                    var entryData     = data.Slice(pos + Weather.LoxoneStructLength + (i * WeatherEntry.LoxoneStructLength), WeatherEntry.LoxoneStructLength);
                    var daytimerEntry = WeatherEntry.Parse(entryData);
                    weather.WeatherEntries.Add(daytimerEntry);
                }

                pos += (entriesCount * WeatherEntry.LoxoneStructLength) + Weather.LoxoneStructLength;
                Values.Add(lUuid, weather);
            } while (pos != data.Length);
        }
示例#2
0
        protected override void Parse(Span <byte> data)
        {
            var pos = 0;

            do
            {
                var uuid  = data.Slice(pos + 0, 16);
                var lUuid = new LoxoneUuid(uuid);

                var defaultValue  = data.Slice(pos + 16, 8);
                var defaultValueD = BitConverter.ToDouble(defaultValue);

                var daytimer = new Daytimer(defaultValueD);

                var entriesCount = BitConverter.ToInt32(data.Slice(pos + 24, 4));

                for (int i = 0; i < entriesCount; i++)
                {
                    var entryData     = data.Slice(pos + Daytimer.LoxoneStructLength + (i * DaytimerEntry.LoxoneStructLength), DaytimerEntry.LoxoneStructLength);
                    var daytimerEntry = DaytimerEntry.Parse(entryData);
                    daytimer.DaytimerEntries.Add(daytimerEntry);
                }

                pos += (entriesCount * DaytimerEntry.LoxoneStructLength) + Daytimer.LoxoneStructLength;
                Values.Add(lUuid, daytimer);
            } while (pos != data.Length);
        }
示例#3
0
        protected override void Parse(Span <byte> data)
        {
            var pos = 0;

            do
            {
                var uuid  = data.Slice(pos + 0, 16);
                var lUuid = new LoxoneUuid(uuid);


                var uuidIcon  = data.Slice(pos + 16, 16);
                var lUuidIcon = new LoxoneUuid(uuid);

                var textLength = BitConverter.ToUInt32(data.Slice(pos + 32, 4));

                var textBinary = data.Slice(pos + 36, (int)textLength);
                var text       = Encoding.UTF8.GetString(textBinary);

                var paddingBytes = (int)(textLength % 4);

                Values.Add(lUuid, new TextEventData(lUuidIcon, text));
                pos += (16 + 16 + 4 + (int)textLength);

                if (paddingBytes > 0)
                {
                    pos += 4 - paddingBytes;
                }
            } while (pos != data.Length);
        }
        protected override void Parse(Span <byte> data)
        {
            var length = data.Length / 24;

            for (int i = 0; i < length; i++)
            {
                var curData = data.Slice(i * 24, 24);

                var uuid  = curData.Slice(0, 16);
                var lUuid = new LoxoneUuid(uuid);
                var value = curData.Slice(16, 8);

                var dValue = BitConverter.ToDouble(value);

                Values.Add(lUuid.Uuid.ToLower(), dValue);
            }
        }
示例#5
0
 public TextEventData(LoxoneUuid iconId, string text)
 {
     IconId = iconId;
     Text   = text;
 }