COM and GPRS | Search |
NowSMS Support Forums ⬆ MMS & SMS Technical Discussions (unsupported) ⬆ Archive through March 23, 2004 ⬆ |
◄ ► |
Author | Message | |||
Anonymous |
Hi,everyone, I have a GPRS modem and PC, Connected by COM1. I want to establish a GPRS connection by Sending data to COM1. my thought is the following: 1. send AT command to select a APN. 2. send AT command to dial(ATDT*99#) for internet. 3. send data by SOCKET (TCP/IP). Am i right? | |||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 1486 Registered: 10-2002 |
Yes, but you need to negotiate a PPP connection before you can talk TCP/IP. Then there is the question of how you associate a socket with this connection .... | |||
Anonymous |
Hi,bryce, can you explain more? thanks a lot. is the following step not enough? How do i negotiate a PPP connection? HANDLE hCom = Createfile( com1,....); SetComMask(....) WriteCom("AT+CGCONT...."); WriteCom("ATDT*99#"); socket(af_inet,....) send/read(sd,....) closesocket(sd); | |||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 1516 Registered: 10-2002 |
No, it is not sufficient. Because there is no relationship between the socket and the dial-up connection. The system does not know that you are making a PPP connection. That connection is under your program's control, not the control of the operating system. You would have to use dial-up services of the OS to dial the connection, rather than direct COM port access from your application, so that the OS can negotiate a PPP connection and the OS would see it as a TCP/IP route. | |||
Anonymous |
Hi,bryce, I can use RasDialup("ATDT*99#")to dial the connection,but RasDialup implements a AT command by sending data to COM port. by the way, i can't select APN by RAS function. so i want send AT command to establish a GPRS connection. can you follow me? | |||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 1527 Registered: 10-2002 |
Yes, I follow you. You need to send commands before making the RAS call. | |||
Anonymous |
Hi,bryce, I use the SmartPhone2003 mobile, embeded in WinCE. I can establish gprs by the ConnMgr tools, but, when i set many options connection. it always select the first to connect. RAS function can't select APN. do you have a way or advise? thanks . | |||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 1540 Registered: 10-2002 |
The AT*99# dial string can include a CID number. Dial *99***x#, where "x" is the CID number established by the AT+CGDCONT command. Of course, if you're using SmartPhone2003 mobile, maybe you can't send a AT+CGDCONT command. In that case, you would need to check the phone UI to see what CID number is assigned to each connection profile. (Why they didn't design the API to just let you put the APN into the dial string, I'll never understand...) |