public async void SetupWirelessAP(object sender, EventArgs e) { this.SetViewState(true); App.wirelessconfig.Password = this.PasswordEntry.Text; var publicKey = await SoftAPConfig.GetPublicKeyAsync(); var configureresult = await SoftAPConfig.SetConfigureAPAsync(0, ssidlist.Where(l => l.SSID == App.wirelessconfig.SSID).First(), App.wirelessconfig.Password, publicKey); if (configureresult == 0) { await SoftAPConfig.SetConnectAPAsync(0); } this.SetViewState(false); }
private async Task <bool> VerifyPhotonConnectionAsync(ConnectionProfile connectionProfile) { PhotonNetworkTextBlock.Text = connectionProfile.ProfileName; ProgressBar.IsIndeterminate = true; int setClaimCode = -1; int maxRetries = 5; for (int tries = 0; tries < maxRetries; ++tries) { if (SoftAPConfig.SoftAPData.Version == null) { SoftAPConfig.SoftAPData.Version = await SoftAPConfig.GetVersionAsync(); } if (SoftAPConfig.SoftAPData.DeviceId == null) { SoftAPConfig.SoftAPData.DeviceId = await SoftAPConfig.GetDeviceIdAsync(); } if (SoftAPConfig.SoftAPData.PublicKey == null) { SoftAPConfig.SoftAPData.PublicKey = await SoftAPConfig.GetPublicKeyAsync(); } if (setClaimCode == -1) { setClaimCode = await SoftAPConfig.SetClaimCodeAsync(SoftAPConfig.SoftAPData.ClaimCode); } } ProgressBar.IsIndeterminate = false; if (SoftAPConfig.SoftAPData.Version == null || SoftAPConfig.SoftAPData.DeviceId == null || SoftAPConfig.SoftAPData.PublicKey == null || setClaimCode == -1) { return(false); } return(true); }