Hello,
You are right in your notions regarding opening a socket. Just a few points I would like to mention:
For TCP sockets, use ed_SendDataExt () API to send data.
You must be attached to the GPRS, if you are using GPRS as the physical layer for the TCP socket.
Here are the points that you need to follow:
Wait for +WIND: 4 indication to occur. You can do this by subscribing to +WIND: 4 unsolicited indication. THis is because, eDlib internally waits for ADL_SIM_EVENT_FULL_INIT (which is equivalent to +WIND: 4) and only after receiving this event, does it allows you to set the TCP parameters, and start the socket.
When the +WIND: 4 is received, attach to GPRS network. You can use AT+CGATT=1 command using adl_atCmdCreate () API.
When you are connected, (i.e. receive an OK for this command), call ed_DialupConnectionStart () API.
When you receive ED_OK_GPRS_SESSION_SET (if you are using GPRS), then set the TCP parameters using ed_TCPSetConfig.
Now start the socket using ed_SocketTCPStart () API.
For sending data use ed_SendDataExt () API.
For more information, you can refer to the user guide for TCP/IP library.
user guide for TCP/IP library where can we get this? I have all the openAT software since 2.0 to 4.0 but there is no ref. to user guide for TCP/IP library, please advise is it that it comes only with the TCP/IP stack version of the modem?
Hi Samuel,
When you install Open-AT, the TCP/IP library is present in C:\OpenAT\Otherlibs directory. In this directory, you can find a folder named “doc” where the TCP/IP user guide is present.
In Open-AT 3.10, you can find the user guide for TCP/IP under the folder “C:\OpenAT\V310\TgtGen\Add-ons\TCPIP\v3.00\doc”
This code give me error code -10 at the end (GPRS connect error) but it is false because it is a pin code error and i haven’t any pin on my SIM. I read the forum and it says use +CGATT=1 before edDialupConnectionStart and wait the OK. But I don’t know how can I do this. Somebody could give me a sample code?
[/code]