Exemplo n.º 1
0
        public AvlData Decode(IBitReader reader)
        {
            DateTime dateTime = reader != null?DateTimeExt.FromAvl(reader.ReadInt64()) : throw new ArgumentNullException(nameof(reader));

            AvlDataPriority priority = (AvlDataPriority)reader.ReadByte();
            GpsElement      gps      = DefaultGpsElementEncoding.Instance.Decode(reader);
            IoElement       data     = DefaultIOElementEncoding.Instance16.Decode(reader);

            return(new AvlData(priority, dateTime, gps, data));
        }
Exemplo n.º 2
0
        public AvlData Decode(IBitReader reader)
        {
            DateTime dateTime = reader != null?DateTimeExt.FromAvl(reader.ReadInt64()) : throw new ArgumentNullException(nameof(reader));

            AvlDataPriority priority = AvlDataPriority.Low;
            byte            num      = reader.ReadByte();

            if (num > 10 && num <= 20)
            {
                priority = AvlDataPriority.High;
            }
            GpsElement gps  = DefaultGpsElementEncoding.Instance.Decode(reader);
            IoElement  data = LegacyIoElementEncoding.Instance.Decode(reader);

            if (priority == AvlDataPriority.High)
            {
                data = new IoElement(-1, data.Properties);
            }
            return(new AvlData(priority, dateTime, gps, data));
        }