Inheritance: Plugin.BLE.Abstractions.AdapterBase
Ejemplo n.º 1
0
        public Device(Adapter adapter, CBPeripheral nativeDevice, string name, int rssi, List<AdvertisementRecord> advertisementRecords) : base(adapter)
        {
            _nativeDevice = nativeDevice;
            Id = Guid.ParseExact(_nativeDevice.Identifier.AsString(), "d");
            Name = name;

            Rssi = rssi;
            AdvertisementRecords = advertisementRecords;

            // TODO figure out if this is in any way required,  
            // https://github.com/xabre/xamarin-bluetooth-le/issues/81
            //_nativeDevice.UpdatedName += OnNameUpdated;
        }
 public async void CheckMyAdapter(Adapter adapter)
 {
     await adapter.StartScanningForDevicesAsync();
 }
Ejemplo n.º 3
0
 public Device(Adapter adapter, CBPeripheral nativeDevice)
     : this(adapter, nativeDevice, nativeDevice.Name, nativeDevice.RSSI?.Int32Value ?? 0,
         new List<AdvertisementRecord>())
 {
 }
Ejemplo n.º 4
0
 public Device(Adapter adapter, CBPeripheral nativeDevice)
     : this(adapter, nativeDevice, nativeDevice.Name, nativeDevice.RSSI?.Int32Value ?? 0,
            new List <AdvertisementRecord>())
 {
 }