mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-31 13:25:00 +00:00
add ICommunicationMonitor to EiscApiAdvanced
This commit is contained in:
@@ -78,7 +78,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
/// <summary>
|
||||
/// Bridge API using EISC
|
||||
/// </summary>
|
||||
public class EiscApiAdvanced : BridgeApi
|
||||
public class EiscApiAdvanced : BridgeApi, ICommunicationMonitor
|
||||
{
|
||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
@@ -89,6 +89,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public EiscApiAdvanced(DeviceConfig dc, BasicTriList eisc) :
|
||||
base(dc.Key)
|
||||
{
|
||||
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, Eisc, 120000, 300000);
|
||||
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
|
||||
|
||||
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
|
||||
@@ -100,6 +101,19 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
AddPostActivationAction(LinkDevices);
|
||||
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()
|
||||
@@ -137,8 +151,6 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||
}
|
||||
}
|
||||
|
||||
RegisterEisc();
|
||||
}
|
||||
|
||||
private void RegisterEisc()
|
||||
@@ -182,8 +194,6 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
rm.LinkToApi(Eisc, room.JoinStart, room.JoinMapKey, this);
|
||||
}
|
||||
|
||||
RegisterEisc();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -324,6 +334,12 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user