Need to work on Getting the Missions running, There is currently an issue with the UDP Client sending to a bad IP
This commit is contained in:
28
Tello Drone/DroneComands.cs
Normal file
28
Tello Drone/DroneComands.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace Tello_Drone
|
||||
{
|
||||
public class DroneComands : IDroneCommands
|
||||
{
|
||||
private readonly IUdpClientWrapper _udpClient;
|
||||
|
||||
public DroneComands()
|
||||
{
|
||||
var udpClient = new UdpClientWrapper(127001, 8000);
|
||||
_udpClient = udpClient;
|
||||
}
|
||||
|
||||
public bool Forward() => SendCommand("Forward");
|
||||
|
||||
public bool Reverse() => SendCommand("Reverse");
|
||||
|
||||
public bool Up() => SendCommand("Up");
|
||||
|
||||
public bool Down() => SendCommand("Down");
|
||||
|
||||
private bool SendCommand(string message)
|
||||
{
|
||||
return _udpClient.TrySend(message, 1_500);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user