tcp库更新&附近人下拉调整
This commit is contained in:
1 parent
3de8b1d555
commit
bb08b6b762
4 files changed
+14
-2
No files matched your search
@@ -167,6 +167,15 @@ namespace Assets.Scripts.Ble
|
||||
};
|
||||
public static readonly IReadOnlyList<ServiceUuid> CyclingServices = ServiceUuids.Services.Where(s => s.IsCycling).ToList();
|
||||
|
||||
public static List<string> GetServiceUuidList()
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (var item in Services)
|
||||
{
|
||||
list.Add(item.IdGuid.ToString());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public static ServiceUuid Get(byte[] type)
|
||||
{
|
||||
return ServiceUuids.Services.Single(s => s.IdByteArray == type);
|
||||
|
||||
@@ -66,7 +66,8 @@ namespace Assets.Scripts.Devices.Ble
|
||||
}
|
||||
|
||||
public void StartWatcher() {
|
||||
BluetoothLEHardwareInterface.ScanForPeripheralsWithServices(null, null, (address, name, rssi, bytes) =>
|
||||
|
||||
BluetoothLEHardwareInterface.ScanForPeripheralsWithServices(ServiceUuids.GetServiceUuidList().ToArray(), null, (address, name, rssi, bytes) =>
|
||||
{
|
||||
ScanInfoReceived?.Invoke(this, address, name, rssi, bytes);
|
||||
}, true);
|
||||
|
||||
Reference in new issue
Block a user