CC2652P: same callback functions for different endpoints

Part Number: CC2652P
Other Parts Discussed in Thread: CC1354P10,

Tool/software:

My device has several endpoints which all have the same on/off function. Starting from the zed_lights example, I have done:

zclGeneral_RegisterCmdCallbacks( HYDRONIC_VALVULES_ENDPOINT1, &zclHydronicController_CmdCallbacks );
zclGeneral_RegisterCmdCallbacks( HYDRONIC_VALVULES_ENDPOINT2, &zclHydronicController_CmdCallbacks2 );
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static zclGeneral_AppCallbacks_t zclHydronicController_CmdCallbacks =
{
zclHydronicController_BasicResetCB, // Basic Cluster Reset command
NULL, // Identfiy cmd
NULL, // Identify Query command
zclHydronicController_IdentifyQueryRspCB, // Identify Query Response command
NULL, // Identify Trigger Effect command
#ifdef ZCL_ON_OFF
zclHydronicValvules1_OnOffCB, // On/Off cluster commands
NULL, // On/Off cluster enhanced command Off with Effect
NULL, // On/Off cluster enhanced command On with Recall Global Scene
NULL, // On/Off cluster enhanced command On with Timed Off
#endif
#ifdef ZCL_LEVEL_CTRL
zclHydronicController_LevelControlMoveToLevelCB, // Level Control Move to Level command
zclHydronicController_LevelControlMoveCB, // Level Control Move command
zclHydronicController_LevelControlStepCB, // Level Control Step command
zclHydronicController_LevelControlStopCB, // Level Control Stop command
zclHydronicController_LevelControlMoveToClosestFrequencyCB, // Level Control Stop command
#endif
#ifdef ZCL_GROUPS
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
However, even if endpoint 2 is called, always the function registered for the first endpoint will be called.
Any idea why this could happen? Even if this would work correctly, is there a more elegant way by passing the endpoint as parameter of the callback functions so that I do not need to duplicate functions?
Thank you and regards
Peter
PS: the module is actually CC1354P10 and not CC2652P but when selecting the right module, I cannot post into the ZigBee forum...
  • Hi,

    What does zclHydronicController_CmdCallbacks2  look like?

    Are you using different function names within zclHydronicController_CmdCallbacks2 ? (e.g. zclHydronicController_BasicResetCB_2)

    Thanks,
    Toby