Esempio n. 1
0
        void conn()
        {
            CancellationTokenSource source = new CancellationTokenSource();
            CancellationToken       Ender  = source.Token;

            //ShowMessage("Hey", "We re-connected");
            _savedCharacteristic.Notify(false, true).Subscribe(a =>
                                                               { SetReadValue(a); if (Endd == true)
                                                                 {
                                                                     source.Cancel();
                                                                 }
                                                                 Endd = false; },
                                                               ex => ShowMessage("Poop", "poop"), Ender);
        }
Esempio n. 2
0
        void conn()
        {
            CancellationTokenSource source = new CancellationTokenSource();
            CancellationToken       Ender  = source.Token;

            //ShowMessage("Hey", "We re-connected");
            if (_savedCharacteristic != null)
            {
                _savedCharacteristic.Notify(false, true).Subscribe(a =>
                                                                   { SetReadValue(a); if (Endd == true)
                                                                     {
                                                                         source.Cancel();
                                                                     }
                                                                     Endd = false; },
                                                                   ex => Application.Current.MainPage.Navigation.PopAsync(), Ender);
            }
            if (_savedCharacteristic == null)
            {
                ShowMessage("Oops", "Please use with an MPGuino device");
            }
        }