PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Baudrate error?

Reply

Baudrate error?

 
Thread Tools Rate Thread
Old 08-03-2007, 08:03 PM   #1
Ole
Guest
 
Posts: n/a
Default Baudrate error?


Hi,

I'm using the serial port on a Pocket PC (Mobile 2003 - CF 2.0) in my
application, but when i try to set the Baud rate like:
MyPort.BaudRate = 115200;

I get this exception:
{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()
....}

But I know for sure that my device support a baud rate of 115200 (have used
it several times in other applications)

Any idea what could be wrong??
Your help is highly appreciated!

Thanks,
Ole


  Reply With Quote
Old 08-03-2007, 08:34 PM   #2
Fabien
Guest
 
Posts: n/a
Default Re: Baudrate error?

Hi,

Did you check the serial port settings in the ctrl panel?

BR

Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/

On 8 mar, 21:03, "Ole" <o...@blabla.com> wrote:
> Hi,
>
> I'm using the serial port on a Pocket PC (Mobile 2003 - CF 2.0) in my
> application, but when i try to set the Baud rate like:
> MyPort.BaudRate = 115200;
>
> I get this exception:
> {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()
> ...}
>
> But I know for sure that my device support a baud rate of 115200 (have used
> it several times in other applications)
>
> Any idea what could be wrong??
> Your help is highly appreciated!
>
> Thanks,
> Ole



  Reply With Quote
Old 08-03-2007, 09:03 PM   #3
Ole
Guest
 
Posts: n/a
Default Re: Baudrate error?

I'm not sure I did understand your question - what do you mean by control
panel (it's a Pocket PC). I did succesfully use a baudrate of 115200 on the
very same Pocket PC by using calls to the API.

Thanks
Ole

"Fabien" <fab_00_2002@msn.com> wrote in message
news:1173386054.246327.275330@8g2000cwh.googlegroups.com...
> Hi,
>
> Did you check the serial port settings in the ctrl panel?
>
> BR
>
> Fabien Decret
> Windows Embedded Consultant
>
> ADENEO (ADESET)
> http://www.adeneo.adetelgroup.com/
>
> On 8 mar, 21:03, "Ole" <o...@blabla.com> wrote:
>> Hi,
>>
>> I'm using the serial port on a Pocket PC (Mobile 2003 - CF 2.0) in my
>> application, but when i try to set the Baud rate like:
>> MyPort.BaudRate = 115200;
>>
>> I get this exception:
>> {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()
>> ...}
>>
>> But I know for sure that my device support a baud rate of 115200 (have
>> used
>> it several times in other applications)
>>
>> Any idea what could be wrong??
>> Your help is highly appreciated!
>>
>> Thanks,
>> Ole

>
>



  Reply With Quote
Old 09-03-2007, 07:26 PM   #4
Dick Grier
Guest
 
Posts: n/a
Default Re: Baudrate error?

Hi,

I do not see this error (though I am using WM5). Can you double-check to
make sure that there isn't a typo?

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.


  Reply With Quote
Old 09-03-2007, 08:27 PM   #5
Ole
Guest
 
Posts: n/a
Default Re: Baudrate error?

Hi,

I discovered that the port must be a Bluetooth port to show the error.

Thanks
Ole


"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:OCWR1CoYHHA.3268@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> I do not see this error (though I am using WM5). Can you double-check to
> make sure that there isn't a typo?
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
>



  Reply With Quote
Old 10-03-2007, 05:39 PM   #6
Dick Grier
Guest
 
Posts: n/a
Default Re: Baudrate error?

Hi,

BT speed is not material. I suppose there is some sort of driver error.

Can you trap the error and try another speed? Since BT virtual ports don't
rely on the bitrate, this may work for you.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.


  Reply With Quote
Old 10-03-2007, 06:50 PM   #7
Ole
Guest
 
Posts: n/a
Default Re: Baudrate error?

Hi,

I wrote a message yesterday (called 'Bug report') regarding this issue - the
bug seems to be located in the CF layer as there is no problem when using
the API.

Thanks
Ole


"Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
news:Oavm$rzYHHA.4872@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> BT speed is not material. I suppose there is some sort of driver error.
>
> Can you trap the error and try another speed? Since BT virtual ports
> don't rely on the bitrate, this may work for you.
>
> Dick
>
> --
> Richard Grier, MVP
> Hard & Software
> Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
> Edition,
> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
> 2006.
> See www.hardandsoftware.net for details and contact information.
>



  Reply With Quote
Old 10-03-2007, 07:18 PM   #8
Dick Grier
Guest
 
Posts: n/a
Default Re: Baudrate error?

Hi,

I'm surprised that your API call works and the SerialPort call doesn't. The
underlying API should be the same.

Have you tried other classes, such as CFSerial from my homepage, and
OpenNETCF.org?

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.


  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off