Update unit tests to support GW command

SideOfPier also supports German EQ
This commit is contained in:
Sebastian Godelet
2021-06-27 18:57:17 +10:00
parent 74440b6b3b
commit a3408a86c3
5 changed files with 72 additions and 58 deletions
+8 -7
View File
@@ -124,13 +124,17 @@ namespace ASCOM.Meade.net
public static bool SendBool(string command, bool raw = false)
{
var result = SendChar(command, raw);
return result == "1";
}
public static string SendChar(string command, bool raw = false)
{
return SendChars(command, raw, count: 1);
}
public static string SendChars(string command, bool raw = false, int count = 1)
{
lock (LockObject)
{
@@ -141,14 +145,11 @@ namespace ASCOM.Meade.net
try
{
return SharedSerial.ReceiveCounted(1);
return SharedSerial.ReceiveCounted(count);
}
catch (COMException ex)
catch (COMException ex) when (ex.Message.Contains("Timed out waiting for received data"))
{
if (ex.Message.Contains("Timed out waiting for received data"))
throw new TimeoutException(ex.Message, ex);
throw;
throw new TimeoutException(ex.Message, ex);
}
}
}
@@ -20,6 +20,7 @@ namespace ASCOM.Meade.net.Wrapper
void SendBlind(string message, bool raw = false);
bool SendBool(string command, bool raw = false);
string SendChar(string message, bool raw = false);
string SendChars(string message, bool raw = false, int count = 1);
string ReadTerminated();
@@ -94,6 +95,11 @@ namespace ASCOM.Meade.net.Wrapper
return SharedResources.SendChar(message, raw);
}
public string SendChars(string message, bool raw = false, int count = 1)
{
return SharedResources.SendChars(message, raw, count);
}
public string ReadTerminated()
{
return SharedResources.ReadTerminated();