write Long Characteristic
Writes a large value to a characteristic using sequential chunked writes.
This is a suspend function that automatically splits the data into chunks that fit within the current MTU size and writes them sequentially. If the value is small enough to fit in a single write (within MTU - 3 bytes for ATT header), it delegates to the regular writeCharacteristic method.
This is useful for writing values larger than the negotiated MTU, such as firmware updates, large configuration blobs, or any data that exceeds the maximum single-write payload size.
Chunk Size Calculation
Default MTU: 23 bytes (if no MTU negotiation has occurred)
Chunk size: MTU - 3 bytes (ATT protocol header)
Example: With MTU of 247, chunk size is 244 bytes
Note: This implementation writes chunks sequentially using standard write operations. It does NOT use BLE Reliable Write (prepared writes with execute), which would provide atomicity but requires different device-side handling.
Return
true if all chunks were written successfully, false if any chunk failed.
Parameters
The UUID of the GATT service containing the characteristic.
The UUID of the characteristic to write to.
The ByteArray value to write. Can be larger than MTU.