| 222 | } |
| 223 | |
| 224 | size_t WebSerialClass::_write_row(uint8_t *data, size_t len) { |
| 225 | // Split the logData into multiple packets |
| 226 | size_t remaining_size = len; |
| 227 | uint8_t* current_ptr = data; |
| 228 | |
| 229 | while (remaining_size > 0) { |
| 230 | size_t packet_size = (remaining_size > WSL_MAX_ROW_PACKET_PAYLOAD_SIZE) ? WSL_MAX_ROW_PACKET_PAYLOAD_SIZE : remaining_size; |
| 231 | |
| 232 | // Clear if buffer is full |
| 233 | if (!_has_enough_space(packet_size)) { |
| 234 | _flush_global_buffer(); |
| 235 | } |
| 236 | |
| 237 | // Write Packet to Buffer |
| 238 | _buffer_offset += _write_row_packet(_buffer, current_ptr, packet_size); |
| 239 | |
| 240 | // Set remaining size |
| 241 | remaining_size -= packet_size; |
| 242 | current_ptr += packet_size; |
| 243 | } |
| 244 | |
| 245 | return len; |
| 246 | } |
| 247 | |
| 248 | void WebSerialClass::_flush_print_buffer() { |
| 249 | if (_print_buffer_offset > 0) { |
nothing calls this directly
no outgoing calls
no test coverage detected