I have a HC-05 Bluetooth board. It is just a circuit board that connects to the
Tx and Rx pins of a UART output of a microprocessor chip and transmits
using Bluetooth specifications. I want to use a java program to receive the serial stream the UART is sending with my PC runing WinXP. I have a little Bluetooth dongle that plugs in the PC USB port. My UART is continuously sending a 30 character string followed by CR/LF.
I can use BluetoothPresence and it reports Device Discovered: HC-05. I have experimented by turning the device off and on and, yes, the Discovered HC-05 is the right one.
The way the HC-05 works is two comports are created. I think they refer to them as Virtual Comports. I can't seem to get beyond the "Discovered" step.
If I don't use java I can use the XP Bluetooth Devices wizard to discover and pair the HC-05. It then creates two comports, COM11 and COM12. COM11 is labled "Outgoing" and COM12 is labled "Incoming". The designation defines which side controls transfer. If I start a terminal porgram like Hyperterminal and connect to COM11, I will see the UART data stream.
My problem is how do I get java to find COM11? I have a java program, ComportLister.
Now here is where things get confusing. If I DO NOT have terminal program running ComportLister does not find COM11. It finds:
COM12 (The HC-05 incoming port, not the one I want) and
COM1 (a hardware RS232 board in this computer) and
COM4 (a modem board in this computer).
So any attempt to open or access COM11 causes an exception.
Ready for more confusion? If I start the terminal program and connect to COM11 so that the data stream is showing in the terminal window and then run ComportLister it now finds COM11 (along with the others). If I attempt to open it I get an excepton, most likely because the Terminal program has COM11.
Maybe all this XP stuff is TMI but it serves to prove all the hardware is working. But what do I do so that java can use the hardware.
Thanks In Advance
Pete