ZCL Sequences and Collections

Hi,

I’m reading the ZCL spec and trying to figure out how arrays, structures, sets, and bags work - specifically, how do I know how long they are.

Array: 2 + sum of the lengths of contents. The 0th element contains the number of elements in the array. Questions:
[ul]
[li]Does every element have a type field in front of it?
[/li][/ul]

Structure: 2 + sum of lengths of contents. Questions:
[ul]
[li]Does every element have a type field in front of it?
[/li][/ul]

Bag and Set: sum of lengths of contents. Questions:
[ul]
[li]How are you supposed to know how long the set is?
[/li][li]How do you specify the data type of the elements?
[/li][/ul]