About Search Blutooth devices in C#
-
How to searching bluetooth devices in c#.net? using InTheHand.Net; using InTheHand.Net.Sockets; using InTheHand.Net.Bluetooth; BluetoothRadio.PrimaryRadio.Mode = RadioMode.Discoverable; BluetoothRadio myRadio = BluetoothRadio.PrimaryRadio; lblSearch.Text = "" + myRadio.LocalAddress.ToString(); bluetoothClient = new BluetoothClient(); Cursor.Current = Cursors.WaitCursor; BluetoothDeviceInfo[] bluetoothDeviceInfo = { }; bluetoothDeviceInfo = bluetoothClient.DiscoverDevices(100000); comboBox1.DataSource = bluetoothDeviceInfo; comboBox1.DisplayMember = "DeviceName"; comboBox1.ValueMember = "DeviceAddress"; comboBox1.Focus(); Cursor.Current = Cursors.Default; this code run but the code finish at a second and can't find any mobile bluetooth device. i want search bluetooth in period of time . for example search device for 10 second and find any bluetooth devices. thanks for your help and your guide. best regards.
-
How to searching bluetooth devices in c#.net? using InTheHand.Net; using InTheHand.Net.Sockets; using InTheHand.Net.Bluetooth; BluetoothRadio.PrimaryRadio.Mode = RadioMode.Discoverable; BluetoothRadio myRadio = BluetoothRadio.PrimaryRadio; lblSearch.Text = "" + myRadio.LocalAddress.ToString(); bluetoothClient = new BluetoothClient(); Cursor.Current = Cursors.WaitCursor; BluetoothDeviceInfo[] bluetoothDeviceInfo = { }; bluetoothDeviceInfo = bluetoothClient.DiscoverDevices(100000); comboBox1.DataSource = bluetoothDeviceInfo; comboBox1.DisplayMember = "DeviceName"; comboBox1.ValueMember = "DeviceAddress"; comboBox1.Focus(); Cursor.Current = Cursors.Default; this code run but the code finish at a second and can't find any mobile bluetooth device. i want search bluetooth in period of time . for example search device for 10 second and find any bluetooth devices. thanks for your help and your guide. best regards.
I don't know the complete answer to your question, 'cause I'm not very literate in C#, however... I don't see any timers, and I don't see you returning anything to verify something was found. I would have expected to see at least a 'for' loop. Also, is the radio even turned on? BluetoothRadio.PrimaryRadio.Mode would set it I think. Sorry for not helping your exact question, but I think this might get you on the right path. Maybe an expert could chime in and help more (Or at least let you know if I was completely off-base here...lol). Herb