Open j-nik opened 1 month ago
In AsyncFsWebServer.h you have the following to allow a websocket broadcast of a text message:
/* * Broadcast a websocket message to all clients connected */ void wsBroadcast(const char * buffer) { m_ws->textAll(buffer); }
I've added the following below this to allow broadcasts of an array of bytes, which I find quite useful:
/* * Broadcast a binary websocket message to all clients connected */ void wsBroadcastBinary(uint8_t * message, size_t len) { m_ws->binaryAll(message, len); }
If you do so augment your library, I've written an example you could consider adding.
https://forum.arduino.cc/t/binary-data-over-websockets-with-the-asyncespfswebserver-library/1258142/3
In AsyncFsWebServer.h you have the following to allow a websocket broadcast of a text message:
I've added the following below this to allow broadcasts of an array of bytes, which I find quite useful: