Configure Serial Port Using DOS commands

Discussion in 'Windows Vista Drivers' started by Sushma, Feb 6, 2009.

  1. Sushma

    Sushma Guest

    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.
     
    Sushma, Feb 6, 2009
    #1
    1. Advertising

  2. Sushma

    Sushma Guest

    On Feb 6, 3:27 pm, Sushma <> 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
     
    Sushma, Feb 6, 2009
    #2
    1. Advertising

  3. Sushma

    Guest

    On Feb 6, 7:49 am, Sushma <> 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?
     
    , Feb 6, 2009
    #3
  4. Sushma

    Sushma Guest

    On Feb 6, 8:21 pm, wrote:
    > On Feb 6, 7:49 am, Sushma <> 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
     
    Sushma, Feb 7, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam
    Replies:
    22
    Views:
    1,479
  2. Maxim S. Shatskih

    Re: USB COM port as Serial port

    Maxim S. Shatskih, May 25, 2005, in forum: Windows Vista Drivers
    Replies:
    0
    Views:
    377
    Maxim S. Shatskih
    May 25, 2005
  3. Luke \(may the source be with you\)

    Adaption of serial.sys for sub-millisecond timing resolution on serial port

    Luke \(may the source be with you\), Feb 12, 2006, in forum: Windows Vista Drivers
    Replies:
    5
    Views:
    648
  4. Luke \(may the source be with you\)

    Install custom serial port driver without removing serial.sys

    Luke \(may the source be with you\), Feb 17, 2006, in forum: Windows Vista Drivers
    Replies:
    13
    Views:
    683
    Luke \(may the source be with you\)
    Feb 21, 2006
  5. dominolog

    WinXP serial port driver - Serial to IP communication

    dominolog, Jul 30, 2008, in forum: Windows Vista Drivers
    Replies:
    9
    Views:
    566
    Don Burn
    Jul 30, 2008
Loading...

Share This Page