






Started logging.

<<<
Content-Length: 3246

{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":16512,"clientInfo":{"name":"vscode","version":"1.50.0"},"rootPath":"c:\\Users\\zhang'pei\\Desktop\\ESP32-2432S028例子\\arduino\\Source code\\4_4_wifi_STA_TCP_Server","rootUri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server","name":"4_4_wifi_STA_TCP_Server"}]}}
>>>
Content-Length: 598

{"id":0,"result":{"capabilities":{"textDocumentSync":2,"hoverProvider":true,"completionProvider":{"triggerCharacters":[".","\u003e",":"]},"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n"},"renameProvider":false,"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]}}},"jsonrpc":"2.0"}
<<<
Content-Length: 52

{"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 1991

{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server/4_4_wifi_STA_TCP_Server.ino","languageId":"cpp","version":1,"text":"#include <WiFi.h>\r\n\r\nconst char *ssid = \"iphone\";\r\nconst char *password = \"12345678\";\r\n\r\nWiFiServer server; //声明服务器对象\r\n\r\nvoid setup()\r\n{\r\n    Serial.begin(115200);\r\n    Serial.println();\r\n\r\n    WiFi.mode(WIFI_STA);\r\n    WiFi.setSleep(false); //关闭STA模式下wifi休眠，提高响应速度\r\n    WiFi.begin(ssid, password);\r\n    while (WiFi.status() != WL_CONNECTED)\r\n    {\r\n        delay(500);\r\n        Serial.print(\".\");\r\n    }\r\n    Serial.println(\"Connected\");\r\n    Serial.print(\"IP Address:\");\r\n    Serial.println(WiFi.localIP());\r\n\r\n    server.begin(10000); //服务器启动监听端口号22333\r\n}\r\n\r\nvoid loop()\r\n{\r\n    WiFiClient client = server.available(); //尝试建立客户对象\r\n    if (client) //如果当前客户可用\r\n    {\r\n        Serial.println(\"[Client connected]\");\r\n        String readBuff;\r\n        while (client.connected()) //如果客户端处于连接状态\r\n        {\r\n            if (client.available()) //如果有可读数据\r\n            {\r\n                char c = client.read(); //读取一个字节\r\n                                        //也可以用readLine()等其他方法\r\n                readBuff += c;\r\n               if(c == '\\r') //接收到回车符\r\n                {\r\n                    client.print(\"Received: \" + readBuff); //向客户端发送\r\n                    Serial.println(\"Received: \" + readBuff); //从串口打印\r\n                    readBuff = \"\";\r\n\r\n                }\r\n            }\r\n        }\r\n        client.stop(); //结束当前连接:\r\n        Serial.println(\"[Client disconnected]\");\r\n    }\r\n}\r\n"}}}






Started logging.

<<<
Content-Length: 3246

{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":17088,"clientInfo":{"name":"vscode","version":"1.50.0"},"rootPath":"c:\\Users\\zhang'pei\\Desktop\\ESP32-2432S028例子\\arduino\\Source code\\4_4_wifi_STA_TCP_Server","rootUri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server","name":"4_4_wifi_STA_TCP_Server"}]}}
>>>
Content-Length: 598

{"id":0,"result":{"capabilities":{"textDocumentSync":2,"hoverProvider":true,"completionProvider":{"triggerCharacters":[".","\u003e",":"]},"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n"},"renameProvider":false,"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]}}},"jsonrpc":"2.0"}
<<<
Content-Length: 52

{"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 1993

{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server/4_4_wifi_STA_TCP_Server.ino","languageId":"cpp","version":1,"text":"#include <WiFi.h>\r\n\r\nconst char *ssid = \"CMCC-404\";\r\nconst char *password = \"12345678\";\r\n\r\nWiFiServer server; //声明服务器对象\r\n\r\nvoid setup()\r\n{\r\n    Serial.begin(115200);\r\n    Serial.println();\r\n\r\n    WiFi.mode(WIFI_STA);\r\n    WiFi.setSleep(false); //关闭STA模式下wifi休眠，提高响应速度\r\n    WiFi.begin(ssid, password);\r\n    while (WiFi.status() != WL_CONNECTED)\r\n    {\r\n        delay(500);\r\n        Serial.print(\".\");\r\n    }\r\n    Serial.println(\"Connected\");\r\n    Serial.print(\"IP Address:\");\r\n    Serial.println(WiFi.localIP());\r\n\r\n    server.begin(10000); //服务器启动监听端口号22333\r\n}\r\n\r\nvoid loop()\r\n{\r\n    WiFiClient client = server.available(); //尝试建立客户对象\r\n    if (client) //如果当前客户可用\r\n    {\r\n        Serial.println(\"[Client connected]\");\r\n        String readBuff;\r\n        while (client.connected()) //如果客户端处于连接状态\r\n        {\r\n            if (client.available()) //如果有可读数据\r\n            {\r\n                char c = client.read(); //读取一个字节\r\n                                        //也可以用readLine()等其他方法\r\n                readBuff += c;\r\n               if(c == '\\r') //接收到回车符\r\n                {\r\n                    client.print(\"Received: \" + readBuff); //向客户端发送\r\n                    Serial.println(\"Received: \" + readBuff); //从串口打印\r\n                    readBuff = \"\";\r\n\r\n                }\r\n            }\r\n        }\r\n        client.stop(); //结束当前连接:\r\n        Serial.println(\"[Client disconnected]\");\r\n    }\r\n}\r\n"}}}






Started logging.

<<<
Content-Length: 3246

{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":16444,"clientInfo":{"name":"vscode","version":"1.50.0"},"rootPath":"c:\\Users\\zhang'pei\\Desktop\\ESP32-2432S028例子\\arduino\\Source code\\4_4_wifi_STA_TCP_Server","rootUri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server","name":"4_4_wifi_STA_TCP_Server"}]}}
>>>
Content-Length: 598

{"id":0,"result":{"capabilities":{"textDocumentSync":2,"hoverProvider":true,"completionProvider":{"triggerCharacters":[".","\u003e",":"]},"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n"},"renameProvider":false,"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]}}},"jsonrpc":"2.0"}
<<<
Content-Length: 52

{"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 1993

{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server/4_4_wifi_STA_TCP_Server.ino","languageId":"cpp","version":1,"text":"#include <WiFi.h>\r\n\r\nconst char *ssid = \"CMCC-404\";\r\nconst char *password = \"12345678\";\r\n\r\nWiFiServer server; //声明服务器对象\r\n\r\nvoid setup()\r\n{\r\n    Serial.begin(115200);\r\n    Serial.println();\r\n\r\n    WiFi.mode(WIFI_STA);\r\n    WiFi.setSleep(false); //关闭STA模式下wifi休眠，提高响应速度\r\n    WiFi.begin(ssid, password);\r\n    while (WiFi.status() != WL_CONNECTED)\r\n    {\r\n        delay(500);\r\n        Serial.print(\".\");\r\n    }\r\n    Serial.println(\"Connected\");\r\n    Serial.print(\"IP Address:\");\r\n    Serial.println(WiFi.localIP());\r\n\r\n    server.begin(10000); //服务器启动监听端口号22333\r\n}\r\n\r\nvoid loop()\r\n{\r\n    WiFiClient client = server.available(); //尝试建立客户对象\r\n    if (client) //如果当前客户可用\r\n    {\r\n        Serial.println(\"[Client connected]\");\r\n        String readBuff;\r\n        while (client.connected()) //如果客户端处于连接状态\r\n        {\r\n            if (client.available()) //如果有可读数据\r\n            {\r\n                char c = client.read(); //读取一个字节\r\n                                        //也可以用readLine()等其他方法\r\n                readBuff += c;\r\n               if(c == '\\r') //接收到回车符\r\n                {\r\n                    client.print(\"Received: \" + readBuff); //向客户端发送\r\n                    Serial.println(\"Received: \" + readBuff); //从串口打印\r\n                    readBuff = \"\";\r\n\r\n                }\r\n            }\r\n        }\r\n        client.stop(); //结束当前连接:\r\n        Serial.println(\"[Client disconnected]\");\r\n    }\r\n}\r\n"}}}






Started logging.

<<<
Content-Length: 3246

{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":20416,"clientInfo":{"name":"vscode","version":"1.50.0"},"rootPath":"c:\\Users\\zhang'pei\\Desktop\\ESP32-2432S028例子\\arduino\\Source code\\4_4_wifi_STA_TCP_Server","rootUri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"off","workspaceFolders":[{"uri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server","name":"4_4_wifi_STA_TCP_Server"}]}}
>>>
Content-Length: 598

{"id":0,"result":{"capabilities":{"textDocumentSync":2,"hoverProvider":true,"completionProvider":{"triggerCharacters":[".","\u003e",":"]},"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n"},"renameProvider":false,"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]}}},"jsonrpc":"2.0"}
<<<
Content-Length: 52

{"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 1993

{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///c%3A/Users/zhang%27pei/Desktop/ESP32-2432S028%E4%BE%8B%E5%AD%90/arduino/Source%20code/4_4_wifi_STA_TCP_Server/4_4_wifi_STA_TCP_Server.ino","languageId":"cpp","version":1,"text":"#include <WiFi.h>\r\n\r\nconst char *ssid = \"CMCC-404\";\r\nconst char *password = \"12345678\";\r\n\r\nWiFiServer server; //声明服务器对象\r\n\r\nvoid setup()\r\n{\r\n    Serial.begin(115200);\r\n    Serial.println();\r\n\r\n    WiFi.mode(WIFI_STA);\r\n    WiFi.setSleep(false); //关闭STA模式下wifi休眠，提高响应速度\r\n    WiFi.begin(ssid, password);\r\n    while (WiFi.status() != WL_CONNECTED)\r\n    {\r\n        delay(500);\r\n        Serial.print(\".\");\r\n    }\r\n    Serial.println(\"Connected\");\r\n    Serial.print(\"IP Address:\");\r\n    Serial.println(WiFi.localIP());\r\n\r\n    server.begin(10000); //服务器启动监听端口号22333\r\n}\r\n\r\nvoid loop()\r\n{\r\n    WiFiClient client = server.available(); //尝试建立客户对象\r\n    if (client) //如果当前客户可用\r\n    {\r\n        Serial.println(\"[Client connected]\");\r\n        String readBuff;\r\n        while (client.connected()) //如果客户端处于连接状态\r\n        {\r\n            if (client.available()) //如果有可读数据\r\n            {\r\n                char c = client.read(); //读取一个字节\r\n                                        //也可以用readLine()等其他方法\r\n                readBuff += c;\r\n               if(c == '\\r') //接收到回车符\r\n                {\r\n                    client.print(\"Received: \" + readBuff); //向客户端发送\r\n                    Serial.println(\"Received: \" + readBuff); //从串口打印\r\n                    readBuff = \"\";\r\n\r\n                }\r\n            }\r\n        }\r\n        client.stop(); //结束当前连接:\r\n        Serial.println(\"[Client disconnected]\");\r\n    }\r\n}\r\n"}}}