资源简介
C# ble 4.0 低能耗 蓝牙交互 蓝牙连接 适配 服务 特征 编程,通过windows模块配对蓝牙进行数据交互

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Devices.Bluetooth;
using Windows.Devices.Bluetooth.GenericAttributeProfile;
using Windows.Devices.Enumeration;
using Windows.Foundation;
using Windows.Networking;
using Windows.Networking.Proximity;
using Windows.Networking.Sockets;
using Windows.Security.Cryptography;
using Windows.Storage.Streams;
namespace BleSolution
{
public class BleCore
{
private Boolean asyncLock = false;
///
/// 搜索蓝牙设备对象
///
private DeviceWatcher deviceWatcher;
///
/// 当前连接的服务
///
public GattDeviceService CurrentService { get; set; }
///
/// 当前连接的蓝牙设备
///
public BluetoothLEDevice CurrentDevice { get; set; }
///
/// 写特征对象
///
public GattCharacteristic CurrentWriteCharacteristic { get; set; }
///
/// 通知特征对象
///
public GattCharacteristic CurrentNotifyCharacteristic { get; set; }
///
/// 特性通知类型通知启用
///
private const GattClientCharacteristicConfigurationDescriptorValue CHARACTERISTIC_NOTIFICATION_TYPE = GattClientCharacteristicConfigurationDescriptorValue.Notify;
///
/// 存储检测到的设备
///
private List DeviceList = new List();
///
/// 定义搜索蓝牙设备委托
///
public delegate void DeviceWatcherChangedEvent(MsgType type BluetoothLEDevice bluetoothLEDevice);
///
/// 搜索蓝牙事件
///
public event DeviceWatcherChangedEvent DeviceWatcherChanged;
///
/// 获取服务委托
///
public delegate void GattDeviceServiceAddedEvent(GattDeviceService gattDeviceService);
///
/// 获取服务事件
///
public event GattDeviceServiceAddedEvent GattDeviceServiceAdded;
///
/// 获取特征委托
///
public delegate void CharacteristicAddedEvent(GattCharacteristic gattCharacteristic);
///
/// 获取特征事件
///
public event CharacteristicAddedEvent CharacteristicAdded;
///
/// 提示信息委托
///
public delegate void MessAgeChangedEvent(MsgType type string message byte[] data = null);
///
/// 提示信息事件
///
public event MessAgeChangedEvent MessAgeChanged;
///
/// 当前连接的蓝牙Mac
///
private string CurrentDeviceMAC { get; set; }
public BleC
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-07-03 11:43 BleSolution\
目录 0 2020-07-03 11:43 BleSolution\.vs\
目录 0 2020-07-03 11:43 BleSolution\.vs\BleSolution\
目录 0 2020-07-03 11:43 BleSolution\.vs\BleSolution\v14\
文件 109568 2020-12-11 10:17 BleSolution\.vs\BleSolution\v14\.suo
目录 0 2020-12-14 15:59 BleSolution\BleSolution\
文件 189 2020-07-03 11:43 BleSolution\BleSolution\App.config
文件 14294 2020-12-11 09:16 BleSolution\BleSolution\BleCore.cs
文件 251 2020-07-03 11:43 BleSolution\BleSolution\BleEnum.cs
文件 4725 2020-12-11 09:13 BleSolution\BleSolution\BleSolution.csproj
文件 228 2020-07-03 11:43 BleSolution\BleSolution\BleSolution.csproj.user
文件 17672 2020-12-14 15:58 BleSolution\BleSolution\BluetoothLECode.cs
文件 9243 2020-10-15 11:32 BleSolution\BleSolution\Form1.Designer.cs
文件 10848 2020-10-15 11:34 BleSolution\BleSolution\Form1.cs
文件 5817 2020-10-15 10:27 BleSolution\BleSolution\Form1.resx
文件 5179 2020-12-11 09:54 BleSolution\BleSolution\Form2.Designer.cs
文件 3622 2020-12-14 15:59 BleSolution\BleSolution\Form2.cs
文件 5817 2020-12-11 09:54 BleSolution\BleSolution\Form2.resx
文件 536 2020-12-11 09:37 BleSolution\BleSolution\Program.cs
目录 0 2020-07-03 11:43 BleSolution\BleSolution\Properties\
文件 1320 2020-07-03 11:43 BleSolution\BleSolution\Properties\AssemblyInfo.cs
文件 2864 2020-07-14 09:44 BleSolution\BleSolution\Properties\Resources.Designer.cs
文件 5612 2020-07-03 11:43 BleSolution\BleSolution\Properties\Resources.resx
文件 1112 2020-07-14 09:44 BleSolution\BleSolution\Properties\Settings.Designer.cs
文件 249 2020-07-03 11:43 BleSolution\BleSolution\Properties\Settings.settings
目录 0 2020-07-14 09:43 BleSolution\BleSolution\bin\
目录 0 2020-12-11 14:09 BleSolution\BleSolution\bin\Debug\
文件 28216 2012-09-26 03:16 BleSolution\BleSolution\bin\Debug\System.Runtime.WindowsRuntime.dll
文件 76981 2018-10-15 11:17 BleSolution\BleSolution\bin\Debug\System.Runtime.WindowsRuntime.xm
文件 6852608 2019-03-18 17:33 BleSolution\BleSolution\bin\Debug\Windows.winmd
文件 22696 2020-07-14 09:41 BleSolution\BleSolution\bin\Debug\WindowsFormsApplication1.vshost.exe
............此处省略27个文件信息
- 上一篇:仓库管理系统/课程设计/ASP.NET/C#
- 下一篇:基于C#和AE的二次开发
相关资源
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
- C#左侧导航菜单(动态生成)
- C#TCP 通信(TCP发送16进制)
- C# sql实现批量导入数据到数据库
评论
共有 条评论