示例#1
0
        public byte GetMinByteSize() => 84; // of byte sized of fields (exclude extended)

        public void Deserialize(ref ReadOnlySpan <byte> buffer, int payloadSize)
        {
            var index     = 0;
            var endIndex  = payloadSize;
            var arraySize = 0;

            arraySize = 2;
            for (var i = 0; i < arraySize; i++)
            {
                ArD[i] = BinSerialize.ReadDouble(ref buffer); index += 8;
            }
            arraySize = 2;
            for (var i = 0; i < arraySize; i++)
            {
                ArF[i] = BinSerialize.ReadFloat(ref buffer); index += 4;
            }
            arraySize = 2;
            for (var i = 0; i < arraySize; i++)
            {
                ArU32[i] = BinSerialize.ReadUInt(ref buffer); index += 4;
            }
            arraySize = 2;
            for (var i = 0; i < arraySize; i++)
            {
                ArI32[i] = BinSerialize.ReadInt(ref buffer); index += 4;
            }
            arraySize = 2;
            for (var i = 0; i < arraySize; i++)
            {
                ArU16[i] = BinSerialize.ReadUShort(ref buffer); index += 2;
            }
            arraySize = 2;
            for (var i = 0; i < arraySize; i++)
            {
                ArI16[i] = BinSerialize.ReadShort(ref buffer); index += 2;
            }
            arraySize = 2;
            for (var i = 0; i < arraySize; i++)
            {
                ArU8[i] = (byte)BinSerialize.ReadByte(ref buffer); index += 1;
            }
            arraySize = 2;
            for (var i = 0; i < arraySize; i++)
            {
                ArI8[i] = (sbyte)BinSerialize.ReadByte(ref buffer); index += 1;
            }
            arraySize = /*ArrayLength*/ 32 - Math.Max(0, ((/*PayloadByteSize*/ 84 - payloadSize - /*ExtendedFieldsLength*/ 0) / 1 /*FieldTypeByteSize*/));
            ArC       = new char[arraySize];
            unsafe
            {
                fixed(byte *bytePointer = buffer)
                fixed(char *charPointer = ArC)
                {
                    Encoding.ASCII.GetChars(bytePointer, arraySize, charPointer, ArC.Length);
                }
            }
            buffer = buffer.Slice(arraySize);
            index += arraySize;
        }
示例#2
0
        public byte GetMinByteSize() => 41; // of byte sized of fields (exclude extended)

        public void Deserialize(ref ReadOnlySpan <byte> buffer, int payloadSize)
        {
            var index     = 0;
            var endIndex  = payloadSize;
            var arraySize = 0;

            Utctime         = BinSerialize.ReadUInt(ref buffer); index += 4;
            Gpslat          = BinSerialize.ReadInt(ref buffer); index += 4;
            Gpslon          = BinSerialize.ReadInt(ref buffer); index += 4;
            Gpsalt          = BinSerialize.ReadInt(ref buffer); index += 4;
            Baroaltmsl      = BinSerialize.ReadInt(ref buffer); index += 4;
            Accuracyhor     = BinSerialize.ReadUInt(ref buffer); index += 4;
            Accuracyvert    = BinSerialize.ReadUShort(ref buffer); index += 2;
            Accuracyvel     = BinSerialize.ReadUShort(ref buffer); index += 2;
            Velvert         = BinSerialize.ReadShort(ref buffer); index += 2;
            Velns           = BinSerialize.ReadShort(ref buffer); index += 2;
            Velew           = BinSerialize.ReadShort(ref buffer); index += 2;
            State           = (UavionixAdsbOutDynamicState)BinSerialize.ReadUShort(ref buffer); index += 2;
            Squawk          = BinSerialize.ReadUShort(ref buffer); index += 2;
            Gpsfix          = (UavionixAdsbOutDynamicGpsFix)BinSerialize.ReadByte(ref buffer); index += 1;
            Numsats         = (byte)BinSerialize.ReadByte(ref buffer); index += 1;
            Emergencystatus = (UavionixAdsbEmergencyStatus)BinSerialize.ReadByte(ref buffer); index += 1;
        }
示例#3
0
        public byte GetMinByteSize() => 179; // of byte sized of fields (exclude extended)

        public void Deserialize(ref ReadOnlySpan <byte> buffer, int payloadSize)
        {
            var index     = 0;
            var endIndex  = payloadSize;
            var arraySize = 0;

            U64       = BinSerialize.ReadULong(ref buffer); index += 8;
            S64       = BinSerialize.ReadLong(ref buffer); index += 8;
            D         = BinSerialize.ReadDouble(ref buffer); index += 8;
            arraySize = /*ArrayLength*/ 3 - Math.Max(0, ((/*PayloadByteSize*/ 179 - payloadSize - /*ExtendedFieldsLength*/ 0) / 8 /*FieldTypeByteSize*/));
            U64Array  = new ulong[arraySize];
            for (var i = 0; i < arraySize; i++)
            {
                U64Array[i] = BinSerialize.ReadULong(ref buffer); index += 8;
            }
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                S64Array[i] = BinSerialize.ReadLong(ref buffer); index += 8;
            }
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                DArray[i] = BinSerialize.ReadDouble(ref buffer); index += 8;
            }
            U32       = BinSerialize.ReadUInt(ref buffer); index += 4;
            S32       = BinSerialize.ReadInt(ref buffer); index += 4;
            F         = BinSerialize.ReadFloat(ref buffer); index += 4;
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                U32Array[i] = BinSerialize.ReadUInt(ref buffer); index += 4;
            }
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                S32Array[i] = BinSerialize.ReadInt(ref buffer); index += 4;
            }
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                FArray[i] = BinSerialize.ReadFloat(ref buffer); index += 4;
            }
            U16       = BinSerialize.ReadUShort(ref buffer); index += 2;
            S16       = BinSerialize.ReadShort(ref buffer); index += 2;
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                U16Array[i] = BinSerialize.ReadUShort(ref buffer); index += 2;
            }
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                S16Array[i] = BinSerialize.ReadShort(ref buffer); index += 2;
            }
            C         = (char)buffer[0];
            buffer    = buffer.Slice(1);
            index    += 1;
            arraySize = 10;
            unsafe
            {
                fixed(byte *bytePointer = buffer)
                fixed(char *charPointer = S)
                {
                    Encoding.ASCII.GetChars(bytePointer, arraySize, charPointer, S.Length);
                }
            }
            buffer    = buffer.Slice(arraySize);
            index    += arraySize;
            U8        = (byte)BinSerialize.ReadByte(ref buffer); index += 1;
            S8        = (sbyte)BinSerialize.ReadByte(ref buffer); index += 1;
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                U8Array[i] = (byte)BinSerialize.ReadByte(ref buffer); index += 1;
            }
            arraySize = 3;
            for (var i = 0; i < arraySize; i++)
            {
                S8Array[i] = (sbyte)BinSerialize.ReadByte(ref buffer); index += 1;
            }
        }