这段时间在看ZCL,然后搞到scene时就头大了,网上找不到任何详细说明,而且协议栈的例程代码也没用到scene的地方,所以就各种看文档,看代码...总结如下,如果有问题,还望大家不吝指出
// The format of a Scene Table Entry
typedef struct
{
uint16 groupID; // The group ID for which this scene applies
uint8 ID; // Scene ID
uint16 transTime; // Time to take to transition to this scene
uint8 name[ZCL_GEN_SCENE_NAME_LEN]; // Scene name
uint8 extLen; // Length of extension fields
uint8 extField[ZCL_GEN_SCENE_EXT_LEN]; // Extension fields
} zclGeneral_Scene_t;
1.Overview
The scenes cluster provides attributes and commands for settin g up and recalling scenes. Each scene corresponds to a set of stored values of specified attributes for
one or more clusters on the same end point as the scenes cluster.
In most cases scenes are associated with a particular group ID. Scenes may also exist without a group, in which case the value 0x0000 replaces the group ID. Note that extra care is required in these cases to avoid a scene ID collision, and that commands related to scenes without a group may only be unicast, i.e.: they may not be multicast or broadcast.
大概意思就是,端口可以在场景中可以存储对应簇的属性值(具体方法在下面会进行说明);在绝大多数情况下,情景和一个特定的GroupID关联在一起,情景也可能没有组而存在,在这种情况下,用GroupID为0x0000来代替。值得特别注意的是:要避免情景ID冲突,并且没与组关联的情景相关的命令只支持单播,也就是说:它们不支持多播或组播。
Commands Received
Command ID Description
0x00 Add scene 0x01 View scene 0x02 Remove scene 0x03 Remove all scenes 0x04 Store scene 0x05 Recall scene 0x06 Get scene mem
Add scene command,向设备的端口添加scene
参数说明: