1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > C# 实现蓝牙检测及蓝牙设备信息获取代码

C# 实现蓝牙检测及蓝牙设备信息获取代码

时间:2020-01-08 22:02:06

相关推荐

C# 实现蓝牙检测及蓝牙设备信息获取代码

C# 实现蓝牙检测及蓝牙设备信息获取代码

using System;using System.IO;using .Sockets;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;// 需添加命名空间using .Bluetooth;namespace bluetooth{class Program{static void Main(string[] args){BluetoothRadio bluetoothRadio = BluetoothRadio.PrimaryRadio;if (bluetoothRadio != null){localBluetoothInfo(bluetoothRadio);}else{Console.WriteLine("未找到本机蓝牙设备!");Console.ReadLine();}}/*** * 显示本地蓝牙设备信息* * **/private void localBluetoothInfo(BluetoothRadio bluetoothRadio){Console.WriteLine("ClassOfDevice: " + bluetoothRadio.ClassOfDevice);Console.WriteLine("HardwareStatus: " + bluetoothRadio.HardwareStatus);Console.WriteLine("HciRevision: " + bluetoothRadio.HciRevision);Console.WriteLine("HciVersion: " + bluetoothRadio.HciVersion);Console.WriteLine("LmpSubversion: " + bluetoothRadio.LmpSubversion);Console.WriteLine("LmpVersion: " + bluetoothRadio.LmpVersion);Console.WriteLine("LocalAddress: " + bluetoothRadio.LocalAddress);Console.WriteLine("Manufacturer: " + bluetoothRadio.Manufacturer);Console.WriteLine("Mode: " + bluetoothRadio.Mode);Console.WriteLine("Name: " + bluetoothRadio.Name);Console.WriteLine("Remote: " + bluetoothRadio.Remote);Console.WriteLine("SoftwareManufacturer: " + bluetoothRadio.SoftwareManufacturer);Console.WriteLine("StackFactory: " + bluetoothRadio.StackFactory);Console.ReadLine();}}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。