Instead of writing (and logging errors for) every parameter, one at a time, send all fixed size data in a single struct, followed by all the variable length data.