|
2 | 2 | // Copyright 2025 Hristo Gochkov, Mathieu Carbou, Emil Muratov, Jorge Novo |
3 | 3 |
|
4 | 4 | /* |
5 | | - This example demonstrates how to cretate a TCP Chargen server with the |
| 5 | + This example demonstrates how to create a TCP Chargen server with the |
6 | 6 | AsyncTCP library. Run on the remote computer: |
7 | 7 | |
8 | 8 | $ nc <IPAddressforESP32> 19 |
@@ -36,14 +36,14 @@ const size_t LINE_LENGTH = 72; |
36 | 36 | const char CHARGEN_PATTERN_FULL[] = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; |
37 | 37 | const size_t PATTERN_LENGTH_FULL = 95; |
38 | 38 |
|
39 | | -#define WIFI_SSID "WiFi_Pelicano" |
40 | | -#define WIFI_PASSWORD "AcDhDdg7smBLgnUtfcV5t" |
| 39 | +#define WIFI_SSID "YourSSID" |
| 40 | +#define WIFI_PASSWORD "YourPassword" |
41 | 41 |
|
42 | 42 | // This is the main asynchronous server object |
43 | 43 | AsyncServer* AsyncServerChargen = nullptr; |
44 | 44 | // This is the pointer to the single connected client |
45 | | -AsyncClient* AsyncClientChargen= nullptr; |
46 | | -// This is the pointer to the stream of data. |
| 45 | +AsyncClient* AsyncClientChargen = nullptr; |
| 46 | +// Tracks the current position in the pattern rotation for the Chargen protocol. |
47 | 47 | size_t startIndex = 0; |
48 | 48 |
|
49 | 49 | void makeAndSendLine(); // Forward declaration |
@@ -75,8 +75,8 @@ void handleClientError(void* arg, AsyncClient* client, int error) { |
75 | 75 | Serial.println("Cleaning up global client pointer due to error."); |
76 | 76 | AsyncClientChargen = nullptr; |
77 | 77 | } |
78 | | - // We do not need to call "delete client" here because onDisconnect will do it |
79 | | - // If the error is critical we will do it. |
| 78 | + // We do not need to call "delete client" here because onDisconnect will do it. |
| 79 | + // If the error is critical, we will do it. |
80 | 80 | if (client->connected()) { |
81 | 81 | client->close(); |
82 | 82 | } |
|
0 commit comments