Serial DAT write buffer size?

When calling serialDat.sendBytes(), hows does the operator handle buffering the data as it sends? For example, if I call sendBytes() with a buffer of 4480 bytes, does it try to send the full buffer at once? Does it internally write it in chunks, like 128, 128, 128, until finished? When I use an Info DAT, the bytes_queued param often flips between something like 0 and 4180, so it seems like Touch is waiting to continue sending, but the size of the queued bytes doesn’t seem to be related to some power-of-2 like 1024 or 2048 (meaning, if it was sending in 1024 byte chunks and my full buffer was 4480, I’d expect to see bytes_queued at 4480 - 1024 = 3456, or 2432, 1408, or 384 (subtracting 1024 each time).

I’m seeing some oddities around a device I’m sending serial data to (a custom LED controller) either reporting overruns, dropping frames, or having its receive light blink at odd intervals, so I’m trying to understand more about where the problem may lie. Thanks!

Bump. Would love to know more about how this is implemented :slight_smile: