PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Bug report
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Bug report
![]() |
Bug report |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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" <ole@blabla.com> wrote in message news:%23d$eIyiYHHA.2556@TK2MSFTNGP02.phx.gbl... > 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 > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

