Beispiel #1
0
                public void WifiCentralManager_Constructor_WifiCentralManager()
                {
                    var ip = new Uri("http://192.168.1.100/");
                    WebServerCentralManager wifiCentralManager = new WebServerCentralManager(ip);

                    Assert.IsNotNull(wifiCentralManager);
                }
Beispiel #2
0
                public void WifiCentralManagerConstructor_Null_Exception()
                {
                    bool ThrewNull = false;

                    try
                    {
                        WebServerCentralManager wifiCentralManager = new WebServerCentralManager(null);
                    }
                    catch (Exception ex)
                    {
                        ThrewNull = true;
                    }
                    Assert.IsTrue(ThrewNull);
                }
            public async Task Search_FindsWebServer_ValidIp()
            {
                var localNetwork = Lumi4IntegrationTestSettings.LocalIP;
                WebServerCentralManager wifiCentralManager = new WebServerCentralManager(localNetwork);
                bool foundDevice = false;

                wifiCentralManager.DiscoveredDevice += delegate(object obj, DiscoveredDeviceEventArgs args)
                {
                    if (args.DiscoveredPeripheral != null)
                    {
                        foundDevice = true;
                    }
                };
                wifiCentralManager.Search(90, 120);
                await Task.Delay(Lumi4IntegrationTestSettings.SearchWifiCallbackDelay);

                Assert.IsTrue(foundDevice);
            }
Beispiel #4
0
        public MainPageViewModel()
        {
            WebServerCentralManager = new WebServerCentralManager();
            WebServerCentralManager.DiscoveredDevice  += WebServerCentralManager_DiscoveredDevice;
            WebServerCentralManager.DeviceStateChange += CentralManager_DeviceStateChange;

            WebServerCentralManager.Start();

            Windows.ApplicationModel.Core.CoreApplication.Suspending += CoreApplication_Suspending;
            LoadSettings();

            SearchCommand = new DelegateCommand(SearchExecute, SearchCanExecute).
                            ObservesProperty(() => this.DeviceTypePivotIndex).
                            ObservesProperty(() => this.HostIDOne).
                            ObservesProperty(() => this.HostIDTwo).
                            ObservesProperty(() => this.NetworkIDOne).
                            ObservesProperty(() => this.IsConnected);

            ConnectCommand = new DelegateCommand(ConnectExecute, ConnectCanExecute).ObservesProperty(() => this.DiscoveredPeripheralIndex);

            SendCommand = new DelegateCommand(SendExecute, SendCanExecute);
        }