コード例 #1
0
        internal BLEService(BLECBPeripheralWrapper peripheral, CBService service)
        {
            _peripheralReference = new WeakReference(peripheral);
            _service             = service;

            PeripheralWrapper.DiscoveredCharacteristic += OnDiscoveredCharacteristic;
        }
コード例 #2
0
        internal BLEDescriptor(BLECBPeripheralWrapper peripheral, CBDescriptor descriptor)
        {
            _peripheralReference = new WeakReference(peripheral);
            _descriptor          = descriptor;

            PeripheralWrapper.UpdatedValue         += OnUpdatedValue;
            PeripheralWrapper.WroteDescriptorValue += OnWroteDescriptorValue;
        }
コード例 #3
0
        internal BLECharacteristic(BLECBPeripheralWrapper peripheral, CBCharacteristic characteristic)
        {
            _peripheralReference = new WeakReference(peripheral);
            _characteristic      = characteristic;

            PeripheralWrapper.UpdatedCharacterteristicValue += OnUpdatedCharacterteristicValue;
            PeripheralWrapper.WroteCharacteristicValue      += OnWroteCharacteristicValue;
            PeripheralWrapper.UpdatedNotificationState      += OnUpdatedNotificationState;
            PeripheralWrapper.DiscoveredDescriptor          += OnDiscoveredDescriptor;
        }
コード例 #4
0
        internal BLEDevice(BLECBCentralManagerWrapper manager, CBPeripheral peripheral)
        {
            _managerReference  = new WeakReference(manager);
            _peripheralWrapper = new BLECBPeripheralWrapper(peripheral);

            ManagerWrapper.ConnectedPeripheral       += OnConnectedPeripheral;
            ManagerWrapper.DisconnectedPeripheral    += OnDisconnectedPeripheral;
            ManagerWrapper.FailedToConnectPeripheral += OnFailedToConnectPeripheral;

            _peripheralWrapper.RSSIRead          += OnRssiRead;
            _peripheralWrapper.DiscoveredService += OnDiscoveredService;
        }