蓝牙抽象成接口
This commit is contained in:
1 parent
f14a071179
commit
81a18de9f4
20 files changed
+658
-44
No files matched your search
@@ -0,0 +1,28 @@
|
||||
using Assets.Scripts.Ble;
|
||||
using Assets.Scripts.Ble.Scan;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Devices.Ble.Interfaces
|
||||
{
|
||||
public interface IBleWinHwInterface
|
||||
{
|
||||
void StartScan(Action<BleAdvertisementInfo> discoveredCallBack);
|
||||
void ConnectPeripheral(BlePeripheralInfo info, Action<IBleWinHwInterface, BlePeripheralInfo, BleResponse> callback);
|
||||
void DisconnectPeripheral(BlePeripheralInfo peripheral, Action callback);
|
||||
void DiscoverServices(BlePeripheralInfo peripheral, Action<IBleWinHwInterface, BlePeripheralInfo, BleResponse<List<BleServiceInfo>>> callback);
|
||||
void DiscoverCharacteristic(BleServiceInfo service, CharacteristicsDiscoveredCallback callback);
|
||||
void SubscribeCharacteristic(BleCharacteristicInfo characteristic, Action<IBleWinHwInterface, BleCharacteristicInfo, BleResponse> callback);
|
||||
void WriteCharacteristic(BleCharacteristicInfo characteristic, byte[] data);
|
||||
void ReadCharacteristic(BleCharacteristicInfo characteristic, CharacteristicReadCallback callback);
|
||||
void Dispose();
|
||||
BleState BleState { get; set; }
|
||||
Dictionary<string, BleAdvertisementInfo> pCache { get; set; }
|
||||
event BluetoothStateChangedCallback BluetoothStateChangedEvent;
|
||||
event CharacteristicReadCallback CharacteristicReadEvent;
|
||||
event PeripheralDisconnectedCallback PeripheralDisconnectedEvent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86216427171ac784296ca577b921b2e7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user