using Assets.Scripts.Devices.Ant;
using Assets.Scripts.Devices.Ble;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Ble.Scan
{
///
/// 广播数据
///
public class BleAdvertisementInfo
{
public BlePeripheralInfo Peripheral { get; }
public int Rssi { get; set; }
public SensorType SensorType { get; internal set; }
public BleAdvertisementInfo(BlePeripheralInfo peripheral, int rssi, bool connectible, List services, byte[] manufactureData, SensorType sensor)
{
this.Peripheral = peripheral;
this.Rssi = rssi;
//this.Connectible = connectible;
this.services = services;
//this.ManufactureData = manufactureData;
this.SensorType = sensor;
Index = 1;
}
private readonly List services;
public IReadOnlyList Services
{
get
{
return this.services;
}
}
public void TryAddService(Guid service)
{
if (this.services.Contains(service))
return;
this.services.Add(service);
}
public int Index { get; set; }
}
}