diff options
Diffstat (limited to 'minion/src/gymnasiearbete.cpp')
-rw-r--r-- | minion/src/gymnasiearbete.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/minion/src/gymnasiearbete.cpp b/minion/src/gymnasiearbete.cpp index 0e1adb5..b3c543a 100644 --- a/minion/src/gymnasiearbete.cpp +++ b/minion/src/gymnasiearbete.cpp @@ -64,6 +64,32 @@ void setup() Serial.print("IP address: "); Serial.println(wifi_module.get_local_ip(local_ip)); + + wifi_module.set_multiple_connections_enabled(true); + + delay(1000); + + wifi_module.create_tcp_server(80U); } -void loop() {} +void loop() +{ + if (wifi_module.has_incoming_request()) + { + char raw_request[200] = ""; + + const auto connection_id = wifi_module.read_incoming_request(raw_request); + + Serial.print("Connection ID: "); + Serial.println(connection_id); + + Serial.print("\nRaw request: "); + Serial.println(raw_request); + + wifi_module.send(connection_id, "lmao!"); + + wifi_module.close_connection(connection_id); + + delay(1000); + } +} |