|
Welcome to the GSM-Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Only registered members may post questions, contact other members or search our database of over 8 million posts. Registration is fast, simple and absolutely free so please - Click to REGISTER! If you have any problems with the registration process or your account login, please contact contact us . |
|
Register | FAQ | Donate | Forum Rules | Root any Device | ★iPhone Unlock★ | ★ Direct Codes ★ | Direct Unlock Source |
GSM Programming & Reverse Engineering Here you can post all Kind of GSM Programming and Reverse Engineering tools and Secrets. |
| LinkBack | Thread Tools | Display Modes |
11-04-2011, 08:16 | #1 (permalink) |
Junior Member Join Date: Nov 2011 Location: On Earth
Posts: 1
Member: 1683250 Status: Offline Thanks Meter: 0 | GPRS connection I want to establish a simple HTTP connection from my PC to a remote server via GPRS, using the C code shown below. This libcurl code from libcurl - simple.c works fine when using ethernet connection, but when using GPRS it fails. NOTE: -ttyS1 is the GSM modem attached to the PC -the header file which define ttyS1 and write function is not shown Code: #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; int i=0; while(i<2) { write(ttyS1,"ATE0\r\n",strlen("ATE0\r\n"));//no echoeing sleep(1); write(ttyS1,"AT+CGATT?\r\n",strlen("AT+CGATT?\r\n")); sleep(1); write(ttyS1,"AT+CIFSR\r\n",strlen("AT+CIFSR\r\n")); sleep(1); write(ttyS1,"AT+CIPMODE=0\r\n",strlen("AT+CIPMODE=0\r\n")); sleep(1); write(ttyS1,"AT+CIPCSGP=1,\"MyISP\"\r\n",strlen("AT+CIPCSGP=1,\"ETL\"\r\n")); sleep(1); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com"); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); } i++; } write(ttyS1,"AT+CIPCLOSE\r\n",strlen("AT+CIPCLOSE\r\n")); sleep(1); return 0; } cheers |
Bookmarks |
| |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Connecting Dejan Flasher to Nokia 61xx | gsmxc | Nokia Legacy Phones ( DCT-1 ,2 ,3 ,L ) | 2 | 01-07-2001 22:09 |
Connecting To Phone | jscoulter | Nokia Legacy Phones ( DCT-1 ,2 ,3 ,L ) | 0 | 12-20-2000 11:03 |
How to use Nokia tool - with connection 6-7 pin or not?.. | 2M | Nokia Legacy Phones ( DCT-1 ,2 ,3 ,L ) | 0 | 07-20-2000 19:53 |
WE OFFER cables for connection cellular-phones to the computers | GLEBUS | Main Sales Section | 0 | 06-04-2000 19:05 |
Nokia Datasuite Connection Failure | Judesp | Nokia Legacy Phones ( DCT-1 ,2 ,3 ,L ) | 0 | 12-27-1999 09:36 |
|