PC Review


Reply
 
 
Ole
Guest
Posts: n/a
 
      9th Mar 2007
There is for sure a bug in Compact Framework 2.0 in the System.IO.Ports
namespace. The bug is in the BaudRate property of the SerialPort when a
Bluetooth unit is connected to the Port. The Error can be recreated by
runnning the following code (at least on a Pocket PC 2003 Device):
using System.IO.Ports;

SerialPort Commport = new SerialPort("COM8"); // COM8 is a Bluetooth
outbound port

Commport.Open();
Commport.BaudRate = 115200;

Following exception occurs:
innerException = {System.ArgumentOutOfRangeException: Argument must be
between 0 and 65536.
Parameter name: baudRate
at System.IO.Ports.SerialStream.set_BaudRate()
at System.IO.Ports.SerialPort.set_BaudRate()
at TestCom.Form1.button1_Click()
at System.Windows.Forms.C...

But there is no problem when using the API SetCommState!!!

Thanks
Ole



 
Reply With Quote
 
 
 
 
Ole
Guest
Posts: n/a
 
      9th Mar 2007
To others who are struggling the same problem there is a hint to a
workaround:
Check if the COM port you are trying to set baudrate of is a Bluetooth
module and if it is then Don't set the baud rate! A bluetooth module doesn't
care about baud rates as it is a radio port so even if the baudrate is set
to 9600 it will communicate at 115200. If the port is a normal wired serial
port there is no problem by setting it to 115200.

BR
Ole


"Ole" <(E-Mail Removed)> wrote in message
news:%23d$(E-Mail Removed)...
> There is for sure a bug in Compact Framework 2.0 in the System.IO.Ports
> namespace. The bug is in the BaudRate property of the SerialPort when a
> Bluetooth unit is connected to the Port. The Error can be recreated by
> runnning the following code (at least on a Pocket PC 2003 Device):
> using System.IO.Ports;
>
> SerialPort Commport = new SerialPort("COM8"); // COM8 is a Bluetooth
> outbound port
>
> Commport.Open();
> Commport.BaudRate = 115200;
>
> Following exception occurs:
> innerException = {System.ArgumentOutOfRangeException: Argument must be
> between 0 and 65536.
> Parameter name: baudRate
> at System.IO.Ports.SerialStream.set_BaudRate()
> at System.IO.Ports.SerialPort.set_BaudRate()
> at TestCom.Form1.button1_Click()
> at System.Windows.Forms.C...
>
> But there is no problem when using the API SetCommState!!!
>
> Thanks
> Ole
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create duplicate report? (Copy of report, not report of dup iynque Microsoft Access Reports 1 5th Jun 2009 09:54 PM
Totals on Report from main report and sub report combined. Kathy Microsoft Access Queries 1 4th Nov 2008 05:59 PM
Easy report? How to report on a record, skip, report, etc. Gdareos Microsoft Access Reports 1 13th Oct 2007 05:56 PM
Report / Sub report data source lost when adding a new sub report =?Utf-8?B?Sm9lIE1jQw==?= Microsoft Access Reports 5 4th Apr 2005 08:27 PM
Report button linked to exact report record- Open report method? =?Utf-8?B?UmljaA==?= Microsoft Access Forms 1 27th May 2004 07:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:08 AM.