uni-app 是使用 Vue.js 开发跨平台应用的前端框架,开发者编写一套代码,可编译到iOS、Android、H5、小程序等多个平台。
1、初始化蓝牙 uni.openBluetoothAdapter(OBJECT) 2、开始搜索蓝牙设备 uni.startBluetoothDevicesDiscovery(OBJECT) 3、发现外围设备 uni.onBluetoothDeviceFound(CALLBACK) 4、停止搜寻附近的蓝牙外围设备 uni.stopBluetoothDevicesDiscovery(OBJECT) 5、连接低功耗蓝牙设备 uni.createBLEConnection(OBJECT) 6、获取蓝牙设备所有服务 uni.getBLEDeviceServices(OBJECT) 7、获取蓝牙特征 uni.getBLEDeviceCharacteristics(OBJECT) 8、启用蓝牙设备特征值变化时的 notify 功能 uni.notifyBLECharacteristicValueChange(OBJECT) 9、监听低功耗蓝牙设备的特征值变化 uni.onBLECharacteristicValueChange(CALLBACK) 10、写入蓝牙 uni.writeBLECharacteristicValue(OBJECT)
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有