Exemple #1
0
        /// <summary>
        /// Occurs after view associated with this controller loaded
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.Title = "Sensor Pairing";

            // set data source for the table view
            DeviceTableView.Source = _sensorListSource;

            InitializeScanButton();

            // attach handlers to custom events so we'll know when peripheral discovered or sensor connected/disconnected
            _bluetoothSensorManager.DiscoveredPeripheral     += OnDiscoveredPeripheral;
            _bluetoothSensorManager.SensorConnectionsChanged += OnSensorConnectionsChanged;

            // Set up background worker.  BG worker's method to do work just calls the stop scanning method in sensor manager
            _bgScanner = new BackgroundWorkerWrapper(CompleteScanning, FinishUIUpdates, SCAN_INTERVAL);
        }