Define your byte message array outside the loop function to make it global.
Then use a for loop inside the loop and use the loop index to define what byte you want to send.
so you want to send 7 data elements’ some being 1 byte and some being multi-bytes and corresponding to {0x5A, 0xA5, 0x07, 0x82, 0x0084, 0x5A01, 0x0001}
You need to worry about the endianness of the 2 bytes’ or 4 bytes’ ones, is it MSB first or LSB first?
The code to send the full payload in MSB first mode would be
Another option if you can describe the payload in a struct with the 1 byte and multibyte fields is to fill in that struct (declared using the packed attribute) and send the struct. In that case you’ll get little endian alignment for the multi byte attributes