Exemplo n.º 1
0
        private void Disconnect()
        {
            FWatcher.Stop();
            FHub.Disconnect();
            FManager.Close();

            btConnect.Enabled    = true;
            btDisconnect.Enabled = false;
        }
Exemplo n.º 2
0
 private void Stop()
 {
     // Stop discovering.
     FWatcher.Stop();
     // Close Bluetooth Manager.
     FManager.Close();
 }
Exemplo n.º 3
0
        private void FWatcher_OnHubFound(Object Sender, Int64 Address, String Name)
        {
            wclBluetoothRadio Radio = FWatcher.Radio;

            FWatcher.Stop();
            Int32 Res = FHub.Connect(Radio, Address);

            if (Res != wclErrors.WCL_E_SUCCESS)
            {
                MessageBox.Show("Connect failed: 0x" + Res.ToString("X8"));
                EnableConnect(false);
            }
            else
            {
                laStatus.Text = "Connecting";
            }
        }