mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +00:00
add ICommunicationMonitor to EiscApiAdvanced
This commit is contained in:
@@ -78,7 +78,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bridge API using EISC
|
/// Bridge API using EISC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EiscApiAdvanced : BridgeApi
|
public class EiscApiAdvanced : BridgeApi, ICommunicationMonitor
|
||||||
{
|
{
|
||||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
@@ -89,6 +89,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
public EiscApiAdvanced(DeviceConfig dc, BasicTriList eisc) :
|
public EiscApiAdvanced(DeviceConfig dc, BasicTriList eisc) :
|
||||||
base(dc.Key)
|
base(dc.Key)
|
||||||
{
|
{
|
||||||
|
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, Eisc, 120000, 300000);
|
||||||
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
|
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
|
||||||
|
|
||||||
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
|
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
|
||||||
@@ -100,6 +101,19 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
|
|
||||||
AddPostActivationAction(LinkDevices);
|
AddPostActivationAction(LinkDevices);
|
||||||
AddPostActivationAction(LinkRooms);
|
AddPostActivationAction(LinkRooms);
|
||||||
|
AddPostActivationAction(RegisterEisc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool CustomActivate()
|
||||||
|
{
|
||||||
|
CommunicationMonitor.Start();
|
||||||
|
return base.CustomActivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Deactivate()
|
||||||
|
{
|
||||||
|
CommunicationMonitor.Stop();
|
||||||
|
return base.Deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkDevices()
|
private void LinkDevices()
|
||||||
@@ -137,8 +151,6 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterEisc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RegisterEisc()
|
private void RegisterEisc()
|
||||||
@@ -182,8 +194,6 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
|
|
||||||
rm.LinkToApi(Eisc, room.JoinStart, room.JoinMapKey, this);
|
rm.LinkToApi(Eisc, room.JoinStart, room.JoinMapKey, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterEisc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -324,6 +334,12 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
|
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Implementation of ICommunicationMonitor
|
||||||
|
|
||||||
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EiscApiPropertiesConfig
|
public class EiscApiPropertiesConfig
|
||||||
|
|||||||
Reference in New Issue
Block a user