Exemple #1
0
        /// <summary>
        /// Initializes the whole structure. This is called indirectly during the construction of a BleDevice so would not normally be called.
        /// </summary>
        /// <param name="parentService">parent BleService object</param>
        public void Initialize(BleService parentService)
        {
            if (parentService.DeviceService != null)
            {
                Characteristic = parentService.DeviceService.GetCharacteristics(UUID).FirstOrDefault();
                if (Characteristic == null)
                {
                    return;
                }

                CharacteristicProperties = Characteristic.CharacteristicProperties;
                if (SupportNotification || SupportIndication)
                {
                    Characteristic.ValueChanged += ValueChangedHandler;
                }
            }
        }
Exemple #2
0
 protected void RegisterNewService(BleService service)
 {
     AllServices.Add(service);
 }