Exemplo n.º 1
0
 private void bWifiConfigSet_Click(object sender, EventArgs e)
 {
     RepProtocol.WifiConfig config = new RepProtocol.WifiConfig();
     config.Key      = tbWifiKey.Text;
     config.Security = cbWifiSecurity.Text;
     config.SSID     = tbWifiSSID.Text;
     BtnClick(bWifiConfigSet, () =>
     {
         repProtocol.SetWifiConfig(config);
     });
 }
Exemplo n.º 2
0
 private void bWifiConfigGet_Click(object sender, EventArgs e)
 {
     BtnClick(bWifiConfigGet, () =>
     {
         RepProtocol.WifiConfig config = repProtocol.GetWifiConfig();
         Invoke(() =>
         {
             int idx = cbWifiSecurity.Items.IndexOf(config.Security);
             if (idx < 0)
             {
                 throw new Exception("Configuração inválida");
             }
             tbWifiKey.Text = config.Key;
             cbWifiSecurity.SelectedIndex = idx;
             tbWifiSSID.Text = config.SSID;
         });
     });
 }