OK, there are several things there that might easily be wrong. I'm certainly no Bluetooth expert, either.
Something is funny about how you are creating that array. Why are you creating it first, then assigning it to the result of DiscoverDevices()? That's obviously wrong.
As far as the device itself, *is* Bluetooth turned on? It seems like *the* most likely cause of the problem is that it is off. Does your other PPC device show this device when you browse the Bluetooth list? Are you sure that the functions used by OpenNETCF correspond to the Bluetooth 'stack' actually used in your device? This is covered in one or more of the comments in the source code. If the device uses the Widcom stack, it won't work. Only the MS stack is supported. What device is it?
Paul T.
i am using this piece of code:
============================================================
<........>
using OpenNETCF.Net.Bluetooth;
<.......>
private OpenNETCF.Net.Bluetooth.BluetoothDeviceInfo [] bdi = new BluetoothDeviceInfo[10];
<.......>
private void button1_Click(object sender, System.EventArgs e)
{
OpenNETCF.Net.Bluetooth.BluetoothClient bt = new OpenNETCF.Net.Bluetooth.BluetoothClient();
bdi = bt.DiscoverDevices();
for(int i=0; i<bdi.Length; i++)
{
comboBox1.Items.Add(bdi.DeviceName);
}
}
============================================================
and the code dos not return any devices around me. (i have another pocket pc with bluetooth enabled).
BUT, when i call this property, it returns that my bluetooth device is not present.
<.........>
Text1.Text = OpenNETCF.Net.Bluetooth.BluetoothClient.HardwareStatus.ToString();
<.........>
"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com> wrote in message And why does it not work for you?
Paul T.
Hi,
I am looking for a code sample that i can discover bluetooth devices around me.
My device isa Ipaq 4150 with bluetooth enabled.
I found a piece of code on the popular OpenNETCF library.
But it not works for me.
Anyone can help me?
thanks!