This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ZCL multicast as blow, is right?or need any define?

void zclOnOffLight_Init( byte task_id )
{
zclOnOffLight_TaskID = task_id;
zclDevice_JoinNetworkOk = 6;
zclDevice_NwkState = DEV_INIT;
zclDevice_InitDone = 0;
zclDevice_RejoinCounter = 0;
// Set destination address to indirect
//zclOnOffLight_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
//zclOnOffLight_DstAddr.endPoint = 0;
//zclOnOffLight_DstAddr.addr.shortAddr = 0;

DeviceApp_epDesc.endPoint = 0xF0;
DeviceApp_epDesc.task_id = &zclOnOffLight_TaskID;
DeviceApp_epDesc.simpleDesc
= (SimpleDescriptionFormat_t *)&zclOnOffLight0_SimpleDesc;
DeviceApp_epDesc.latencyReq = noLatencyReqs;

// Setup for the flash command's destination address - Group 1
SampleApp_Flash_DstAddr.addrMode = (afAddrMode_t)afAddrGroup;
SampleApp_Flash_DstAddr.endPoint = 0xF0;
//SampleApp_Flash_DstAddr.addr.shortAddr = 0x0001; //组号1
SampleApp_Flash_DstAddr.addr.shortAddr = 0x0002; //组号2

// Register the endpoint description with the AF
afRegister( &DeviceApp_epDesc );

// This app is part of the Home Automation Profile
zclHA_Init( &zclOnOffLight0_SimpleDesc );
zclHA_Init( &zclOnOffLight1_SimpleDesc );
zclHA_Init( &zclOnOffLight2_SimpleDesc );
zclHA_Init( &zclOnOffLight3_SimpleDesc );

// Register the ZCL General Cluster Library callback functions
zclGeneral_RegisterCmdCallbacks( ONOFFLIGHT0_ENDPOINT, &zclOnOffLight0_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( ONOFFLIGHT1_ENDPOINT, &zclOnOffLight1_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( ONOFFLIGHT2_ENDPOINT, &zclOnOffLight2_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( ONOFFLIGHT3_ENDPOINT, &zclOnOffLight3_CmdCallbacks );

// Register the application's attribute list
zcl_registerAttrList( ONOFFLIGHT0_ENDPOINT, ONOFFLIGHT_MAX_ATTRIBUTES, zclOnOffLight0_Attrs );
zcl_registerAttrList( ONOFFLIGHT1_ENDPOINT, ONOFFLIGHT_MAX_ATTRIBUTES, zclOnOffLight1_Attrs );
zcl_registerAttrList( ONOFFLIGHT2_ENDPOINT, ONOFFLIGHT_MAX_ATTRIBUTES, zclOnOffLight2_Attrs );
zcl_registerAttrList( ONOFFLIGHT3_ENDPOINT, ONOFFLIGHT_MAX_ATTRIBUTES, zclOnOffLight3_Attrs );

// Register the Application to receive the unprocessed Foundation command/response messages
zcl_registerForMsg( zclOnOffLight_TaskID );

// Register for all key events - This app will handle all key events
RegisterForKeys( zclOnOffLight_TaskID );

// By default, all devices start out in Group 1
//SmartSwitch_Group.ID = 0x0001;
SmartSwitch_Group.ID = 0x0002;
osal_memcpy( SmartSwitch_Group.name, "Group 2", 7 );
aps_AddGroup( ONOFFLIGHT0_ENDPOINT, &SmartSwitch_Group );
//aps_AddGroup( ONOFFLIGHT1_ENDPOINT, &SmartSwitch_Group );
//aps_AddGroup( ONOFFLIGHT2_ENDPOINT, &SmartSwitch_Group );
//aps_AddGroup( ONOFFLIGHT3_ENDPOINT, &SmartSwitch_Group );

zclDeviceInfoInit();
zclLightControlInit();
}