473,770 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with siemens m20 gsm modem & c++

Hi,

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.l ength()+1, &NumBytesWritte n, NULL);
After this modem says ERROR on terminal. What return-key is supported
by m20 because "\r" return key does not work.
Jul 22 '05 #1
5 2927
Janne wrote:
Hi,

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.l ength()+1, &NumBytesWritte n, NULL);
After this modem says ERROR on terminal. What return-key is supported
by m20 because "\r" return key does not work.


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

Jacques.

Jul 22 '05 #2
Janne wrote:

Hi,

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.l ength()+1, &NumBytesWritte n, NULL);
After this modem says ERROR on terminal. What return-key is supported
by m20 because "\r" return key does not work.


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

--
Karl Heinz Buchegger
kb******@gascad .at
Jul 22 '05 #3
On Fri, 09 Jan 2004 02:50:53 -0800, Janne wrote:
Hi,

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.l ength()+1, &NumBytesWritte n, NULL);
After this modem says ERROR on terminal. What return-key is supported
by m20 because "\r" return key does not work.


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>

HTH,
M4

Jul 22 '05 #4
On 9 Jan 2004 02:50:53 -0800 in comp.lang.c++, ja*****@jippii. fi (Janne)
was alleged to have written:
at = "ATI"+"\r";


Is this supposed to mean that you are adding two (char *) pointers?

Jul 22 '05 #5
On 9 Jan 2004 02:50:53 -0800, ja*****@jippii. fi (Janne) wrote in
comp.lang.c++:
Hi,

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.l ength()+1, &NumBytesWritte n, NULL); ^^^^^^^^^^^^^
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.
After this modem says ERROR on terminal. What return-key is supported
by m20 because "\r" return key does not work.


--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3511
by: Michael Fork | last post by:
Note: I pasted the code the attachments as plain text after the message (I wasn't able to post it with an attachment...) Attached are the XSL and XML files that I am having problems with. I am trying to extract the stock information after having downloaded the HTML and converted to XML (well-formed HTML) using XSL and XPATH and am unable. I am basing what I have done so far off of...
17
3370
by: Franc Zabkar | last post by:
My D-Link DSL-302G modem/router has a real-time clock whose settings are volatile. To avoid hand keying the date/time via the modem's JS interface, I wonder if there is a way to copy the JS code to the hard drive and modify it to automatically retrieve the PC's date/time. I could then add the hacked JS page to my browser's bookmarks. I've already successfully modified and adapted other modem menus, but I don't know how to go about this...
3
1355
by: Mr. Murad Jamal | last post by:
Hi guys, I'd appreciate it if you link me to an article that describes how to access the modem and making/receiving voice calls over it, using vb.net or C# (windows forms or so ) !!! thanx a million in advance !!
0
967
by: Mr. Murad Jamal | last post by:
Hi guys, I'd appreciate it if you link me to an article that describes how to access the modem and making/receiving voice calls over it, using vb.net or C# (windows forms or so ) !!! thanx a million in advance !!
2
1260
by: kw1997 | last post by:
Guys I have just setup a home network ( 2 machines) , one withj XP and the other with Vista. The XP machine is connected to DSL thru a cable modem/hub. I get internet connectivity on the XP machine , no problem. Vista machine can see the connection but can not connect to internet. It keeps telling (when I diagnose/repair , me to switch off the modem and restart. I have disabled the modem , still no luck. Thanks Help will be...
0
929
by: Nimbus2000 | last post by:
Hello Everyone and thanks for your help in advance. I am writing an application in Vb.Net that would dial a phone number through a modem (phone line through PBX) and connect to a remote host and transfer a file from the remote host to the local host I haven't got a clue as to how to do this or where to start. Could someone shed some light on this or point me to a tutorial? Any help would be greatly appreciated. Thanks.
0
3879
by: harikumar001 | last post by:
Hi all, I was working with VB 2005 to create an application that will send and receive SMS using a GSM Modem(Siemens MC35i). I am not pretty sure about the AT+CNMI parameters I am supposed to use so that I get indication about the newly received SMS in the form "+CMTI: "SM",3" where SM is the memory storage and 3 refers to the location where the new SMS is stored. The problem is that the GSM modem is responding with the +CMTI indication when a...
0
2297
by: tomrobinson | last post by:
I am trying to configure a Siemens MC35i GSM Modem plugged into an SLC500 PLC for remote programming. I cannot get it to answer. I have set modem handshaking on in the SLC, and set "AT S0=2" to enable auto answering in the modem. It still doesn't answer. Can anybody please help? Thanks, Tom.
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.