feat(mp): DeviceType 扩展支持 blood_pressure/blood_glucose + 适配器接口改数组返回
This commit is contained in:
@@ -172,14 +172,14 @@ export class BLEManager {
|
||||
// 监听数据通知
|
||||
Taro.onBLECharacteristicValueChange((res: any) => {
|
||||
if (res.deviceId !== device.deviceId) return;
|
||||
const reading = device.adapter!.parseNotification(
|
||||
const newReadings = device.adapter!.parseNotification(
|
||||
res.serviceId,
|
||||
res.characteristicId,
|
||||
res.value,
|
||||
);
|
||||
if (reading) {
|
||||
this.readings = [...this.readings, reading];
|
||||
this.onReadings?.([reading]);
|
||||
if (newReadings.length > 0) {
|
||||
this.readings = [...this.readings, ...newReadings];
|
||||
this.onReadings?.(newReadings);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user