コード例 #1
0
        public async Task <AutopilotVersionPayload> GetAutopilotVersion(CancellationToken cancel)
        {
            var packet = new CommandLongPacket
            {
                ComponenId = _identity.ComponentId,
                SystemId   = _identity.SystemId,
                Sequence   = _seq.GetNextSequenceNumber(),
                Payload    =
                {
                    Command         = MavCmd.MavCmdRequestAutopilotCapabilities,
                    TargetComponent = _identity.TargetComponentId,
                    TargetSystem    = _identity.TargetSystemId,
                    Confirmation    =                                         0,
                    Param1          =                                         1,
                }
            };

            var result = await _connection.SendAndWaitAnswer <AutopilotVersionPacket, AutopilotVersionPayload>(packet, _identity.TargetSystemId, _identity.TargetComponentId, cancel);

            return(result.Payload);
        }