Пример #1
0
 static void ResolveNestedTypesCore(CompositeDsdlTypeBase t, IUavcanTypeResolver typeResolver)
 {
     foreach (var f in t.Fields)
     {
         if (f.Type is DsdlTypeReference reference)
         {
             var nestedType = typeResolver.ResolveType(reference.Namespace, reference.Name);
             f.Type = CastNestedType(nestedType);
         }
         else if (f.Type is ArrayDsdlType adt && adt.ElementType is DsdlTypeReference elementTypeReference)
         {
             var nestedType = typeResolver.ResolveType(elementTypeReference.Namespace, elementTypeReference.Name);
             adt.SetElementType(CastNestedType(nestedType));
         }
     }
 }
Пример #2
0
 void ResolveTypes(IUavcanTypeResolver typeResolver)
 {
     _logMessageType   = (MessageType)typeResolver.ResolveType("uavcan.protocol.debug", "LogMessage");
     _panicMessageType = (MessageType)typeResolver.ResolveType("uavcan.protocol", "Panic");
 }