Open boronlin opened 4 years ago
请提供一个简单示例工程
//获取某个服务下的所有特征值
getBLECharacteristics() {
let deviceId = this.equipment[0].deviceId;
let serviceId = this.servicesData[0].uuid;
console.log(deviceId);
console.log(serviceId);
plus.bluetooth.getBLEDeviceCharacteristics({
deviceId, // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
serviceId, // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
success: res => {
console.log('获取特征值成功:' + JSON.stringify(res));
this.valueChangeData = {};
this.showMaskType = 'characteristics';
this.Ssz = res.characteristics;
if (this.Ssz.length <= 0) {
toast('获取特征值失败,请重试!');
return;
}
this.maskShow = true;
},
fail: e => {
console.log('获取特征值失败:' + JSON.stringify(e));
}
});
},
代码是是当前 dcloudio/uni-app 直接Clone出来的,所以这个问题可能是内部模块问题。
问题描述 [问题描述:尽可能简洁清晰地把问题描述清楚] 我们自己开发蓝牙,其中一个特征属性为write为true, 在ios里获取是正确的,但在安卓里为false, 当写入是,如果使用 uni.writeBLECharacteristicValue写入就会提示"该特征属性不可写入",如果把 uni改成plus.bluetooth, 又可以正常写入。
复现步骤 [复现问题的步骤] 使用当前项目源码
预期结果 读取特征属性在安卓和iOS是一至的,都是为true
实际结果 读取特征属性在安卓和iOS是一至的,都是为true
系统信息: