Esempio n. 1
0
 public Form1()
 {
     InitializeComponent();
     InTheHand.Net.Bluetooth.BluetoothRadio br = InTheHand.Net.Bluetooth.BluetoothRadio.PrimaryRadio;
     if (br == null)
     {
         MessageBox.Show("No support Bluetooth radio/stack found.");
     }
     else if (br.Mode != InTheHand.Net.Bluetooth.RadioMode.Discoverable)
     {
         DialogResult rslt = MessageBox.Show("Make BluetoothRadio Discoverable?", "DeviceListener",
                                             MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
         if (rslt == DialogResult.Yes)
         {
             br.Mode = InTheHand.Net.Bluetooth.RadioMode.Discoverable;
         }
     }
     listener = new ObexListener(ObexTransport.Bluetooth);
     items    = new ArrayList();
 }
Esempio n. 2
0
        public ListenerForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            InTheHand.Net.Bluetooth.BluetoothRadio br = InTheHand.Net.Bluetooth.BluetoothRadio.PrimaryRadio;
            if (br == null)
            {
                MessageBox.Show("No support Bluetooth radio/stack found.");
            }
            else if (br.Mode != InTheHand.Net.Bluetooth.RadioMode.Discoverable)
            {
                DialogResult rslt = MessageBox.Show("Make BluetoothRadio Discoverable?", "DeviceListener",
                                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                if (rslt == DialogResult.Yes)
                {
                    br.Mode = InTheHand.Net.Bluetooth.RadioMode.Discoverable;
                }
            }

            /*
             * InTheHand.Net.Forms.SelectBluetoothDeviceDialog sbdd = new InTheHand.Net.Forms.SelectBluetoothDeviceDialog();
             * sbdd.Info = "Oh just pick one, they are all the same!";
             * if (sbdd.ShowDialog() == DialogResult.OK)
             * {
             *
             *
             *  byte[] rec = sbdd.SelectedDevice.GetServiceRecord(InTheHand.Net.Bluetooth.BluetoothService.SerialPort);
             *
             * }*/


            ol = new ObexListener(ObexTransport.Bluetooth);
            ol.Start();
        }