Minor updates to tcp client

This commit is contained in:
Neil Dorin
2017-10-31 14:19:51 -06:00
parent 44c9bcb788
commit adf7fd05ae
2 changed files with 118 additions and 109 deletions

View File

@@ -307,6 +307,7 @@ namespace PepperDash.Core
{
//if (Debug.Level == 2)
// Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes));
if(Client != null)
Client.SendData(bytes, bytes.Length);
}

View File

@@ -39,11 +39,13 @@ namespace PepperDash.Core
Key = key;
if (key.Contains('.')) Debug.Console(0, this, "WARNING: Device name's should not include '.'");
Name = "";
}
public Device(string key, string name) : this(key)
{
Name = name;
}
//public Device(DeviceConfig config)
@@ -52,6 +54,11 @@ namespace PepperDash.Core
// Config = config;
//}
public void EnableUsageTracker()
{
UsageTracker = new UsageTracker();
}
public void AddPreActivationAction(Action act)
{
if (_PreActivationActions == null)
@@ -105,5 +112,6 @@ namespace PepperDash.Core
{
if (o is bool && !(bool)o) a();
}
}
}