Ejemplo n.º 1
0
        private UavDataObject DeserializeHeader(BinaryReader stream)
        {
            // Identifies the type of object and creates the proper object for further processing

            stream.ReadInt16(); // length
            UInt32        objId  = stream.ReadUInt32();
            UavDataObject result = ObjectSummary.CreateObject(objId);

            if (result == null)
            {
                // DAVE: add better handling: read length field and skip this packet, instead of stopping with an exception
                throw new Exception(string.Format("Unexpected ID: 0x{0:x8} at {1}", objId, stream.BaseStream.Position));
            }

            result.InstanceId = (result.IsSingleInstance) ? (UInt16)0 : stream.ReadUInt16();

            return(result);
        }
Ejemplo n.º 2
0
 public static Dictionary <UInt32, Type> GetObjectIds()
 {
     return(ObjectSummary.GetObjectIds());
 }