# win-bluetooth **Repository Path**: zhReimu/win-bluetooth ## Basic Information - **Project Name**: win-bluetooth - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-15 - **Last Updated**: 2025-12-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Win-BT蓝牙开发库 一个基于Windows平台的蓝牙开发库,支持经典蓝牙和BLE设备通信。适用于Java开发者进行蓝牙设备交互开发。 ## 功能特性 - 经典蓝牙设备发现与配对 - RFCOMM通道通信 - BLE设备扫描与连接 - GATT服务与特征值读写 - 特征值通知订阅 - 设备信息获取 - 链接状态监控 ## 核心类 - `BluetoothManager` - 主控类,提供蓝牙功能接口 - `BluetoothDevice` - 蓝牙设备信息封装 - `GattCharacteristic` - GATT特征值封装 - `EScooterClient` - 电动滑板车控制示例实现 ## 开发环境 - Windows 10/11 - Java 8+ - Visual Studio 2022(用于构建原生代码) ## 使用示例 ```java // 初始化蓝牙管理器 BluetoothManager manager = new BluetoothManager(); // 扫描BLE设备 List devices = manager.scanBleDevices(5); // 连接设备 manager.connectBleDevice("设备地址"); // 读取GATT特征值 byte[] data = manager.readCharacteristic("地址", "服务UUID", "特征值UUID"); // 写入特征值 manager.writeCharacteristic("地址", "服务UUID", "特征值UUID", data); // 断开连接 manager.disconnectDevice("地址"); ``` ## 滑板车控制示例 包含完整的电动滑板车控制示例,支持: - 设备连接与断开 - 状态监控 - 速度控制 - 档位调节 - 灯光控制 - 电池状态查询 ## 原生支持 通过JNI实现Windows蓝牙API的Java绑定,包含: - 蓝牙设备枚举 - 经典蓝牙连接 - BLE GATT操作 ## 许可证 本项目基于[MIT License](LICENSE)协议开源。