Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4266268
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:44:14+00:00 2026-05-21T06:44:14+00:00

Hi I have a problem with a modem and win32 api. When I open

  • 0

Hi
I have a problem with a modem and win32 api.

When I open the comm port from my source code the port is ready to receive commands but the modem does not write output. All at commands I write are processed by the modem but I don´t receive the output from the modem.

If I connect the modem using hyperterminal, disconect and then use my software, then the modem works succesfully.

My code is as follows:

bool open() {
    unsigned long confSize = sizeof(COMMCONFIG);
    winCommConfig.dwSize = confSize;
    DWORD dwFlagsAndAttributes = 0;

    if (!isOpen()) {
        winHandle = CreateFileA(port.toAscii(), GENERIC_READ | GENERIC_WRITE,
                FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
                dwFlagsAndAttributes, NULL);
        if (winHandle != INVALID_HANDLE_VALUE) {
            /*
             * Configure the port settings.
             */
            GetCommConfig(winHandle, &winCommConfig, &confSize);
            GetCommState(winHandle, &(winCommConfig.dcb));

            /*
             * Configure port parameters.
             */
            winCommConfig.dcb.fBinary = TRUE;
            winCommConfig.dcb.fInX = FALSE;
            winCommConfig.dcb.fOutX = FALSE;
            winCommConfig.dcb.fAbortOnError = FALSE;
            winCommConfig.dcb.fNull = FALSE;

            setBaudRate(settings.BaudRate);
            setDataBits(settings.DataBits);
            setStopBits(settings.StopBits);
            setParity(settings.Parity);
            setFlowControl(settings.FlowControl);
            setTimeout(settings.TimeoutMillisec);

            /*
             * Set the final parameters.
             */
            SetCommConfig(winHandle, &winCommConfig, sizeof(COMMCONFIG));
            SetCommState(winHandle, &(winCommConfig.dcb));
        }
    }
    return isOpen();
}

Where:
port represents the comm port
baudrate: 115200
databits: 8
stopbits: 1
parity: none
flowcontrol: off

What am I doing wrong?

This happens if I use jablocom gdp-04. When I use other modems (huawei, novatel, …) it works perfectly.

Thanks in advance.
Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:44:15+00:00Added an answer on May 21, 2026 at 6:44 am

    flowcontrol: off

    The device won’t send anything until it sees the RTS and DTR signals active, indicating that you are “online” and ready to receive. You will need to set fRtsControl = RTS_CONTROL_ENABLE and fDtrEnable = DTR_CONTROL_ENABLE. Enabling hardware handshaking never hurts btw, assuming the device implements it properly, especially handy while debugging. Also do a basic check with HyperTerminal or Putty to ensure that the wiring is okay.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I have a GSM modem connected through a COM port. I open the
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have the following code in a script. The problem is That I want
I have, essentially, the same problem as this poster, but in C#: Waiting until
I have problem with update listbox from view model class. I use Caliburn Micro
I have a problem. Imagine this data model: [Person] table has: PersonId, Name1 [Tag]
i have very simple problem. I need to create model, that represent element of
I have a very interesting problem on my LinqToSql model. On some of my
I have got the following problem since the server has safe mode turned on,
I have problem in some JavaScript that I am writing where the Switch statement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.