Exemplo n.º 1
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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public BleDescriptor GetDescriptorOrNull(BleUuid uuid)
        {
            BleDescriptor descriptor;

            return(TryGetDescriptor(uuid, out descriptor) ? descriptor : null);
        }
Exemplo n.º 5
0
        public bool HasDescriptor(BleUuid uuid)
        {
            BleDescriptor descriptor;

            return(TryGetDescriptor(uuid, out descriptor));
        }
Exemplo n.º 6
0
        public virtual bool HasService(BleUuid uuid)
        {
            BleService service;

            return(TryGetService(uuid, out service));
        }
Exemplo n.º 7
0
        public BleService GetServiceOrNull(BleUuid uuid)
        {
            BleService service;

            return(TryGetService(uuid, out service) ? service : null);
        }
Exemplo n.º 8
0
        public virtual bool HasCharacteristic(BleUuid uuid)
        {
            BleCharacteristic characteristic;

            return(TryGetCharacteristic(uuid, out characteristic));
        }
Exemplo n.º 9
0
        public BleCharacteristic GetCharacteristicOrNull(BleUuid uuid)
        {
            BleCharacteristic characteristic;

            return(TryGetCharacteristic(uuid, out characteristic) ? characteristic : null);
        }