Extra dial string commands - not enough space

  • Thread starter Thread starter chora
  • Start date Start date
C

chora

Hi all,

I am trying to setup a GPRS connection, which needs several AT commands
GSM engine specific.

In Pocket PC connection settings ("Extra dial-string modem commands"
)there is not enough space to include all of them.

Is there a workaround?
 
chora said:
Hi all,

I am trying to setup a GPRS connection, which needs several AT commands
GSM engine specific.

In Pocket PC connection settings ("Extra dial-string modem commands"
)there is not enough space to include all of them.

Is there a workaround?

Chora,

Take a look at the registry under HKLM\ExtModems\YourModemDriver\Init.
Add a new entry with a custom dial command. Note you need to use literal
"<cr>" instead of "\r".

e.g.,
wsprintf(gprsInitString, _T("AT+CGDCONT=1,\"%s\",\"%s\"<cr>"),

gprsPdp, gprsApn);
 
Thanks,

I checked that already but no "init" section under any installed modem
(GSM and GPRS). Is it ok to just create one?

Now about the string. I am totally lost by your example. What is
wsprintf and several other cryptic characters?

Can't I just write comma separated commands? Like
AT+CGDCONT=1,"IP","MyAPN" , AT+CGATT=1 ... etc
 
chora said:
Thanks,

I checked that already but no "init" section under any installed modem
(GSM and GPRS). Is it ok to just create one?

Now about the string. I am totally lost by your example. What is
wsprintf and several other cryptic characters?

Can't I just write comma separated commands? Like
AT+CGDCONT=1,"IP","MyAPN" , AT+CGATT=1 ... etc

chora,

Sorry, I forgot I was pasting C code to a .NET newsgroup. I do not know
if it is OK to just create that key if it does not exist (that key already
existed on my device). The only way to know for sure is to try it out
yourself.

HKLM\ExtModems\YourModemDriver\Init
#0 Type REG_SZ
AT+CGDCONT=1,"IP","your.apn.here"<cr>
#1 Type REG_SZ
AT+CGATT=1<cr>
#2 Type REG_SZ
AT+CSQ?<cr>

etc...

Notice the literal string "<cr>" is at the end of each registry entry
instead of the CR (carriage return) character. This .NET code should do the
trick:

string initString = string.Format("AT+CGDCONT=1,"IP",\"{0}\"<cr>", apnName);

I think that will work, but I am not very experienced in .NET so you may
have to toy with it a little bit. The end result should match:

AT+CGDCONT=1,"IP","your.apn.here"<cr>
 
It worked fine. I just added a key "init" under the modem entry and then
added the commands as string values using PHM Regedit.

That was all. Many thanks Trevor!
 
Back
Top