Beispiel #1
0
		void ConnectToSelectedDevice (object sender, EventArgs e)
		{
			monitor = heartRateMonitors [0];
			Console.WriteLine ("monitor:" + monitor);
			if (monitor != null) {
				statusLabel.Text = "Connecting to " + monitor.Name + " ... ";
				monitor.Connect ();
			}
		}
Beispiel #2
0
 void ConnectToSelectedDevice(object sender, EventArgs e)
 {
     monitor = heartRateMonitors [0];
     Console.WriteLine("monitor:" + monitor);
     if (monitor != null)
     {
         statusLabel.Text = "Connecting to " + monitor.Name + " ... ";
         monitor.Connect();
     }
 }
        void ConnectToSelectedDevice(object sender, EventArgs e)
        {
            var peripheral = heartRateMonitors [(int)deviceTableView.SelectedRow];

            if (peripheral != null)
            {
                DisconnectMonitor();

                statusLabel.StringValue = "Connecting...";

                connectedMonitor                   = new HeartRateMonitor(manager, peripheral);
                connectedMonitor.HeartBeat        += OnHeartBeat;
                connectedMonitor.HeartRateUpdated += OnHeartRateUpdated;
                connectedMonitor.RssiUpdated      += OnRssiUpdated;
                connectedMonitor.NameUpdated      += OnNameUpdated;
                connectedMonitor.Connect();
            }

            DismissDeviceListSheet((NSObject)sender);
        }