| 189 | |
| 190 | #ifdef WSL_HIGH_PERF |
| 191 | void WebSerialClass::_send(const uint8_t* buffer, size_t size) { |
| 192 | if (_ws && size > 0) { |
| 193 | _ws->cleanupClients(WSL_MAX_WS_CLIENTS); |
| 194 | if (_ws->count()) { |
| 195 | if (size > UINT16_MAX) |
| 196 | size = UINT16_MAX; |
| 197 | AsyncWebSocketMessageBuffer* wsbuffer = _ws->makeBuffer(WSL_HEAD_LEN + WSL_MSG_SIZE_LEN + size); |
| 198 | _write_row_packet(wsbuffer->get(), buffer, size); |
| 199 | _ws->binaryAll(wsbuffer); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | // if buffer grew too much, free it, otherwise clear it |
| 204 | if (_initialBufferCapacity) { |
| 205 | if (_buffer.length() > _initialBufferCapacity) { |
| 206 | setBuffer(_initialBufferCapacity); |
| 207 | } else { |
| 208 | #if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) |
| 209 | _buffer = ""; |
| 210 | #else |
| 211 | _buffer.clear(); |
| 212 | #endif |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | #else // WSL_HIGH_PERF |
| 218 |
nothing calls this directly
no test coverage detected