Advertisement
FrayxRulez

Untitled

Dec 11th, 2014
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. private async Task<bool?> IsBluetoothEnabled()
  2. {
  3. Windows.Networking.Proximity.PeerFinder.Start();
  4. try
  5. {
  6. var peers = await Windows.Networking.Proximity.PeerFinder.FindAllPeersAsync();
  7. return true;
  8. }
  9. catch (Exception ex)
  10. {
  11. if ((uint)ex.HResult == 0x8007048F)
  12. {
  13. return false;
  14. }
  15.  
  16. }
  17. return null;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement