29 lines
1.5 KiB
C#
29 lines
1.5 KiB
C#
|
|
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;
|
|||
|
|
}
|
|||
|
|
}
|