private void ExecuteInternal()
        {
            try
            {
                WiFiDirectTestController disconnectTestController = localWFDController;
                WiFiDirectTestController otherTestController      = remoteWFDController;

                WiFiDirectTestLogger.Log(
                    "Starting Disconnect for session with handle {0} on device {1} ({2}), expect session with handle {3} to close on device {4} ({5})",
                    disconnectParameters.SessionHandle,
                    disconnectTestController.DeviceAddress,
                    disconnectTestController.MachineName,
                    disconnectParameters.OtherSessionHandle,
                    otherTestController.DeviceAddress,
                    otherTestController.MachineName
                    );

                disconnectTestController.DisconnectServiceSession(disconnectParameters.SessionHandle);

                otherTestController.WaitForDisconnectServiceSession(disconnectParameters.OtherSessionHandle);

                succeeded = true;
            }
            catch (Exception e)
            {
                WiFiDirectTestLogger.Error("Caught exception while executing service session disconnect scenario: {0}", e);
            }
        }
示例#2
0
        public LegacyPairingScenario(WiFiDirectTestController localWFDController, WiFiDirectTestController remoteWFDController)
        {
            this.localWFDController  = localWFDController;
            this.remoteWFDController = remoteWFDController;

            this.scenarioSucceeded = false;
        }
示例#3
0
 public ServicesUnpublishScenario(
     WiFiDirectTestController advertisingWFDController,
     ServicesUnpublishParameters unpublishParameters
     )
 {
     this.advertisingWFDController = advertisingWFDController;
     this.unpublishParameters      = unpublishParameters;
 }
示例#4
0
 public ServicesDiscoverConnectScenario(
     WiFiDirectTestController seekerTestController,
     WiFiDirectTestController advertiserTestController,
     ServicesDiscoverConnectParameters discoveryConnectParameters
     )
 {
     this.seekerTestController       = seekerTestController;
     this.advertiserTestController   = advertiserTestController;
     this.discoveryConnectParameters = discoveryConnectParameters;
 }
 public ServicesConnectScenario(
     WiFiDirectTestController seekerWFDController,
     WiFiDirectTestController advertiserWFDController,
     ServicesConnectParameters connectParameters
     )
 {
     this.seekerWFDController     = seekerWFDController;
     this.advertiserWFDController = advertiserWFDController;
     this.connectParameters       = connectParameters;
 }
示例#6
0
 public ServicesPublishDiscoverScenario(
     WiFiDirectTestController discoveryTestController,
     WiFiDirectTestController advertiserTestController,
     ServicesPublishDiscoverParameters publishDiscoveryParameters
     )
 {
     this.discoveryTestController    = discoveryTestController;
     this.advertiserTestController   = advertiserTestController;
     this.publishDiscoveryParameters = publishDiscoveryParameters;
 }
示例#7
0
 public ServicesSendDataScenario(
     WiFiDirectTestController senderWFDController,
     WiFiDirectTestController receiverWFDController,
     ServicesSendDataParameters dataParameters
     )
 {
     this.senderWFDController   = senderWFDController;
     this.receiverWFDController = receiverWFDController;
     this.dataParameters        = dataParameters;
 }
示例#8
0
 public ServicesOpenSocketSendDataScenario(
     WiFiDirectTestController senderWFDController,
     WiFiDirectTestController receiverWFDController,
     ServicesOpenSocketSendDataParameters socketDataParameters
     )
 {
     this.senderWFDController   = senderWFDController;
     this.receiverWFDController = receiverWFDController;
     this.socketDataParameters  = socketDataParameters;
 }
 public ServicesDisconnectScenario(
     WiFiDirectTestController localWFDController,
     WiFiDirectTestController remoteWFDController,
     ServicesDisconnectParameters disconnectParameters
     )
 {
     this.localWFDController   = localWFDController;
     this.remoteWFDController  = remoteWFDController;
     this.disconnectParameters = disconnectParameters;
 }
示例#10
0
 public static void TestClassSetup(TestContext context)
 {
     try
     {
         localWFDController  = new WiFiDirectTestController(context);
         remoteWFDController = WiFiDirectTestUtilities.GetRemoteTestControllerFromTestContext(context);
     }
     catch (Exception)
     {
         CleanupTestControllers();
         throw;
     }
 }
        public static WiFiDirectTestController GetRemoteTestControllerFromTestContext(TestContext context)
        {
            ushort remoteServerPort = WiFiDirectTestUtilities.ParsePortParameter(context, "RemoteServerPort", WiFiDirectRemoteServer.DefaultListenPort);

            string remoteServer = context.Properties["RemoteServer"] as string;

            if (remoteServer == null)
            {
                Verify.Fail("RemoteServer parameter must be provided.");
            }

            return(WiFiDirectTestController.CreateFromRemoteCommandClient(remoteServer, remoteServerPort));
        }
示例#12
0
        static void CleanupTestControllers()
        {
            if (localWFDController != null)
            {
                localWFDController.Dispose();
                localWFDController = null;
            }

            if (remoteWFDController != null)
            {
                remoteWFDController.Dispose();
                remoteWFDController = null;
            }
        }
 public DiscoveryScenario(WiFiDirectTestController localWFDController,
                          WiFiDirectTestController remoteWFDController,
                          DiscoveryScenarioType discoveryScenarioType,
                          bool isTargetedDiscovery,
                          WFD_DISCOVER_TYPE discoverType,
                          uint searchTimeoutMs,
                          bool discoverTestIe
                          )
 {
     this.succeeded             = false;
     this.localWFDController    = localWFDController;
     this.remoteWFDController   = remoteWFDController;
     this.discoveryScenarioType = discoveryScenarioType;
     this.isTargetedDiscovery   = isTargetedDiscovery;
     this.discoverType          = discoverType;
     this.searchTimeoutMs       = searchTimeoutMs;
     this.discoverTestIe        = discoverTestIe;
 }
        public ReconnectScenario(
            WiFiDirectTestController localWFDController,
            WiFiDirectTestController remoteWFDController,
            ReconnectScenarioType reconnectScenarioType
            )
        {
            if (localWFDController == null)
            {
                throw new ArgumentNullException("localWFDController");
            }
            if (remoteWFDController == null)
            {
                throw new ArgumentNullException("remoteWFDController");
            }

            this.localWFDController    = localWFDController;
            this.remoteWFDController   = remoteWFDController;
            this.reconnectScenarioType = reconnectScenarioType;
        }
        public RemoteControllerLogGroup(WiFiDirectTestController remoteWFDController, [CallerMemberName] string groupName = "")
        {
            if (remoteWFDController == null)
            {
                throw new System.ArgumentNullException("remoteWFDController");
            }

            if (groupName == null)
            {
                throw new System.ArgumentNullException("groupName");
            }

            this.remoteWFDController = remoteWFDController;
            this.groupName           = groupName;

            if (groupName != String.Empty)
            {
                remoteWFDController.StartGroup(groupName);
            }
        }
示例#16
0
        static void CleanupTestControllers()
        {
            // Try to remove existing DAF association (if it exists)
            if (localWFDController != null && remoteWFDController != null)
            {
                localWFDController.TryRemoveDafAssociation(remoteWFDController.DeviceAddress);
                remoteWFDController.TryRemoveDafAssociation(localWFDController.DeviceAddress);
            }

            if (localWFDController != null)
            {
                localWFDController.Dispose();
                localWFDController = null;
            }

            if (remoteWFDController != null)
            {
                remoteWFDController.Dispose();
                remoteWFDController = null;
            }
        }
        public static void RunDataPathValidation(WiFiDirectTestController localWFDController, WiFiDirectTestController remoteWFDController, string port = "5001")
        {
            // Close existing socket connections
            localWFDController.ResetDataPathTester();
            remoteWFDController.ResetDataPathTester();

            // Turn off the listen state on the remote device before working with sockets.
            remoteWFDController.ConfigureListenState(false);

            remoteWFDController.StartStreamSocketListener(port);
            localWFDController.ConnectStreamSocketAndSendGuid(port);
            remoteWFDController.WaitForSocketConnectionReceived(); // Wait for the connection received callback to complete so the DataPathTestGuid is properly initialized

            // Save GUID values to a local variable, to avoid having them change between the comparison and log prints below
            Guid localTestGuid  = localWFDController.DataPathTestGuid;
            Guid remoteTestGuid = remoteWFDController.DataPathTestGuid;

            if (remoteTestGuid != localTestGuid)
            {
                WiFiDirectTestLogger.Error("Received GUID value of {0} did not match transmitted value of {1}", remoteTestGuid, localTestGuid);
                return;
            }
            WiFiDirectTestLogger.Log("Validated transmitted and received GUID values match.");
        }
        public PairingScenario(
            WiFiDirectTestController localWFDController,
            WiFiDirectTestController remoteWFDController,
            PairingScenarioType pairingScenarioType,
            DOT11_WPS_CONFIG_METHOD configMethod,
            bool isPersistent,
            bool runDataPathValidation
            )
        {
            this.succeeded           = false;
            this.localWFDController  = localWFDController;
            this.remoteWFDController = remoteWFDController;
            this.pairingScenarioType = pairingScenarioType;

            if (configMethod != DOT11_WPS_CONFIG_METHOD.DOT11_WPS_CONFIG_METHOD_DISPLAY &&
                configMethod != DOT11_WPS_CONFIG_METHOD.DOT11_WPS_CONFIG_METHOD_PUSHBUTTON &&
                configMethod != DOT11_WPS_CONFIG_METHOD.DOT11_WPS_CONFIG_METHOD_KEYPAD)
            {
                throw new ArgumentException("Invalid value for configMethod.  Expect pin display, pushbutton, or keypad.", "configMethod");
            }
            this.configMethod          = configMethod;
            this.isPersistent          = isPersistent;
            this.runDataPathValidation = runDataPathValidation;
        }