public Characteristic(BluetoothGattCharacteristic nativeCharacteristic, BluetoothGatt gatt, GattCallback gattCallback) { _nativeCharacteristic = nativeCharacteristic; _gatt = gatt; _gattCallback = gattCallback; if (_gattCallback != null) { _gattCallback.CharacteristicValueUpdated += ValueUpdatedFunction; } }
public Device(BluetoothDevice nativeDevice, BluetoothGatt gatt, GattCallback gattCallback, int rssi) : base() { Disposed = false; this.nativeDevice = nativeDevice; this.gatt = gatt; this.gattCallback = gattCallback; this.rssi = rssi; // when the services are discovered on the gatt callback, cache them here if (this.gattCallback != null) { this.gattCallback.ServicesDiscovered += (s, e) => { var services = this.gatt.Services; this.services = new List <IService>(); foreach (var item in services) { this.services.Add(new Service(item, this.gatt, this.gattCallback)); } this.ServicesDiscovered(this, e); }; } }
public Service(BluetoothGattService nativeService, BluetoothGatt gatt, GattCallback _gattCallback) { this._nativeService = nativeService; this._gatt = gatt; this._gattCallback = _gattCallback; }