aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/ExternalBridge
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-02-11 16:09:12 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-02-11 16:09:12 +0200
commit29ac4ab17bdc882f0f85666cb82320ca8075ba95 (patch)
tree2879ff2c8c68bd6685a59ca25e91beb4c6f76e8f /Software/Visual_Studio/Tango.Integration/ExternalBridge
parent08686cebb5b2e517cd356bc33d79205d8fcc8d66 (diff)
downloadTango-29ac4ab17bdc882f0f85666cb82320ca8075ba95.tar.gz
Tango-29ac4ab17bdc882f0f85666cb82320ca8075ba95.zip
Implemented TechBoard "New Project" properly.
Changed MS => PPC default intent to Diagnostics. Implemented producer/consumer queue for NavigationControl. Fixed issue with empty points pushed to RealTimerGraphX. Implemented ExternalBridgeService pinging to keep connection. Fixed issue with Firmware upgrade DFU upload failure, now fails all transport components.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/ExternalBridge')
-rw-r--r--Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
index 312143c57..4395b5f41 100644
--- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
+++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
@@ -26,6 +26,7 @@ using Tango.Core;
using Microsoft.AspNet.SignalR.Client;
using Tango.Integration.ExternalBridge.Web;
using Tango.Core.Threading;
+using System.Diagnostics;
namespace Tango.Integration.ExternalBridge
{
@@ -39,6 +40,7 @@ namespace Tango.Integration.ExternalBridge
private HubConnection _connection;
private IHubProxy _proxy;
private bool _isSignalRConnected;
+ private System.Timers.Timer _signalrPingTimer;
#region Events
@@ -447,6 +449,13 @@ namespace Tango.Integration.ExternalBridge
});
_isSignalRConnected = true;
+
+ if (_signalrPingTimer == null)
+ {
+ _signalrPingTimer = new System.Timers.Timer(TimeSpan.FromMinutes(5).TotalMilliseconds);
+ _signalrPingTimer.Elapsed += _signalrPingTimer_Elapsed;
+ _signalrPingTimer.Start();
+ }
}
catch (Exception ex)
{
@@ -478,6 +487,24 @@ namespace Tango.Integration.ExternalBridge
}
}
+ private async void _signalrPingTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
+ {
+ if (Enabled && SignalRConfiguration.Enabled)
+ {
+ if (_proxy != null)
+ {
+ try
+ {
+ var result = await _proxy.Invoke<String>("Ping");
+ }
+ catch
+ {
+ Debug.WriteLine("Error pinging to machine service via SignalR.");
+ }
+ }
+ }
+ }
+
/// <summary>
/// Stops this instance.
/// </summary>