Returns the largest ATT write value, at most maxWrite bytes, that exactly
fills whole link-layer packets (251k - 7 bytes: 244, 495, ...). A write
that overruns a packet boundary by a few bytes spends a whole extra packet
of airtime on them. Returns maxWrite when not even one packet fits.
Splits payload (the UTF-8 bytes of an escaped Lua string literal) into
chunks of at most maxChunkBytes bytes, without splitting a multi-byte
UTF-8 sequence or a Lua escape sequence across two chunks.
Whether notification (as received on the RX characteristic, including
its 0x01 data marker) is data.lua's per-packet ACK: 01 01 00 00, or
01 01 00 01 when the device failed to process the packet.