Merge pull request #10 in PEC/pepperdash-simplsharp-core from feature/eControlMethod.Cresnet to master

* commit 'd5fa4311a22f2be1479ce6a8816bbafe9b6f2fa2':
  Added eControlMethod.Cresnet to enum
  Saved local project settings (no code changes)
  Fixes Null Reference Exceptions with GenericTcpIpClient and GenericSshClient
This commit is contained in:
Heath Volmer
2018-01-26 11:51:19 -05:00
8 changed files with 13 additions and 67 deletions

Binary file not shown.

View File

@@ -303,11 +303,16 @@ namespace PepperDash.Core
ReconnectTimer.Stop();
ReconnectTimer = null;
}
KillStream();
Client.Disconnect();
Client = null;
ClientStatus = SocketStatus.SOCKET_STATUS_BROKEN_LOCALLY;
Debug.Console(1, this, "Disconnected");
if (Client != null)
{
Client.Disconnect();
Client = null;
ClientStatus = SocketStatus.SOCKET_STATUS_BROKEN_LOCALLY;
Debug.Console(1, this, "Disconnected");
}
}
/// <summary>

View File

@@ -287,7 +287,8 @@ namespace PepperDash.Core
// Check debug level before processing byte array
//if (Debug.Level == 2)
// Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes));
Client.SendData(bytes, bytes.Length);
if(Client != null)
Client.SendData(bytes, bytes.Length);
}
/// <summary>

View File

@@ -8,6 +8,6 @@ namespace PepperDash.Core
{
public enum eControlMethod
{
None = 0, Com, IpId, IR, Ssh, Tcpip, Telnet
None = 0, Com, IpId, IR, Ssh, Tcpip, Telnet, Cresnet
}
}

View File

@@ -1,59 +0,0 @@
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using Crestron.SimplSharp;
//using Newtonsoft.Json;
//using Newtonsoft.Json.Linq;
//namespace PepperDash.Core
//{
// public class DeviceConfig
// {
// [JsonProperty("key")]
// public string Key { get; set; }
// [JsonProperty("name")]
// public string Name { get; set; }
// [JsonProperty("group")]
// public string Group { get; set; }
// [JsonProperty("type")]
// public string Type { get; set; }
// [JsonProperty("properties")]
// [JsonConverter(typeof(DevicePropertiesConverter))]
// public JToken Properties { get; set; }
// }
// /// <summary>
// ///
// /// </summary>
// public class DevicePropertiesConverter : JsonConverter
// {
// public override bool CanConvert(Type objectType)
// {
// return objectType == typeof(JToken);
// }
// public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
// {
// return JToken.ReadFrom(reader);
// }
// public override bool CanWrite
// {
// get
// {
// return false;
// }
// }
// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
// {
// throw new NotImplementedException("SOD OFF HOSER");
// }
// }
//}

View File

@@ -79,7 +79,6 @@
<Compile Include="Logging\DebugContext.cs" />
<Compile Include="Logging\DebugMemory.cs" />
<Compile Include="Device.cs" />
<Compile Include="DeviceConfig.cs" />
<Compile Include="Comm\GenericTcpIpServer.cs" />
<Compile Include="EthernetHelper.cs" />
<Compile Include="Comm\GenericTcpIpClient.cs" />

View File

@@ -4,4 +4,4 @@
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Pepperdash_Core")]
[assembly: AssemblyCopyright("Copyright © PepperDash 2016")]
[assembly: AssemblyVersion("1.0.1.*")]
[assembly: AssemblyVersion("1.0.3.*")]