Skip to content

Commit d97b5af

Browse files
Document mask argument of DECLARE_DYNAMIC_ATTRIBUTE.
People keep forgetting ATTRIBUTE_MASK_WRITABLE here, then being confused why writes do not work.
1 parent 32c961f commit d97b5af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/app/util/attribute-storage.h

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ static constexpr uint16_t kEmberInvalidEndpointIndex = 0xFFFF;
6060
} /* cluster revision */ \
6161
}
6262

63+
// The attrMask must contain the relevant ATTRIBUTE_MASK_* bits from
64+
// attribute-metadata.h. Specifically:
65+
//
66+
// * Writable attributes must have ATTRIBUTE_MASK_WRITABLE
67+
// * Nullable attributes (have X in the quality column in the spec) must have ATTRIBUTE_MASK_NULLABLE
68+
// * Attributes that have T in the Access column in the spec must have ATTRIBUTE_MASK_MUST_USE_TIMED_WRITE
6369
#define DECLARE_DYNAMIC_ATTRIBUTE(attId, attType, attSizeBytes, attrMask) \
6470
{ \
6571
ZAP_EMPTY_DEFAULT(), attId, attSizeBytes, ZAP_TYPE(attType), attrMask | ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) \

0 commit comments

Comments
 (0)