Beispiel #1
0
        protected override void OnResume()
        {
            base.OnResume();

            contentView.StartReadButton.Click += OnButtonClick;
            contentView.EndReadButton.Click   += EndRead;
            contentView.LedOnButton.Click     += delegate {
                new Thread(() => {
                    BtReceiver.LedOn();
                }).Start();
            };
            contentView.LedOffButton.Click += delegate {
                new Thread(() => {
                    BtReceiver.LedOff();
                }).Start();
            };
            contentView.ResetButton.Click += delegate {
                new Thread(() => {
                    BtReceiver.Reset();
                }).Start();
            };

            BtClient.Scanning      += OnScanning;
            BtClient.Found         += OnDeviceFound;
            BtClient.NotFound      += OnDeviceNotFound;
            BtClient.Connecting    += OnConencting;
            BtClient.Connected     += OnConnected;
            BtClient.Disconnecting += OnDisconnecting;
            BtClient.Disconnected  += OnDisconnected;

            BtClient.Init();

            contentView.Map.OnResume();
        }
Beispiel #2
0
 void OnDeviceFound(object sender, EventArgs e)
 {
     RunOnUiThread(delegate {
         BtClient.Connect(this);
     });
 }