Real Software Forums
http://forums.realsoftware.com/

Serial Port problem when Bluetooth port exists
http://forums.realsoftware.com/viewtopic.php?f=6&t=44505
Page 1 of 1

Author:  sdespont [ Tue Jun 26, 2012 4:33 am ]
Post subject:  Serial Port problem when Bluetooth port exists

Hello,

I am facing a problem using "Serial Port" component. Everything works very well while no Bluetooth com port exists.
On Windows, if there is a Bluetooth port that is not connected to a device, there can be a long (30 sec or more) pause when the port is accessed in a loop like this:

for i=0 to System.SerialPortCount-1
PortList.AddRow System.SerialPort(i).Name
next


The goal is to listen all com ports during 500ms to discover where (and if) my device is pugged in and begin to deal with. But, when a Bluetooth com port exists (and is not connected to the paired device) every accesses to the "System.SerialPort" object freeze all the application even in a thread! So, in one word : help...

I read some information about this problem on this topic, but no solution had been found.

I am really stuck. Someone would have an idea or an advice?

Thanks

Author:  sdespont [ Thu Jun 28, 2012 7:43 am ]
Post subject:  Re: Serial Port problem when Bluetooth port exists

Hello,

Am I really the only guy to have this problem?

There is someone who is using the com port component on a PC with Bluetooth without this problem?

It could be a clue to understand my problem.

Thanks in advance for any answer to this post

Author:  juanolle [ Tue Aug 21, 2012 1:32 am ]
Post subject:  Re: Serial Port problem when Bluetooth port exists

sdespont wrote:
Hello,

I am facing a problem using "Serial Port" component. Everything works very well while no Bluetooth com port exists.
On Windows, if there is a Bluetooth port that is not connected to a device, there can be a long (30 sec or more) pause when the port is accessed in a loop like this:



I have this same problem with Dell laptop and Windows7 (64bit). If I don't disable laptops two internal modem ports, every serial port scanning freeze program for almost one minute. Propably should report a bug?

Author:  languer [ Tue Aug 21, 2012 2:14 am ]
Post subject:  Re: Serial Port problem when Bluetooth port exists

Not sure what you're seeing. I have a laptop with XP and bluetooth (enabled). The following code (for populating a listbox - on open event) works fine:
Me.ListIndex = -1

Dim i, count As UInt8
count = System.SerialPortCount

For i = 0 To count - 1
Me.AddRow(System.SerialPort( i ).Name )
Next

I've never used the port (as it is used by the Mouse), but I see it listed. I've also tried this on a desktop (XP) with Bluetooth as well.

I also have the following on all my ComPort Select DropDown lists (i.e. change event)
If Me.ListIndex = -1 Then Return
Dim baudRate As UInt16
Dim i, count As UInt8

count = System.SerialPortCount

For i = 0 To count - 1
Serial1.SerialPort = System.SerialPort( i )
If Serial1.Open Then
Serial1.Close
End If
Next

I did found that useful in some cases; now I have it in all cases before I allow selection of any port.

Author:  sdespont [ Tue Sep 11, 2012 2:33 pm ]
Post subject:  Re: Serial Port problem when Bluetooth port exists

Interesting, I also have a Dell laptop with Windows 7 OS 64x.

I have tried yesterday to reproduce the problem on another Dell laptop with XP but everything works fine on it.

@ juanolle : Let me know if you find out something

Thx

Author:  sdespont [ Fri Sep 14, 2012 7:30 am ]
Post subject:  Re: Serial Port problem when Bluetooth port exists

Hello,

even
System.SerialPortCount
take more than 5 seconds in my case.

My current workaround is to check the number of seconds spend to do this action and cancel then return an error message to the user if the serial port count action taked more than 4 seconds.

Anyone found something better?

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/