Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Dec 09, 2019 2:51 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Serial Port problem when Bluetooth port exists
PostPosted: Tue Jun 26, 2012 4:33 am 
Offline

Joined: Mon Jan 16, 2012 11:20 am
Posts: 27
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Serial Port problem when Bluetooth port exists
PostPosted: Thu Jun 28, 2012 7:43 am 
Offline

Joined: Mon Jan 16, 2012 11:20 am
Posts: 27
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Serial Port problem when Bluetooth port exists
PostPosted: Tue Aug 21, 2012 1:32 am 
Offline

Joined: Mon Apr 19, 2010 1:08 pm
Posts: 7
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Serial Port problem when Bluetooth port exists
PostPosted: Tue Aug 21, 2012 2:14 am 
Offline

Joined: Wed Feb 16, 2011 1:59 pm
Posts: 74
Location: Arizona, USA
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.

_________________
Windows XP SP3
RS 2012r2


Top
 Profile  
Reply with quote  
 Post subject: Re: Serial Port problem when Bluetooth port exists
PostPosted: Tue Sep 11, 2012 2:33 pm 
Offline

Joined: Mon Jan 16, 2012 11:20 am
Posts: 27
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Serial Port problem when Bluetooth port exists
PostPosted: Fri Sep 14, 2012 7:30 am 
Offline

Joined: Mon Jan 16, 2012 11:20 am
Posts: 27
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?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group