示例#1
0
 public TelloCommand(byte type, TelloCommandId id, ushort seqId, byte[] data)
 {
     Type  = type;
     Id    = id;
     SeqId = seqId;
     Data  = data;
 }
    public static TelloCommand Create(TelloPacketType packetType, TelloCommandId commandId)
    {
        switch (commandId)
        {
        case TelloCommandId.DateTime:
            return(new TelloDateTimeCommand {
                PacketType = packetType
            });

        case TelloCommandId.GetVersionString:
            return(new TelloGetVersionCommand {
                PacketType = packetType
            });

        case TelloCommandId.GetVideoSpsPps:
            return(new TelloVideoSpsPpsCommand {
                PacketType = packetType
            });

        case TelloCommandId.GetRegion:
            return(new TelloGetRegionCommand {
                PacketType = packetType
            });

        case TelloCommandId.Stick:
            return(new TelloStickCommand {
                PacketType = packetType
            });

        case TelloCommandId.GetVideoBitRate:
            return(new TelloGetVideoBitRateCommand {
                PacketType = packetType
            });

        case TelloCommandId.GetLowBatteryThreshold:
            return(new TelloGetLowBatteryThresholdCommand {
                PacketType = packetType
            });

        case TelloCommandId.ExposureValue:
            return(new TelloExposureValueCommand {
                PacketType = packetType
            });

        case TelloCommandId.GetAttitudeAngle:
            return(new TelloGetAttitudeAngleCommand {
                PacketType = packetType
            });

        case TelloCommandId.GetAltitudeLimit:
            return(new TelloGetAltitudeLimitCommand {
                PacketType = packetType
            });

        default:
            return(new TelloUnknownCommand(packetType, commandId));
        }
    }
示例#3
0
 public TelloCommand(byte type, TelloCommandId id, byte[] data) :
     this(type, id, 0, data)
 {
 }
示例#4
0
 public TelloCommand(byte type, TelloCommandId id) :
     this(type, id, new byte[0])
 {
 }
 protected TelloCommand(TelloPacketType packetType, TelloCommandId commandId, bool zeroSequenceNumber = false)
 {
     PacketType         = packetType;
     CommandId          = commandId;
     ZeroSequenceNumber = zeroSequenceNumber;
 }
 public TelloUnknownCommand(TelloPacketType packetType, TelloCommandId commandId)
     : base(packetType, commandId)
 {
 }