I am working on trying to connect a Bluetooth GPS unit with this library and I am having difficulties. I was able to pair and connect a detector to my Win XP and Win 7 laptops.
I am using the following code snippet to pair, and create a serial port over Bluetooth. This works fine for my detector. I am able to communicate with my detector by sending specialized protocols to read information from the detector.
BluetoothDeviceInfo device = SelectedBluetoothDevice(btDevicesListBox.SelectedItem.ToString());
device.SetServiceState(BluetoothService.SerialPort, true, true);
However, for the Bluetooth GPS unit, this code will not work. Instead I manually paired and connected the GPS unit and noticed that it uses an Incoming SPP on my laptop. This makes sense since this GPS unit is always outputting NMEA strings, and if any computer
is listening, then the computer/program can read it and show a dot on a map, indicating your GPS location.
I would like to do the same using this library, instead of manually creating the connection using the Windows Stack.
I saw the following thread that talks about the BluetoothListener class,
But I am truly unsure as to what I need to do. I am able to pair the GPS unit, that works perfectly, then I need the SPP, and one of them needs to be designated for the incoming direction.
Jul 13, 2012 at 1:46 PM
Don't know whether you made progress with this?
I'm surprised that the GPS make the SPP connection. In all devices I've seen the GPS sends data all the time but its the PC/etc that must make the Bluetooth/RFCOMM/SPP connection.
In that case use a BluetoothClient and Connect(SerialPort). If the GPS connects to the PC then use "new BluetoothListener(SerialPort)" but existing virtual COM ports might grab the incoming connection and stop BluetoothListener from seeing it.