Change tcp server.

Dependencies:   ublox-at-cellular-interface ublox-cellular-base ublox-cellular-base-n2xx ublox-at-cellular-interface-n2xx

Files at this revision

API Documentation at this revision

Comitter:
qasimublox
Date:
Fri Nov 08 12:09:13 2019 +0000
Parent:
41:b41f25e66336
Commit message:
TCP server changed.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
ublox-cellular-base.lib Show annotated file Show diff for this revision Revisions of this file
diff -r b41f25e66336 -r b267103abca1 main.cpp
--- a/main.cpp	Tue Aug 27 19:11:55 2019 +0500
+++ b/main.cpp	Fri Nov 08 12:09:13 2019 +0000
@@ -50,7 +50,7 @@
 #define APN         NULL
 #define USERNAME    NULL
 #define PASSWORD    NULL
-#define TCP_SERVER "os.mbed.com"
+#define TCP_SERVER "httpbin.org"
 
 // LEDs
 DigitalOut ledRed(LED1, 1);
@@ -168,7 +168,7 @@
     }
     pulseEvent();
     
-    printf("Getting the IP address of \"developer.mbed.org\" and \"2.pool.ntp.org\"...\n");
+    printf("Getting the IP address of \"" TCP_SERVER "\" and \"2.pool.ntp.org\"...\n");
     if ((interface->gethostbyname("2.pool.ntp.org", &udpServer) == 0) &&
         (interface->gethostbyname(TCP_SERVER, &tcpServer) == 0)) {
         pulseEvent();
@@ -176,7 +176,7 @@
         udpServer.set_port(123);
         tcpServer.set_port(80);
         printf("\"2.pool.ntp.org\" address: %s on port %d.\n", udpServer.get_ip_address(), udpServer.get_port());
-        printf("\"os.mbed.com\" address: %s on port %d.\n", tcpServer.get_ip_address(), tcpServer.get_port());
+        printf("\"" TCP_SERVER "\" address: %s on port %d.\n", tcpServer.get_ip_address(), tcpServer.get_port());
 
         printf("Performing socket operations in a loop (until the user button is pressed on C030 or forever on C027)...\n");
         while (!buttonPressed) {
@@ -221,7 +221,7 @@
                 if (sockTcp.connect(tcpServer) == 0) {
                     pulseEvent();
                     printf("Connected, sending HTTP GET request to %s over socket...\n", TCP_SERVER);
-                    strcpy (buf, "GET /media/uploads/mbed_official/hello.txt HTTP/1.0\r\n\r\n");
+                    strcpy (buf, "GET /json HTTP/1.0\r\n\r\n");
                     // Note: since this is a short string we can send it in one go as it will
                     // fit within the default buffer sizes.  Normally you should call sock.send()
                     // in a loop until your entire buffer has been sent.
@@ -257,7 +257,7 @@
         printf("Stopped.\n");
     } else {
         bad();
-        printf("Unable to get IP address of \"developer.mbed.org\" or \"2.pool.ntp.org\".\n");
+        printf("Unable to get IP address of \"" TCP_SERVER "\" or \"2.pool.ntp.org\".\n");
     }
 }
 // End Of File
diff -r b41f25e66336 -r b267103abca1 ublox-cellular-base.lib
--- a/ublox-cellular-base.lib	Tue Aug 27 19:11:55 2019 +0500
+++ b/ublox-cellular-base.lib	Fri Nov 08 12:09:13 2019 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#38230504a646
+https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#38230504a646