InTheHand bluetooth

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hello,

I tried the InTheHand free software to connect my pda to a gps
receiver.

The pda is a WorkAbout Pro of PsionTeklogix. I asked them which stack
the bluetooth module uses, but have no answer yet. It is probably
Microsoft Stack (if someone knows the answer, also please let me know).

A testprogram calls these functions :

InTheHand.Net.Sockets.BluetoothClient inTheHandBluetoothClient = new
InTheHand.Net.Sockets.BluetoothClient();

InTheHand.Net.Sockets.BluetoothDeviceInfo[]
inTheHandBluetoothDeviceInfo =
inTheHandBluetoothClient.DiscoverDevices(1);

which causes an exception (trying to communicate whith a bluetooth gps
receiver) :

An unhandled exception of type 'System.NullReferenceException' occurred
in InTheHand.Net.Bluetooth.dll.

When try this code with an Asus pda (which uses a WidCom stack, so it
is normal that it doesnot work here), there is no crash; the device is
simply not detected apparently (the DiscoverDevices function returns
immediately).
This is an indication for me that the PsionTeklogix pda might use a
microsoft stack, since the result of the test is different.

Thanks for any help to make this work for me,

Paul
 
Before creating an instance of BluetoothClient call
BluetoothRadio.PrimaryRadio and check that it returns a BluetoothRadio
instance not null. If it doesn't return a valid BluetoothRadio object then
this means it doesn't use the microsoft stack.

Peter
 
Peter said:
Before creating an instance of BluetoothClient call
BluetoothRadio.PrimaryRadio and check that it returns a BluetoothRadio
instance not null. If it doesn't return a valid BluetoothRadio object then
this means it doesn't use the microsoft stack.

Peter

Peter, I am using a Psion Teklogix device with WinCE4.2 installed on
it.
The NullReferenceException also occurs with this device, when
performing a device scan.
So I followed your advice:

Dim btRadio As BluetoothRadio
btRadio = BluetoothRadio.PrimaryRadio

....which causes a NullReferenceException.

How can I determine in another way which stack is used and do you have
a link to how the (bluetooth) stack works? I'm a beginner with the
bluetooth story but we will be using it a lot in the future, so any
tips (for beginners) are more than welcome!
 
Hello Peter,

I tried what you wrote :
BluetoothRadio primaryradio = BluetoothRadio.PrimaryRadio;

It does not return a null reference, but causes an exception saying :
"An unhandled exception of type 'System.NullReferenceException'
occurred".
Do you have an explanation for this behaviour ?

Thanks,

Paul


Peter Foot [MVP] schreef:
Before creating an instance of BluetoothClient call
BluetoothRadio.PrimaryRadio and check that it returns a BluetoothRadio
instance not null. If it doesn't return a valid BluetoothRadio object then
this means it doesn't use the microsoft stack.

Peter

--
Peter Foot
Windows Embedded MVP
www.peterfoot.net | www.inthehand.com

Paul said:
Hello,

I tried the InTheHand free software to connect my pda to a gps
receiver.

The pda is a WorkAbout Pro of PsionTeklogix. I asked them which stack
the bluetooth module uses, but have no answer yet. It is probably
Microsoft Stack (if someone knows the answer, also please let me know).

A testprogram calls these functions :

InTheHand.Net.Sockets.BluetoothClient inTheHandBluetoothClient = new
InTheHand.Net.Sockets.BluetoothClient();

InTheHand.Net.Sockets.BluetoothDeviceInfo[]
inTheHandBluetoothDeviceInfo =
inTheHandBluetoothClient.DiscoverDevices(1);

which causes an exception (trying to communicate whith a bluetooth gps
receiver) :

An unhandled exception of type 'System.NullReferenceException' occurred
in InTheHand.Net.Bluetooth.dll.

When try this code with an Asus pda (which uses a WidCom stack, so it
is normal that it doesnot work here), there is no crash; the device is
simply not detected apparently (the DiscoverDevices function returns
immediately).
This is an indication for me that the PsionTeklogix pda might use a
microsoft stack, since the result of the test is different.

Thanks for any help to make this work for me,

Paul
 
Back
Top