Created
April 23, 2014 15:58
-
-
Save elbruno/11221168 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using InTheHand.Net.Sockets; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
var bluetoothClient = new BluetoothClient(); | |
var devices = bluetoothClient.DiscoverDevices(); | |
Console.WriteLine("Bluetooth devices"); | |
foreach (var device in devices) | |
{ | |
var blueToothInfo = | |
string.Format( | |
"- DeviceName: {0}{1} Connected: {2}{1} Address: {3}{1} Last seen: {4}{1} Last used: {5}{1}", | |
device.DeviceName, Environment.NewLine, device.Connected, device.DeviceAddress, device.LastSeen, | |
device.LastUsed); | |
blueToothInfo += string.Format(" Class of device{0} Device: {1}{0} Major Device: {2}{0} Service: {3}", | |
Environment.NewLine, device.ClassOfDevice.Device, device.ClassOfDevice.MajorDevice, | |
device.ClassOfDevice.Service) ; | |
Console.WriteLine(blueToothInfo); | |
Console.WriteLine(); | |
} | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment