aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs15
1 files changed, 6 insertions, 9 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
index b5140e336..256804f67 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
@@ -40,7 +40,6 @@ namespace Tango.PPC.Common.MachineSetup
private IRemoteAssistanceProvider _remoteAssistance;
private IUnifiedWriteFilterManager _uwf;
private IOperationSystemManager _windows_manager;
- private String _accessToken;
#region Events
@@ -84,19 +83,17 @@ namespace Tango.PPC.Common.MachineSetup
#region Private Methods
- private Task Login(String serialNumber)
+ private Task<String> Login(String serialNumber)
{
- return Task.Factory.StartNew(() =>
+ return Task.Factory.StartNew<String>(() =>
{
using (var client = new PPCWebService())
{
- var response = client.Login(new LoginRequest()
+ return client.Login(new LoginRequest()
{
Mode = LoginMode.Machine,
SerialNumber = serialNumber,
- }).Result;
-
- _accessToken = response.AccessToken;
+ }).Result.AccessToken;
}
});
}
@@ -128,10 +125,10 @@ namespace Tango.PPC.Common.MachineSetup
LogManager.Log($"Connecting to machine service on {machineServiceAddress}...");
- await Login(serialNumber);
+ var accessToken = await Login(serialNumber);
MachineSetupRequest request = new MachineSetupRequest();
- request.AccessToken = _accessToken;
+ request.AccessToken = accessToken;
MachineSetupResponse setup_response = null;