aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-12-05 18:56:55 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-12-05 18:56:55 +0200
commit8a8cb386be5beb96e784880db22342a01fe71085 (patch)
tree5f81734d70db56d82ca312d427a113d4231b7d04 /Software/Visual_Studio
parent14336d9c334ac5498bbf4ab04cf83740bf524d98 (diff)
downloadTango-8a8cb386be5beb96e784880db22342a01fe71085.tar.gz
Tango-8a8cb386be5beb96e784880db22342a01fe71085.zip
Added embedded debug logs to PPC external bridge and file system.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs2
-rw-r--r--Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs35
2 files changed, 23 insertions, 14 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
index 31b5d93fc..8cccc43a7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
@@ -82,7 +82,7 @@ namespace Tango.PPC.Common.Connection
MachineOperator.UseKeepAlive = true;
MachineOperator.EnableMachineStatusUpdates = true;
MachineOperator.EnableDiagnostics = false;
- MachineOperator.EnableEmbeddedDebugging = false;
+ MachineOperator.EnableEmbeddedDebugging = true;
MachineOperator.FirmwareUpgradeMode = Integration.Upgrade.FirmwareUpgradeModes.DFU | Integration.Upgrade.FirmwareUpgradeModes.TFP_PACKAGE;
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
index 7ad03f3a7..60411bffa 100644
--- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
+++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
@@ -485,15 +485,6 @@ namespace Tango.Integration.ExternalBridge
{
LogManager.Log(ex);
}
-
- try
- {
- await MachineOperator.SendRequest(new StopDebugLogRequest());
- }
- catch (Exception ex)
- {
- LogManager.Log(ex);
- }
}
ClientDisconnected?.Invoke(this, new EventArgs());
@@ -576,9 +567,11 @@ namespace Tango.Integration.ExternalBridge
//Diagnostics
_messageHandlers.Add(MessageType.StartDiagnosticsRequest, OnStartDiagnosticsRequest);
+ _messageHandlers.Add(MessageType.StopDiagnosticsRequest, OnStopDiagnosticsRequest);
//Debug Logs
_messageHandlers.Add(MessageType.StartDebugLogRequest, OnStartDebugLogRequest);
+ _messageHandlers.Add(MessageType.StopDebugLogRequest, OnStopDebugLogRequest);
}
protected virtual async void OnAnyRequest(MessageContainer container)
@@ -659,7 +652,6 @@ namespace Tango.Integration.ExternalBridge
LogManager.Log("External bridge client has logged-in successfully.");
UseKeepAlive = true;
MachineOperator.EnableDiagnostics = false;
- MachineOperator.EnableEmbeddedDebugging = false;
SessionIntent = request.Message.Intent;
}
else
@@ -779,12 +771,29 @@ namespace Tango.Integration.ExternalBridge
}
}
+ private void OnStopDiagnosticsRequest(MessageContainer container)
+ {
+ if (_diagnosticsNotificationToken != null)
+ {
+ SendResponse<StartDiagnosticsResponse>(new StartDiagnosticsResponse(), _diagnosticsNotificationToken, true);
+ _diagnosticsNotificationToken = null;
+ SendResponse<StopDiagnosticsResponse>(new StopDiagnosticsResponse(), container.Token);
+ }
+ }
+
protected virtual void OnStartDebugLogRequest(MessageContainer container)
{
- if (_debugLogsNotificationToken == null)
+ _debugLogsNotificationToken = container.Token;
+ SendResponse<StartDebugLogResponse>(new StartDebugLogResponse(), container.Token);
+ }
+
+ private void OnStopDebugLogRequest(MessageContainer container)
+ {
+ if (_debugLogsNotificationToken != null)
{
- _debugLogsNotificationToken = container.Token;
- _machineOperator.SendContinuousRequest(container);
+ SendResponse<StartDebugLogResponse>(new StartDebugLogResponse(), _debugLogsNotificationToken, true);
+ _debugLogsNotificationToken = null;
+ SendResponse<StopDebugLogResponse>(new StopDebugLogResponse(), container.Token);
}
}