uni.writeBLECharacteristicValue({
deviceId: this.$store.state.deviceId,
serviceId: this.$store.state.serviceId,
characteristicId: this.$store.state.writeCharacteristicId,
value: arrayBuffer,
success() {
console.log("写入成功");
// getDeviceMenuHandler()
},
fail(res) {
console.log("写入失败,");
},
complete() {
console.log("调用成功");
},
});

- 发布:2025-06-11 11:50
- 更新:2025-06-11 11:50
- 阅读:39
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: Sequoia 15.1.1
HBuilderX类型: Alpha
HBuilderX版本号: 4.66
手机系统: iOS
手机系统版本号: iOS 15
手机厂商: 苹果
手机机型: iphone6s
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
uni.writeBLECharacteristicValue({
deviceId: this.$store.state.deviceId,
serviceId: this.$store.state.serviceId,
characteristicId: this.$store.state.writeCharacteristicId,
value: arrayBuffer,
success() {
console.log("写入成功");
// getDeviceMenuHandler()
},
fail(res) {
console.log("写入失败,");
},
complete() {
console.log("调用成功");
},
});
uni.writeBLECharacteristicValue({
deviceId: this.$store.state.deviceId,
serviceId: this.$store.state.serviceId,
characteristicId: this.$store.state.writeCharacteristicId,
value: arrayBuffer,
success() {
console.log("写入成功");
// getDeviceMenuHandler()
},
fail(res) {
console.log("写入失败,");
},
complete() {
console.log("调用成功");
},
});
预期结果:
成功调用三个回调之一
成功调用三个回调之一
实际结果:
为调用回调
为调用回调
bug描述:
IOS APP uni.writeBLECharacteristicValue 无回调问题,未超过20个字节,安卓和小程序正常
0 个回复