title: Xamarin Plugin.BluetoothLE await characteristic notification
body: <p>I would like to write one nice, tidy "login" function that I use to log in to a bluetooth peripheral by sending it a password. </p>
  
  <pre><code>public async Task&lt;bool&gt; LogIn()
  {
      bool result = false;
  
      //First log in 
      var connectHook = Device.ConnectHook(BleService.Control, new Guid[] { BleCharacteristic.PasswordResult });
  
      connectHook.Subscribe(ScanResult =&gt;
      {
          ScanResult.Characteristic.DisableNotifications();
  
          //Succesful Login
          if (ScanResult.Data[0] == 1)
          {
              result = true;
          }
          //Failed Login
          else
          {
              result = false;
          }
      });
  
      await Device.WriteCharacteristic(BleService.Control, BleCharacteristic.Password, PasswordBytes);
  
      await connectHook.FirstAsync();
  
      return result;
  }
  </code></pre>
  
  <p>I basically want to subscribe to the password result characteristic, then write the password, and then wait for the password result before returning from the function. </p>
  
  <p>Is this the place to use a promise? I have read about them but do not understand their use. </p>
  
  <p>Thanks</p>
  
  <p>EDIT: </p>
  
  <p>Did some digging and think I've found a good answer. I've updated the code above to reflect it, let me know what you think. </p>
  
  <p>EDIT 2: </p>
  
  <p>So, the code above doesn't work because nothing is returned from</p>
  
  <pre><code>await connectHook.FirstAsync();
  </code></pre>
  
  <p>If I comment that line out it all works....but it seems like it's working because I have a race condition and the notification gets back before the other code completes. </p>
  
  <p>Does the function magically await for that notification? I thought the observable implemented IEnumerable and would return the first item as long as it had come back? I'm new to this reactive stuff so please be kind. </p>