예제 #1
0
        public override async void OnAppearing()
        {
            if (IsBusy || Characteristic.Count >= 1)
            {
                return;
            }
            IsBusy = true;
            try
            {
                var services = await m_gattServer.ListServiceCharacteristics(m_serviceGuid);

                var list = services?.ToList();
                if (list != null)
                {
                    //Log.Trace( "Discovered chars={0}", list.Select( g => g.ToString() ).Join( "," ) );
                    foreach (var c in list)
                    {
                        var vm = new BleGattCharacteristicViewModel(m_serviceGuid, c, m_gattServer, m_dialogManager);
                        Characteristic.Add(vm);
                        //await vm.UpdateDescriptors();
                    }
                }
            }
            catch (GattException ex)
            {
                Log.Warn(ex);
            }
            IsBusy = false;
        }
예제 #2
0
        public override async void OnAppearing()
        {
            if (IsBusy || Characteristic.Count >= 1)
            {
                return;
            }
            IsBusy = true;
            var services = await m_device.ListServiceCharacteristics(m_serviceId);

            var list = services?.ToList();

            if (list != null)
            {
                //Log.Trace( "Discovered chars={0}", list.Select( g => g.ToString() ).Join( "," ) );
                foreach (var c in list)
                {
                    Characteristic.Add(new BleGattCharacteristicViewModel(m_serviceId, c, m_device, m_dialogs));
                }
            }
            IsBusy = false;
        }