Zoltan Hudak / Mbed OS WebSwitch_mbed-os

Fork of WebSwitch_mbed-os by Zoltan Hudak

Files at this revision

API Documentation at this revision

Comitter:
hudakz
Date:
Tue Oct 27 16:43:25 2020 +0000
Parent:
11:101be77aa5db
Commit message:
Tiny HTTP server switching LED1 (or other DigitalOut) on/off.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Oct 27 16:39:39 2020 +0000
+++ b/main.cpp	Tue Oct 27 16:43:25 2020 +0000
@@ -264,12 +264,12 @@
     /* Listen for clients */
     server.listen();
 
-    //listening for http GET request
+    printf("=========================================\r\n");
+    printf("Ready to serve clients.\r\n");
+    net->get_ip_address(&addr);
+    printf("Usage: Type http:\/\/%s\/%s\/  into your web browser and hit ENTER\r\n", addr.get_ip_address(), PASSWORD);
     while (true) {
-        printf("=========================================\r\n");
-        printf("Ready to serve clients.\r\n");
-        net->get_ip_address(&addr);
-        printf("Usage: Type http:\/\/%s\/%s\/  into your web browser and hit ENTER\r\n", addr.get_ip_address(), PASSWORD);
+        //listening for http GET request
         client = server.accept();
         if (client) {
             client->getpeername(&addr);