Example #1
0
 internal BLEService(BluetoothGatt gatt, BLEGATTCallback callback, BluetoothGattService service)
     : this()
 {
     _gatt     = gatt;
     _callback = callback;
     _service  = service;
 }
        internal BLEDescriptor(BluetoothGatt gatt, BLEGATTCallback callback, BluetoothGattDescriptor descriptor)
        {
            _gatt       = gatt;
            _callback   = callback;
            _descriptor = descriptor;

            _callback.DescriptorRead  += OnDescriptorRead;
            _callback.DescriptorWrite += OnDescriptorWrite;
        }
Example #3
0
        internal BLECharacteristic(BluetoothGatt gatt, BLEGATTCallback callback, BluetoothGattCharacteristic characteristic)
        {
            _gatt           = gatt;
            _callback       = callback;
            _characteristic = characteristic;

            _callback.CharacteristicChanged += OnCharacteristicChanged;
            _callback.CharacteristicRead    += OnCharacteristicRead;
            _callback.CharacteristicWrite   += OnCharacteristicWrite;
        }
Example #4
0
        internal BLEDevice(BluetoothManager manager, BluetoothDevice device)
            : this()
        {
            _manager  = manager;
            _device   = device;
            _callback = new BLEGATTCallback();

            _callback.ConnectionStateChanged += OnConnectionStateChanged;
            _callback.ReadRemoteRSSI         += OnReadRemoteRSSI;
            _callback.ServicesDiscovered     += OnServicesDiscovered;
        }