buffer length: Serial.write()

Serial.write() writes binary data to the serial port. This data is sent as a byte or series of bytes for example:

Serial.write(buf, len)

where:
buf: an array to send as a series of bytes
len: the length of the buffer

The problem is, how do you calculate the length (len) of the buffer (buf)?

You don't calculate it - you already know it.

The problem is, how do you calculate the length (len) of the buffer (buf)?

Weren't you paying attention when you put stuff in buf? If you were, you'd know how much stuff is in buf. If not, then, don't worry about it. Just use 0 as the length.