@@ -1432,6 +1432,62 @@ extern const char CHIP_NON_PRODUCTION_MARKER[];
1432
1432
#define CHIP_CONFIG_SCENES_MAX_EXTENSION_FIELDSET_SIZE_PER_CLUSTER 128
1433
1433
#endif
1434
1434
1435
+ /**
1436
+ * @brief The maximum number bytes taken by a scene. This needs to be increased if the number of clusters per scene is increased.
1437
+ * @note The default number (256) is based on the assumption that the maximum number of clusters per scene is 3 and that those
1438
+ * clusers are onOff, level control and color control cluster.
1439
+ * @warning Changing this value will not only affect the RAM usage of a scene but also the size of the scene table in the flash.
1440
+ * A scene's size can be calculated based on the following structure:
1441
+ * Scene TLV (struct)
1442
+ * {
1443
+ * 2 bytes GroupID,
1444
+ * 1 byte SceneID,
1445
+ * 0 - 16 bytes SceneName,
1446
+ * 4 bytes Transition time in miliseconds,
1447
+ *
1448
+ * Extension field sets TLV (array)
1449
+ * [
1450
+ * EFS TLV (struct)
1451
+ * {
1452
+ * 4 bytes for the cluster ID,
1453
+ * Attribute Value List TLV (array)
1454
+ * [
1455
+ * AttributeValue Pair TLV (struct)
1456
+ * {
1457
+ * Attribute ID
1458
+ * 4 bytes attributeID,
1459
+ * AttributeValue
1460
+ * 1 - 8 bytes AttributeValue,
1461
+ * },
1462
+ * .
1463
+ * .
1464
+ * .
1465
+ *
1466
+ * ],
1467
+ *
1468
+ * },
1469
+ * .
1470
+ * .
1471
+ * .
1472
+ * ],
1473
+ * }
1474
+ *
1475
+ * Including all the TLV fields, the following values can help estimate the needed size for a scenes given a number of clusters:
1476
+ * Empty EFS Scene Max name size: 33bytes
1477
+ * Scene Max name size + OnOff : 51 bytes
1478
+ * Scene Max name size + LevelControl : 60 bytes
1479
+ * Scene Max name size + ColorControl : 126 bytes
1480
+ * Scene Max name size + OnOff + LevelControl + ColoControl : 171 bytes
1481
+ *
1482
+ * Cluster Sizes:
1483
+ * OnOff Cluster Max Size: 18 bytes
1484
+ * LevelControl Cluster Max Size: 27 bytes
1485
+ * Color Control Cluster Max Size: 93 bytes
1486
+ * */
1487
+ #ifndef CHIP_CONFIG_SCENES_MAX_SERIALIZED_SCENE_SIZE_BYTES
1488
+ #define CHIP_CONFIG_SCENES_MAX_SERIALIZED_SCENE_SIZE_BYTES 256
1489
+ #endif
1490
+
1435
1491
/**
1436
1492
* @def CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS
1437
1493
*
0 commit comments