Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Configure Serial Port Using DOS commands

Reply
Thread Tools Display Modes

Configure Serial Port Using DOS commands

 
 
Sushma
Guest
Posts: n/a

 
      02-06-2009
Hi All,

I had developed a USB-Serial driver with WDF architecture. I have a
query regarding congiguring of Serial port using DOS commands. I used
the command "mode COM3:19200,n,8,1" to set baud rate to 19200 from
command prompt. The output is:

Status for device COM3:
-----------------------
Baud: 1200
Parity: None
Data Bits: 7
Stop Bits: 1
Timeout: OFF
XON/XOFF: OFF
CTS handshaking: OFF
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit: ON
RTS circuit: ON

The baud rate is always set to 1200 even though i use any other baud
rate to set. I had debugged the driver and could see that 19200 is
being received and able to properly handle it. With the native COM
port i could see the configuration was done properly with all baud
rates.

With all other terminal applications like hyperterminal or any other
application i was able to configure properly in my driver.

Is there anything additional parameters i need to set in driver when
using DOS commands.

Any help is much appreciated.

Thanks You.

Regards,
Sushma.

 
Reply With Quote
 
 
 
 
Sushma
Guest
Posts: n/a

 
      02-06-2009
On Feb 6, 3:27*pm, Sushma <sushma.ye...@gmail.com> wrote:
> Hi All,
>
> I had developed a USB-Serial driver with WDF architecture. I have a
> query regarding congiguring of Serial port using DOS commands. I used
> the command "mode COM3:19200,n,8,1" to set baud rate to 19200 from
> command prompt. The output is:
>
> Status for device COM3:
> -----------------------
> * * Baud: * * * * * *1200
> * * Parity: * * * * *None
> * * Data Bits: * * * 7
> * * Stop Bits: * * * 1
> * * Timeout: * * * * OFF
> * * XON/XOFF: * * * *OFF
> * * CTS handshaking: OFF
> * * DSR handshaking: OFF
> * * DSR sensitivity: OFF
> * * DTR circuit: * * ON
> * * RTS circuit: * * ON
>
> The baud rate is always set to 1200 even though i use any other baud
> rate to set. I had debugged the driver and could see that 19200 is
> being received and able to properly handle it. With the native COM
> port i could see the configuration was done properly with all baud
> rates.
>
> With all other terminal applications like hyperterminal or any other
> application i was able to configure properly in my driver.
>
> Is there anything additional parameters i need to set in driver when
> using DOS commands.
>
> Any help is much appreciated.
>
> Thanks You.
>
> Regards,
> Sushma.


I did the following sequence of steps

1. Opened a terminal application like hyperterminal with baud rate say
19200,no parity,8,1.
2. Closed the hyperterminal.
3. I opened a Win32 application which opens COM port using CreatFile()
and then used GetCommState() to retrieve the DCB structure. I observed
that baud rate is set to 1200 in DCB. Default settings are displayed.

I performed same steps for native COM port (COM1). After step #3 the
baud rate was shown as 19200.

I think i'm missing some settings while closing the port. or flushing
out serial port settings when EvtFileClose() is called. or missing
something???
Can any one throw some light on this scenario.

Regards,
Sushma
 
Reply With Quote
 
 
 
 
chris.aseltine@gmail.com
Guest
Posts: n/a

 
      02-06-2009
On Feb 6, 7:49 am, Sushma <sushma.ye...@gmail.com> wrote:

> 3. I opened a Win32 application which opens COM port using CreatFile()
> and then used GetCommState() to retrieve the DCB structure. I observed
> that baud rate is set to 1200 in DCB. Default settings are displayed.
>
> I performed same steps for native COM port (COM1). After step #3 the
> baud rate was shown as 19200.


There's a serial IOCTL that's sent to your driver to retrieve baud
rate, parity, and other settings. Are you responding to it properly?
Are you setting the "Information" field of the IRP before you complete
it?
 
Reply With Quote
 
Sushma
Guest
Posts: n/a

 
      02-07-2009
On Feb 6, 8:21*pm, chris.aselt...@gmail.com wrote:
> On Feb 6, 7:49 am, Sushma <sushma.ye...@gmail.com> wrote:
>
> > 3. I opened a Win32 application which opens COM port using CreatFile()
> > and then used GetCommState() to retrieve the DCB structure. I observed
> > that baud rate is set to 1200 in DCB. Default settings are displayed.

>
> > I performed same steps for native COM port (COM1). After step #3 the
> > baud rate was shown as 19200.

>
> There's a serial IOCTL that's sent to your driver to retrieve baud
> rate, parity, and other settings. *Are you responding to it properly?
> Are you setting the "Information" field of the IRP before you complete
> it?


The IOCTL related to baud rate, parity are correctly being handled. Im
able to do data transfer by changing the baud rates. Its only after
closing the terminal application i'm not able to retrieve the last set
baud rate and other parameters.

Looks like i need to care of some parameters before/after closing the
port.

Regards,
Sushma

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
Adaption of serial.sys for sub-millisecond timing resolution on serial port Luke \(may the source be with you\) Windows Vista Drivers 5 05-13-2012 07:06 PM
WinXP serial port driver - Serial to IP communication dominolog Windows Vista Drivers 9 07-30-2008 03:43 PM
Install custom serial port driver without removing serial.sys Luke \(may the source be with you\) Windows Vista Drivers 13 02-21-2006 09:00 PM
Re: USB COM port as Serial port Maxim S. Shatskih Windows Vista Drivers 0 05-25-2005 07:13 PM
I2C through PC parallel port, serial port and/or USB port - please help Adam Windows Vista Drivers 22 06-29-2004 04:48 PM