Example #1
0
 private async void Button_Click(object sender, RoutedEventArgs e)
 {
     btnConn.IsEnabled = false;
     band = new MiBand2SDK.MiBand2();
     // Check if already authentified
     if (band.IsConnected())
     {
         txtStat.Text = "Connected";
     }
     else
     {
         // Trying to connect to band and authenticate first time.
         // While authentication process started, you need to touch you band, when you see the message.
         if (await band.ConnectAsync() && await band.Identity.AuthenticateAsync())
         {
             txtStat.Text = "Connected";
         }
         else//didnt connect :(
         {
             btnConn.IsEnabled = true;
         }
     }
 }