Added and error message to the trace log when the com port is failing and looping back data

This commit is contained in:
2020-05-23 18:40:04 +01:00
parent 07665b7617
commit b9522ae2a2
7 changed files with 27 additions and 21 deletions
+4 -2
View File
@@ -243,7 +243,7 @@ namespace ASCOM.Meade.net
/// </summary>
/// <param name="deviceId"></param>
/// <param name="driverId"></param>
public static ConnectionInfo Connect(string deviceId, string driverId)
public static ConnectionInfo Connect(string deviceId, string driverId, ITraceLogger traceLogger)
{
lock (LockObject)
{
@@ -273,14 +273,16 @@ namespace ASCOM.Meade.net
ProductName = SendString(":GVP#");
FirmwareVersion = SendString(":GVN#");
}
catch (Exception)
catch (Exception ex)
{
traceLogger.LogIssue("Connect", $"Error getting telescope information \"{ex.Message}\" setting to LX200 Classic mode.");
ProductName = TelescopeList.LX200CLASSIC;
FirmwareVersion = "Unknown";
}
if (ProductName == ":GVP")
{
traceLogger.LogIssue("Connect", "Serial port is looping back data, something is wrong with the hardware.");
//This means that the serial port is looping back what's been sent, something is very wrong.
SharedSerial.Connected = false;
+4 -3
View File
@@ -1,10 +1,11 @@
using System;
using ASCOM.Utilities.Interfaces;
namespace ASCOM.Meade.net.Wrapper
{
public interface ISharedResourcesWrapper
{
ConnectionInfo Connect(string deviceId, string driverId);
ConnectionInfo Connect(string deviceId, string driverId, ITraceLogger traceLogger);
void Disconnect(string deviceId, string driverId);
string ProductName { get; }
@@ -29,9 +30,9 @@ namespace ASCOM.Meade.net.Wrapper
public class SharedResourcesWrapper : ISharedResourcesWrapper
{
public ConnectionInfo Connect(string deviceId, string driverId)
public ConnectionInfo Connect(string deviceId, string driverId, ITraceLogger traceLogger)
{
return SharedResources.Connect(deviceId, driverId);
return SharedResources.Connect(deviceId, driverId, traceLogger);
}
public void Disconnect(string deviceId, string driverId)