/// <summary> /// Decode Gps element /// </summary> /// <returns></returns> private GpsElement DecodeGpsElement() { var longitude = _reader.ReadInt32(); var latitude = _reader.ReadInt32(); var altitude = _reader.ReadInt16(); var angle = _reader.ReadInt16(); var satellites = _reader.ReadByte(); var speed = _reader.ReadInt16(); return(GpsElement.Create(longitude, latitude, altitude, speed, angle, satellites)); }
public IoProperty DecodeProperty(FieldEncoding encoding) { // read ID var propertyId = (int)_reader.ReadByte(); switch (encoding) { case FieldEncoding.Int8: return(IoProperty.Create(propertyId, _reader.ReadSByte())); case FieldEncoding.Int16: return(IoProperty.Create(propertyId, _reader.ReadInt16())); case FieldEncoding.Int32: return(IoProperty.Create(propertyId, _reader.ReadInt32())); default: throw new NotSupportedException(string.Format("The field encoding \"{0}\" is not supported.", encoding)); } }