problems with siemens m20 gsm modem & c++

Discussion in 'C++' started by Janne, Jan 9, 2004.

  1. Janne

    Janne Guest


    I have one problem with siemens m20 gsm modem. It returns error when i
    try to send at-command and use "\r" <return> character.

    at = "ATI"+"\r";
    WriteFile(hCom,at.c_str(),at.length()+1, &NumBytesWritten, NULL);
    After this modem says ERROR on terminal. What return-key is supported
    by m20 because "\r" return key does not work.
    Janne, Jan 9, 2004
    1. Advertisements

  2. How is this a C++ problem? Talk to a Siemens tech-support group.

    Jacques Labuschagne, Jan 9, 2004
    1. Advertisements

  3. Generally you should ask this the guys who designed the m20.
    But I would try \n
    Karl Heinz Buchegger, Jan 9, 2004
  4. Maybe you can check the specs of the modem? You'll not get many answers in
    this group, this group deals with the C++ language, not with modems.

    That said, you do realize that '\r' is a seldomly used code by itself? EOL
    conventions differ, but the most common are "\n" and "\n\r". '\r' may be
    the code generated by the return key on some terminals, but that is about
    as far as it goes, that has /nothing/ to do with how you should end you
    lines, both in C++ and with modems.

    <OT> IIRC hayes compatible modems (almost all of them are) use "\r\n" to
    end lines. </OT>

    Martijn Lievaart, Jan 9, 2004
  5. Janne

    David Harmon Guest

    Is this supposed to mean that you are adding two (char *) pointers?
    David Harmon, Jan 9, 2004
  6. Janne

    Jack Klein Guest

    Why are you writing one more character than the length of the C
    string? Do you think the modem really wants the '\0'? Probably not.
    Jack Klein, Jan 10, 2004
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.