mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-16 13:14:49 +00:00
Minor updates to tcp client
This commit is contained in:
@@ -307,7 +307,8 @@ namespace PepperDash.Core
|
|||||||
{
|
{
|
||||||
//if (Debug.Level == 2)
|
//if (Debug.Level == 2)
|
||||||
// Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes));
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,11 +39,13 @@ namespace PepperDash.Core
|
|||||||
Key = key;
|
Key = key;
|
||||||
if (key.Contains('.')) Debug.Console(0, this, "WARNING: Device name's should not include '.'");
|
if (key.Contains('.')) Debug.Console(0, this, "WARNING: Device name's should not include '.'");
|
||||||
Name = "";
|
Name = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Device(string key, string name) : this(key)
|
public Device(string key, string name) : this(key)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//public Device(DeviceConfig config)
|
//public Device(DeviceConfig config)
|
||||||
@@ -52,6 +54,11 @@ namespace PepperDash.Core
|
|||||||
// Config = config;
|
// Config = config;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
public void EnableUsageTracker()
|
||||||
|
{
|
||||||
|
UsageTracker = new UsageTracker();
|
||||||
|
}
|
||||||
|
|
||||||
public void AddPreActivationAction(Action act)
|
public void AddPreActivationAction(Action act)
|
||||||
{
|
{
|
||||||
if (_PreActivationActions == null)
|
if (_PreActivationActions == null)
|
||||||
@@ -105,5 +112,6 @@ namespace PepperDash.Core
|
|||||||
{
|
{
|
||||||
if (o is bool && !(bool)o) a();
|
if (o is bool && !(bool)o) a();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user