public virtual bool TryGetCharacteristic(BleUuid uuid, out BleCharacteristic characteristic)
        {
            foreach (var c in GetCharacteristics())
            {
                if (c.Uuid == uuid)
                {
                    characteristic = c; return(true);
                }
            }

            characteristic = null; return(false);
        }
Exemple #2
0
        public virtual bool TryGetService(BleUuid uuid, out BleService service)
        {
            foreach (var s in GetServices())
            {
                if (s.Uuid == uuid)
                {
                    service = s; return(true);
                }
            }

            service = null; return(false);
        }
Exemple #3
0
        public virtual bool TryGetDescriptor(BleUuid uuid, out BleDescriptor descriptor)
        {
            foreach (var d in GetDescriptors())
            {
                if (d.Uuid == uuid)
                {
                    descriptor = d; return(true);
                }
            }

            descriptor = null; return(false);
        }
Exemple #4
0
        public virtual bool HasService(BleUuid uuid)
        {
            BleService service;

            return(TryGetService(uuid, out service));
        }
Exemple #5
0
        public BleService GetServiceOrNull(BleUuid uuid)
        {
            BleService service;

            return(TryGetService(uuid, out service) ? service : null);
        }
        public virtual bool HasCharacteristic(BleUuid uuid)
        {
            BleCharacteristic characteristic;

            return(TryGetCharacteristic(uuid, out characteristic));
        }
        public BleCharacteristic GetCharacteristicOrNull(BleUuid uuid)
        {
            BleCharacteristic characteristic;

            return(TryGetCharacteristic(uuid, out characteristic) ? characteristic : null);
        }
Exemple #8
0
        public BleDescriptor GetDescriptorOrNull(BleUuid uuid)
        {
            BleDescriptor descriptor;

            return(TryGetDescriptor(uuid, out descriptor) ? descriptor : null);
        }
Exemple #9
0
        public bool HasDescriptor(BleUuid uuid)
        {
            BleDescriptor descriptor;

            return(TryGetDescriptor(uuid, out descriptor));
        }