蓝牙抽象成接口

This commit is contained in:
lishuo committed 2021-08-19 18:03:25 +08:00
1 parent f14a071179
commit 81a18de9f4
20 files changed
+658 -44

No files matched your search

@@ -2,6 +2,7 @@
using Assets.Scripts.Ble.Service;
using Assets.Scripts.Commands;
using Assets.Scripts.Devices.Ble;
using Assets.Scripts.Devices.Ble.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -36,12 +37,12 @@ namespace Assets.Scripts.Ble.HeartRate
}
}
private void HrmCharacteristicSubscribed(BleWinHwInterface winHwInterface, BleCharacteristicInfo characteristic, BleResponse response)
private void HrmCharacteristicSubscribed(IBleWinHwInterface winHwInterface, BleCharacteristicInfo characteristic, BleResponse response)
{
}
private void HrmCharacteristicRead(BleWinHwInterface winHwInterface, BleCharacteristicInfo characteristic, BleResponse<byte[]> response)
private void HrmCharacteristicRead(IBleWinHwInterface winHwInterface, BleCharacteristicInfo characteristic, BleResponse<byte[]> response)
{
HeartRateMeasurementValue heartRateMeasurementValue;
if(base.CheckCharacteristicResponse<HeartRateMeasurementValue>(characteristic, response, (BleCharacteristicInfo info, BleResponse<byte[]> bleResponse) => new HeartRateMeasurementValue(bleResponse.Data), out heartRateMeasurementValue) != CommandResponseCode.Success)