Comm32 Logo
Home Button   

Topic:   Scomm32 with vb6 and Blue Tooth Ports

By: Curt TampaPosted on: Mar 24 2016 at 01:22:27 AM
It works fine on regular Serial Ports. When it opens a Blue Tooth port and I output a character it goes into the sComm1.output chr(32) but it Never comes out. No Error, It just Hangs

By: SupportPosted on: Mar 24 2016 at 10:02:20 AM
I assume you're working with Chuck at sasco. See the email I sent to chuck earlier today.

Chuck tells me that your code loops through testing a number of com ports looking for the one to use. You don't want the Bluetooth devices at all but if there is one your code gets hung up testing it.

Network Timeout. Bluetooth ports are virtual com ports which stick around long after the BT device has gone away. Windows is unaware if the remote BT device is in range or even if it still exists at all so will blindly try to connect and sit there for ages hoping that the remote device will come back in range. It doesn't hang forever. It does timeout eventually but the delay, many minutes in some cases, really is unacceptable. I have no idea why Windows network timeouts are set so long.

If you were writing a multi-threaded app then you could start separate threads to test the ports and kill any thread that hangs. Chuck didn't say what programming language you're using but I suspect it's VB6. Multi-threading in VB6 isn't easy.

SComm32 has a property .CommName Take a look at that and see if you can use the friendly name of the port to figure out what kind of com port you're dealing with before trying to open it to send your test data. I mean if it contains the word 'Blue', 'BT' or something like that then just skip that one and move on to the next.