Fixed a lot of bugs shoudl be able to write unit tests now.
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Xml.Schema;
|
||||
|
||||
|
||||
namespace Tello_Drone
|
||||
{
|
||||
@@ -15,7 +12,7 @@ namespace Tello_Drone
|
||||
_udpClient = udpClient;
|
||||
}
|
||||
|
||||
public void Forward(int x) => SendCommand($"forward {x}");
|
||||
public void Forward(int x) =>SendCommand() ($"forward {x}");
|
||||
public void Reverse(int x) => SendCommand($"back {x}");
|
||||
public void Up(int z) => SendCommand($"up {z}");
|
||||
public void Down(int z) => SendCommand($"down {z}");
|
||||
@@ -34,14 +31,14 @@ namespace Tello_Drone
|
||||
|
||||
private void SendCommand(string message)
|
||||
{
|
||||
var returnValue = _udpClient.TrySend(message, 0_500);
|
||||
var returnValue = _udpClient.TrySend(message, 0_500, 3);
|
||||
if (returnValue == false)
|
||||
SendCommand("land");
|
||||
}
|
||||
|
||||
private bool TrySendCommand(string message)
|
||||
{
|
||||
return _udpClient.TrySend(message, 0_500);
|
||||
return _udpClient.TrySend(message, 0_500, 3);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user