Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2007

Tip: Looking for answers? Try searching our database.

Serial Communications - baud rate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Costello - 17 Jul 2007 20:50 GMT
I am using the Serial Port class for serial communications, It is very easy
to use but there is one thing I want to do and can't figure out how.
SerialPort.GetPortNames() gives me a list of all the Serial Ports on the
system. I let the end user select one from the list. I also want to give the
user the ability to specify the baud rate for the selected port. However, I
could not find an interface that will list all the baud rates for a given
port. I looked in the registry and the values did not seem to be there.

Anyone know how I can get the supported baud rates for any serial port?

Thanks in Advance,

Bob Costello
Matt Lacey - 19 Jul 2007 15:10 GMT
> I am using the Serial Port class for serial communications, It is very easy
> to use but there is one thing I want to do and can't figure out how.
[quoted text clipped - 9 lines]
>
> Bob Costello

There isn't a managed calls for this in the framework (yet - we live
in hope)

This information is available through the API function:
GetCommProperties - http://msdn2.microsoft.com/En-US/library/aa363259.aspx

For an example on pinvoking it see:
http://pinvoke.net/default.aspx/kernel32/GetCommProperties.html
or
http://www.webtropy.com/articles/art9-1.asp?f=GetCommProperties

Alternatively, have a look at http://www.codeproject.com/dotnet/DotNetComPorts.asp
where a lot of the work is done for you.
Bob Costello - 20 Jul 2007 15:42 GMT
Matt,

Thanks. I did spot the GetCommProperties after I posted my questions. In
fact, I got it from the following link, which gives the  gives  the C#
declarations for hundreds of win API functions:

http://www.webtropy.com/articles/Win32-API-DllImport-art9.asp?Windows+API

I will check out the CodeProject example.

Thanks

> > I am using the Serial Port class for serial communications, It is very easy
> > to use but there is one thing I want to do and can't figure out how.
[quoted text clipped - 23 lines]
> Alternatively, have a look at http://www.codeproject.com/dotnet/DotNetComPorts.asp
> where a lot of the work is done for you.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.