Reply
Posts: 2
Registered: ‎06-03-2015

Custom Cluster Attribute Types, Token Generation, Arrays

As per UG102 section 9.1.4 if attributes are marked persistent 'F' then app builder will generate necessary code into <appname>_tokens.h.

 

If you define tokens by hand using the DEFINE_INDEXED_TOKEN() macro you can store an array.  e.g. DEFINE_INDEXED_TOKEN(SOME_TOKEN, int8u, 32, {0})

 

How can you define a custom attribute which will generate the necessary code to store an array?

 

<attribute side="client" code="0x0001" define="SERIAL_NUMBER"
  type="INT8U" array="true" writable="true"
  optional="false">Serial Number</attribute>

I've tried xml attributes like array, length to try and have it generate code for an array etc.. but haven't had any success.

 

Is this appropriate use of attributes -> token generation or am I misusing something, or attributes not capable of storing an array of bytes.  I had also considered abusing CHAR_STRING but that seems a little wrong..

 

Advice appreciated.

Posts: 183
Registered: ‎03-31-2014

Re: Custom Cluster Attribute Types, Token Generation, Arrays

I believe your answer sits in this topic:

"Ember AppBuilder / ZNet5.4 create custom attribute"
http://community.silabs.com/t5/Wireless/Ember-AppBuilder-ZNet5-4-create-custom-attribute/m-p/141206

Also, here is some more information on creating tokens:

"How to setup Custom MFG Tokens"
http://community.silabs.com/t5/Wireless-Knowledge-Base/How-to-setup-Custom-MFG-Tokens/ta-p/129078

Cheers,
Konrad