forked from me-no-dev/ESPAsyncWebServer
Added printf_P method (#31)
* Prevent buffer overflow on received data * pass to 7 char to avoid save to flash by SDK * return _contentLength, avoid array reparse to know len * Added FlashStringHelper for text and binary * Added FlashStringHelper also to AsyncWebSocketClient * Added PROGMEM doc * Corrected binary was sending PSTR as text, addded len * Server calls client method and code as asked @me-no-dev * server calls client method and code as asked by @me-no-dev * Changed Code presentation * Added printf_P methods
This commit is contained in:
@@ -473,6 +473,10 @@ AsyncWebSocket ws("/ws");
|
||||
ws.printf([client id], [arguments...]);
|
||||
//printf to all clients
|
||||
ws.printfAll([arguments...]);
|
||||
//printf_P to a client
|
||||
ws.printf_P([client id], PSTR([format]), [arguments...]);
|
||||
//printfAll_P to all clients
|
||||
ws.printf_P(PSTR([format]), [arguments...]);
|
||||
//send text to a client
|
||||
ws.text([client id], [(char*)text]);
|
||||
ws.text([client id], [text], [len]);
|
||||
@@ -495,6 +499,8 @@ ws.binaryAll([binary], [len]);
|
||||
AsyncWebSocketClient * client;
|
||||
//printf to a client
|
||||
client->printf([arguments...]);
|
||||
//printf_P to a client
|
||||
client->printf_P( PSTR([format]), [arguments...]);
|
||||
//send text to a client
|
||||
client->text([(char*)text]);
|
||||
client->text([text], [len]);
|
||||
|
||||
Reference in New Issue
Block a user