Example #1
0
 protected override async Task <string> GetCustomName(CancellationToken cancel)
 {
     try
     {
         return(ArdupilotFrameTypeHelper.GenerateName(await ReadFrameClass(cancel).ConfigureAwait(false),
                                                      await ReadFrameType(cancel).ConfigureAwait(false),
                                                      await ReadSerialNumber(cancel).ConfigureAwait(false)));
     }
     catch (Exception e)
     {
         _logger.Error($"Error to read FRAME_TYPE or FRAME_CLASS or SerialNumber params:{e.Message}");
         return(await base.GetCustomName(cancel).ConfigureAwait(false));
     }
 }
Example #2
0
        public async Task <ArdupilotFrameTypeEnum> ReadFrameType(CancellationToken cancel = default)
        {
            var frameTypeParam = await Params.GetOrReadFromVehicleParam("FRAME_TYPE", cancel).ConfigureAwait(false);

            return(ArdupilotFrameTypeHelper.ParseFrameType(frameTypeParam.IntegerValue));
        }