feat(mp): DeviceType 扩展支持 blood_pressure/blood_glucose + 适配器接口改数组返回

This commit is contained in:
iven
2026-04-28 19:27:14 +08:00
parent 83e243f03e
commit 8a5b14e087
3 changed files with 18 additions and 14 deletions

View File

@@ -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);
}
});