# BLEApp **Repository Path**: grlgit/bleapp ## Basic Information - **Project Name**: BLEApp - **Description**: 用uniapp做一下BLE通信,自己学习。 - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 0 - **Created**: 2024-04-18 - **Last Updated**: 2024-11-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # BLEApp #### 介绍 uniapp开发中低功耗蓝牙的使用方法,因为自己刚开发时搞不懂整个蓝牙使用流程,所以专门做了整理。 包括了蓝牙初始化、搜索设备、建立/断开连接、交互通信等的流程和函数接口封装,以供参考。 #### 软件架构 ble.js提供低功耗蓝牙的常用接口封装。 #### 安装教程 直接在HBuilder X中运行到安卓手机。 #### 使用说明 ``` export default { //初始化蓝牙设备 getBluetoothState, //启动蓝牙设备搜索 startDiscoveryBluetooth, //监听蓝牙设备搜索结果 onBluetoothDeviceFound, //停止蓝牙设备搜索 stopDiscoveryBluetooth, //获取蓝牙设备列表 getBluetoothDevices, //建立蓝牙连接 connectBluetooth, //获取服务 getServiceId, //获取特征值 getCharacteId, //启用特征值监听 startNotice, //通过蓝牙发送数据 writeData, //断开蓝牙连接 disconnectBluetooth };