aboutsummaryrefslogtreecommitdiff
path: root/libraries/GSM/examples/Tools/TestWebServer
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2013-08-08 16:43:19 +0200
committerCristian Maglie <c.maglie@bug.st>2013-08-08 16:43:19 +0200
commita8193ed933d9c9954cefbfb541cde56770ab5b74 (patch)
tree80796833fecca5d7426f1d09f7ac9870bab5f062 /libraries/GSM/examples/Tools/TestWebServer
parenta4c9fee673342304a5b12f7f2f7f9ecb9cb26d30 (diff)
parent5527c44aa443b20d63cf7a276180a36695233924 (diff)
Merge branch 'ide-1.5.x-library-to-new-format' into ide-1.5.x
Diffstat (limited to 'libraries/GSM/examples/Tools/TestWebServer')
-rw-r--r--libraries/GSM/examples/Tools/TestWebServer/TestWebServer.ino85
1 files changed, 0 insertions, 85 deletions
diff --git a/libraries/GSM/examples/Tools/TestWebServer/TestWebServer.ino b/libraries/GSM/examples/Tools/TestWebServer/TestWebServer.ino
deleted file mode 100644
index 5cc3f8a..0000000
--- a/libraries/GSM/examples/Tools/TestWebServer/TestWebServer.ino
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Basic Web Server
-
- A simple web server that replies with nothing, but prints the client's request
- and the server IP address.
-
- Circuit:
- * GSM shield attached
-
- created
- by David Cuartielles
- modified 21 Nov 2012
- by Tom Igoe
-
- http://arduino.cc/en/Tutorial/GSMToolsTestWebServer
-
- This example code is part of the public domain
- */
- #include <GSM.h>
-
-// PIN Number
-#define PINNUMBER ""
-
-// APN data
-#define GPRS_APN "GPRS_APN" // replace your GPRS APN
-#define GPRS_LOGIN "login" // replace with your GPRS login
-#define GPRS_PASSWORD "password" // replace with your GPRS password
-
-
-// initialize the library instance
-GPRS gprs;
-GSM gsmAccess; // include a 'true' parameter for debug enabled
-GSMServer server(80); // port 80 (http default)
-
-// timeout
-const unsigned long __TIMEOUT__ = 10*1000;
-
-void setup()
-{
- // initialize serial communications and wait for port to open:
- Serial.begin(9600);
- while (!Serial) {
- ; // wait for serial port to connect. Needed for Leonardo only
- }
-
- Serial.println("starting,..");
- // connection state
- boolean connected = true;
-
- // Start GSM shield
- // If your SIM has PIN, pass it as a parameter of begin() in quotes
- while(!connected)
- {
- if((gsmAccess.begin(PINNUMBER)==GSM_READY) &
- (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD)==GPRS_READY))
- connected = true;
- else
- {
- Serial.println("Not connected");
- delay(1000);
- }
- }
-
- Serial.println("Connected to GPRS network");
-
- // start server
- server.begin();
-
- //Get IP.
- IPAddress LocalIP = gprs.getIPAddress();
- Serial.println("Server IP address=");
- Serial.println(LocalIP);
-}
-
-void loop(){
- GSMClient client = server.available();
-
- if (client) {
- if (client.available()) {
- Serial.write(client.read());
- }
-}
-
-}
-