Added and error message to the trace log when the com port is failing and looping back data
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user