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.

CCS/CC2652R: 8 endpoint in zr_light z-stack simplelink_cc13x2_26x2_sdk_3_20_00_68

Part Number: CC2652R
Other Parts Discussed in Thread: Z-STACK

Tool/software: Code Composer Studio

hi,

I have successfully added 5 endpoints in zr_light example of z-stack simplelink_cc13x2_26x2_sdk_3_20_00_68 for cc2652r.

I have change example project to 7 endpoints, But discovers only 5 endpoints in Zigbee_3_0_Linux_Gateway_1_0_0. 

Also i have added ZCL_PORT_MAX_ENDPOINTS=8 in predefined symbols of project properties.

Please guide us to add more than 5 endpoints.

see below function zclSampleLight_Init -

static void zclSampleLight_Init( void )
{
#ifdef BDB_REPORTING
zstack_bdbRepAddAttrCfgRecordDefaultToListReq_t Req = {0};
#endif

// Set destination address to indirect
zclSampleLight_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
zclSampleLight_DstAddr.endPoint = 0;
zclSampleLight_DstAddr.addr.shortAddr = 0;

//Register Endpoint
zclSampleLightEpDesc.endPoint = SAMPLELIGHT_ENDPOINT;
zclSampleLightEpDesc.simpleDesc = &zclSampleLight_SimpleDesc;
zclport_registerEndpoint(appServiceTaskId, &zclSampleLightEpDesc);

//Register Endpoint2
zclSampleLight2EpDesc.endPoint = SAMPLELIGHT_ENDPOINT+1;
zclSampleLight2EpDesc.simpleDesc = &zclSampleLight2_SimpleDesc;
zclport_registerEndpoint(appServiceTaskId, &zclSampleLight2EpDesc);

//Register Endpoint3
zclSampleLight3EpDesc.endPoint = SAMPLELIGHT_ENDPOINT+2;
zclSampleLight3EpDesc.simpleDesc = &zclSampleLight3_SimpleDesc;
zclport_registerEndpoint(appServiceTaskId, &zclSampleLight3EpDesc);

//Register Endpoint4
zclSampleLight4EpDesc.endPoint = SAMPLELIGHT_ENDPOINT+3;
zclSampleLight4EpDesc.simpleDesc = &zclSampleLight4_SimpleDesc;
zclport_registerEndpoint(appServiceTaskId, &zclSampleLight4EpDesc);

//Register Endpoint5
zclSampleLight5EpDesc.endPoint = SAMPLELIGHT_ENDPOINT+4;
zclSampleLight5EpDesc.simpleDesc = &zclSampleLight5_SimpleDesc;
zclport_registerEndpoint(appServiceTaskId, &zclSampleLight5EpDesc);

//Register Endpoint6
zclSampleLight6EpDesc.endPoint = SAMPLELIGHT_ENDPOINT+5;
zclSampleLight6EpDesc.simpleDesc = &zclSampleLight6_SimpleDesc;
zclport_registerEndpoint(appServiceTaskId, &zclSampleLight6EpDesc);

//Register Endpoint7
zclSampleLight7EpDesc.endPoint = SAMPLELIGHT_ENDPOINT+6;
zclSampleLight7EpDesc.simpleDesc = &zclSampleLight7_SimpleDesc;
zclport_registerEndpoint(appServiceTaskId, &zclSampleLight7EpDesc);

#if defined (ENABLE_GREENPOWER_COMBO_BASIC)
zclGp_RegisterCBForGPDCommand(&zclSampleLight_GpSink_AppCallbacks);
#endif


// Register the ZCL General Cluster Library callback functions
zclGeneral_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT, &zclSampleLight_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT+1, &zclSampleLight2_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT+2, &zclSampleLight3_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT+3, &zclSampleLight4_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT+4, &zclSampleLight5_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT+5, &zclSampleLight6_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT+6, &zclSampleLight7_CmdCallbacks );

// Register the application's attribute list and reset to default values
zclSampleLight_ResetAttributesToDefaultValues();
zclSampleLight2_ResetAttributesToDefaultValues();
zclSampleLight3_ResetAttributesToDefaultValues();
zclSampleLight4_ResetAttributesToDefaultValues();
zclSampleLight5_ResetAttributesToDefaultValues();
zclSampleLight6_ResetAttributesToDefaultValues();
zclSampleLight7_ResetAttributesToDefaultValues();

zcl_registerAttrList( SAMPLELIGHT_ENDPOINT, zclSampleLight_NumAttributes, zclSampleLight_Attrs );
zcl_registerAttrList( SAMPLELIGHT_ENDPOINT+1, zclSampleLight2_NumAttributes, zclSampleLight2_Attrs );
zcl_registerAttrList( SAMPLELIGHT_ENDPOINT+2, zclSampleLight3_NumAttributes, zclSampleLight3_Attrs );
zcl_registerAttrList( SAMPLELIGHT_ENDPOINT+3, zclSampleLight4_NumAttributes, zclSampleLight4_Attrs );
zcl_registerAttrList( SAMPLELIGHT_ENDPOINT+4, zclSampleLight5_NumAttributes, zclSampleLight5_Attrs );
zcl_registerAttrList( SAMPLELIGHT_ENDPOINT+5, zclSampleLight6_NumAttributes, zclSampleLight6_Attrs );
zcl_registerAttrList( SAMPLELIGHT_ENDPOINT+6, zclSampleLight7_NumAttributes, zclSampleLight7_Attrs );

// Register the Application to receive the unprocessed Foundation command/response messages
zclport_registerZclHandleExternal(zclSampleLight_ProcessIncomingMsg);

#if !defined (DISABLE_GREENPOWER_BASIC_PROXY) && (ZG_BUILD_RTR_TYPE)
gp_endpointInit(appServiceTaskId);
#endif

//Write the bdb initialization parameters
zclSampleLight_initParameters();

//Setup ZDO callbacks
SetupZStackCallbacks();

// set up default application BDB commissioning modes based on build type
if(ZG_BUILD_COORDINATOR_TYPE && ZG_DEVICE_COORDINATOR_TYPE)
{
zclSampleLight_BdbCommissioningModes = BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
}
else if (ZG_BUILD_JOINING_TYPE && ZG_DEVICE_JOINING_TYPE)
{
zclSampleLight_BdbCommissioningModes = BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
}

#if defined ( BDB_TL_INITIATOR )
zclSampleLight_BdbCommissioningModes |= BDB_COMMISSIONING_MODE_INITIATOR_TL;
#endif

#ifdef ZCL_LEVEL_CTRL
zclSampleLight_LevelLastLevel = zclSampleLight_getCurrentLevelAttribute();
#endif
#ifdef ZCL_LEVEL_CTRL2
zclSampleLight2_LevelLastLevel = zclSampleLight2_getCurrentLevelAttribute();
#endif
#ifdef ZCL_LEVEL_CTRL3
zclSampleLight3_LevelLastLevel = zclSampleLight3_getCurrentLevelAttribute();
#endif

#ifdef BDB_REPORTING
//Adds the default configuration values for the temperature attribute of the ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT cluster, for endpoint SAMPLETEMPERATURESENSOR_ENDPOINT
//Default maxReportingInterval value is 10 seconds
//Default minReportingInterval value is 3 seconds
//Default reportChange value is 300 (3 degrees)
Req.attrID = ATTRID_ON_OFF;
Req.cluster = ZCL_CLUSTER_ID_GEN_ON_OFF;
Req.endpoint = SAMPLELIGHT_ENDPOINT;
Req.maxReportInt = 10;
Req.minReportInt = 0;
OsalPort_memcpy(Req.reportableChange,reportableChange,BDBREPORTING_MAX_ANALOG_ATTR_SIZE);

Zstackapi_bdbRepAddAttrCfgRecordDefaultToListReq(appServiceTaskId,&Req);

#ifdef ZCL_LEVEL_CTRL
Req.attrID = ATTRID_LEVEL_CURRENT_LEVEL;
Req.cluster = ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL;
Req.endpoint = SAMPLELIGHT_ENDPOINT;
Req.maxReportInt = 10;
Req.minReportInt = 0;
OsalPort_memcpy(Req.reportableChange,reportableChange,BDBREPORTING_MAX_ANALOG_ATTR_SIZE);

Zstackapi_bdbRepAddAttrCfgRecordDefaultToListReq(appServiceTaskId,&Req);
#endif

#endif

#ifdef ZCL_DISCOVER
// Register the application's command list
zcl_registerCmdList( SAMPLELIGHT_ENDPOINT, zclCmdsArraySize, zclSampleLight_Cmds );
zcl_registerCmdList( SAMPLELIGHT_ENDPOINT+1, zclCmdsArraySize2, zclSampleLight2_Cmds );
zcl_registerCmdList( SAMPLELIGHT_ENDPOINT+2, zclCmdsArraySize3, zclSampleLight3_Cmds );
zcl_registerCmdList( SAMPLELIGHT_ENDPOINT+3, zclCmdsArraySize4, zclSampleLight4_Cmds );
zcl_registerCmdList( SAMPLELIGHT_ENDPOINT+4, zclCmdsArraySize5, zclSampleLight5_Cmds );
zcl_registerCmdList( SAMPLELIGHT_ENDPOINT+5, zclCmdsArraySize6, zclSampleLight6_Cmds );
zcl_registerCmdList( SAMPLELIGHT_ENDPOINT+6, zclCmdsArraySize7, zclSampleLight7_Cmds );
#endif

zcl_registerReadWriteCB(SAMPLELIGHT_ENDPOINT,zclSampleLight_ReadWriteAttrCB,NULL);
zcl_registerReadWriteCB(SAMPLELIGHT_ENDPOINT+1,zclSampleLight_ReadWriteAttrCB,NULL);
zcl_registerReadWriteCB(SAMPLELIGHT_ENDPOINT+2,zclSampleLight_ReadWriteAttrCB,NULL);
zcl_registerReadWriteCB(SAMPLELIGHT_ENDPOINT+3,zclSampleLight_ReadWriteAttrCB,NULL);
zcl_registerReadWriteCB(SAMPLELIGHT_ENDPOINT+4,zclSampleLight_ReadWriteAttrCB,NULL);
zcl_registerReadWriteCB(SAMPLELIGHT_ENDPOINT+5,zclSampleLight_ReadWriteAttrCB,NULL);
zcl_registerReadWriteCB(SAMPLELIGHT_ENDPOINT+6,zclSampleLight_ReadWriteAttrCB,NULL);

#ifdef USE_DMM
RemoteDisplay_registerClientProvCbs(zclSwitch_ProvissioningCbs);
RemoteDisplay_registerLightCbs(zclSwitch_LightCbs);
#endif

UI_Init( appServiceTaskId, // Application Task ID
&appServiceTaskEvents, // The events processed by the sample application
appSemHandle, // Semaphore to post the events in the application thread
SAMPLEAPP_UI_AUTO_REFRESH_EVT, // The event mask (single bit) for using as the ui-auto-update event.
SAMPLEAPP_UI_INPUT_EVT, // The event mask (single bit) for processing UART characters (only used if BOARD_DISPLAY_USE_UART is enabled)
&zclSampleLight_IdentifyTime, // A pointer to the identify attribute's value.
APP_TITLE, // A pointer to a string, holding the title of the sample app.
#ifdef PER_TEST
&PERTest_uiRefresh,
PERTest_UiStatesMain,
#else
&zclSampleLight_UiRefresh, // A pointer to a function to refresh the UI when displaying the application-specific screens.
zclSampleLight_UiAppStatesMain, // A pointer to the application-specific state-table.
#endif
zclSampleLight_RemoveAppNvmData, // A pointer to the app-specific NV Item reset function
&zclSampleLight_BdbCommissioningModes ); // A pointer to the current commissioning modes bitmask

#if !defined (DISABLE_GREENPOWER_BASIC_PROXY) && (ZG_BUILD_RTR_TYPE)
app_Green_Power_Init(appServiceTaskId, &appServiceTaskEvents, appSemHandle, SAMPLEAPP_PROCESS_GP_DATA_SEND_EVT,
SAMPLEAPP_PROCESS_GP_EXPIRE_DUPLICATE_EVT, SAMPLEAPP_PROCESS_GP_TEMP_MASTER_EVT);
#endif

#if defined ( BDB_TL_INITIATOR )
touchLinkInitiatorApp_Init(appServiceTaskId);
#elif defined ( BDB_TL_TARGET )
touchLinkTargetApp_Init(appServiceTaskId);
#endif

UI_Refresh();

#ifdef PER_TEST
PERTest_init(appSemHandle, appServiceTaskId, SAMPLELIGHT_ENDPOINT );
#endif
}