Added a post connect check to see if the serial port is functioning correctly.

This commit is contained in:
2020-05-24 22:02:21 +01:00
parent 855a21122a
commit 3d47e03240
2 changed files with 83 additions and 7 deletions
+26 -2
View File
@@ -271,8 +271,8 @@ namespace ASCOM.Meade.net
try
{
ProductName = SendString(":GVP#");
FirmwareVersion = SendString(":GVN#");
ProductName = SendString("#:GVP#");
FirmwareVersion = SendString("#:GVN#");
}
catch (Exception ex)
{
@@ -289,6 +289,30 @@ namespace ASCOM.Meade.net
throw new Exception("Serial port is looping back data, something is wrong with the hardware.");
}
try
{
string utcOffSet = SendString("#:GG#");
//:GG# Get UTC offset time
//Returns: sHH# or sHH.H#
//The number of decimal hours to add to local time to convert it to UTC. If the number is a whole number the
//sHH# form is returned, otherwise the longer form is returned.
try
{
double utcOffsetHours = double.Parse(utcOffSet);
}
catch (Exception ex)
{
traceLogger.LogIssue("Connect", "Unable to decode response from the telescope, This is likely a hardware serial communications error.");
throw;
}
}
catch (Exception ex)
{
SharedSerial.Connected = false;
throw;
}
}
}
else