problems with siemens m20 gsm modem & c++

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

Example:
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.

Advertisements

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

Example:
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.

Advertisements

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

Example:
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.

Click to expand...

Generally you should ask this the guys who designed the m20.
But I would try \n

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

Example:
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.

Click to expand...

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>

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Ask a Question