Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the generated files for example lighting and lock apps to include server init callbacks. #3180

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions examples/lighting-app/lighting-common/gen/callback-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
//#include "hal/hal.h"
//#include EMBER_AF_API_NETWORK_STEERING

/** @brief On/off Cluster Server Post Init
*
* Following resolution of the On/Off state at startup for this endpoint,
* perform any additional initialization needed; e.g., synchronize hardware
* state.
*
* @param endpoint Endpoint that is being initialized Ver.: always
*/
void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint) {}

/** @brief Add To Current App Tasks
*
* This function is only useful to sleepy end devices. This function will note
Expand Down Expand Up @@ -2478,8 +2488,6 @@ void halSleepCallback(bool enter, SleepModes sleepMode) {}

// These functions / constants are added to avoid ld failure when building with GN
// They should be removed if we have zcl updates and nolonger need this or causing other errors
void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint) {}

bool emberAfIsCurrentSecurityProfileSmartEnergy(void)
{
return false;
Expand Down
7 changes: 5 additions & 2 deletions examples/lighting-app/lighting-common/gen/endpoint_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@
}

// Cluster function static arrays
#define GENERATED_FUNCTION_ARRAYS
#define GENERATED_FUNCTION_ARRAYS \
const EmberAfGenericClusterFunction emberAfFuncArrayOnOffClusterServer[] = { ( \
EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback };

// Clusters definitions
#define GENERATED_CLUSTERS \
{ \
{ \
0x0006, (EmberAfAttributeMetadata *) &(generatedAttributes[0]), 2, 3, (CLUSTER_MASK_SERVER), NULL, \
0x0006, (EmberAfAttributeMetadata *) &(generatedAttributes[0]), 2, \
3, (CLUSTER_MASK_SERVER | CLUSTER_MASK_INIT_FUNCTION), emberAfFuncArrayOnOffClusterServer, \
}, \
}

Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/lighting-common/gen/gen_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#define EMBER_CALLBACK_ON_OFF_CLUSTER_OFF
#define EMBER_CALLBACK_ON_OFF_CLUSTER_ON
#define EMBER_CALLBACK_ON_OFF_CLUSTER_TOGGLE
#define EMBER_CALLBACK_ON_OFF_CLUSTER_ON_OFF_CLUSTER_SERVER_INIT
#define EMBER_CALLBACK_ENERGY_SCAN_RESULT
#define EMBER_CALLBACK_SCAN_COMPLETE
#define EMBER_CALLBACK_NETWORK_FOUND
Expand Down
11 changes: 11 additions & 0 deletions examples/lock-app/lock-common/gen/callback-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,20 @@
// of the callbacks have not been provided.
#include "af.h"
#include <assert.h>

//#include "hal/hal.h"
//#include EMBER_AF_API_NETWORK_STEERING

/** @brief On/off Cluster Server Post Init
*
* Following resolution of the On/Off state at startup for this endpoint,
* perform any additional initialization needed; e.g., synchronize hardware
* state.
*
* @param endpoint Endpoint that is being initialized Ver.: always
*/
void emberAfPluginOnOffClusterServerPostInitCallback(uint8_t endpoint) {}

/** @brief Add To Current App Tasks
*
* This function is only useful to sleepy end devices. This function will note
Expand Down
7 changes: 5 additions & 2 deletions examples/lock-app/lock-common/gen/endpoint_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@
}

// Cluster function static arrays
#define GENERATED_FUNCTION_ARRAYS
#define GENERATED_FUNCTION_ARRAYS \
const EmberAfGenericClusterFunction emberAfFuncArrayOnOffClusterServer[] = { ( \
EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback };

// Clusters definitions
#define GENERATED_CLUSTERS \
{ \
{ \
0x0006, (EmberAfAttributeMetadata *) &(generatedAttributes[0]), 2, 3, (CLUSTER_MASK_SERVER), NULL, \
0x0006, (EmberAfAttributeMetadata *) &(generatedAttributes[0]), 2, \
3, (CLUSTER_MASK_SERVER | CLUSTER_MASK_INIT_FUNCTION), emberAfFuncArrayOnOffClusterServer, \
}, \
}

Expand Down
1 change: 1 addition & 0 deletions examples/lock-app/lock-common/gen/gen_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#define EMBER_CALLBACK_ON_OFF_CLUSTER_OFF
#define EMBER_CALLBACK_ON_OFF_CLUSTER_ON
#define EMBER_CALLBACK_ON_OFF_CLUSTER_TOGGLE
#define EMBER_CALLBACK_ON_OFF_CLUSTER_ON_OFF_CLUSTER_SERVER_INIT
#define EMBER_CALLBACK_ENERGY_SCAN_RESULT
#define EMBER_CALLBACK_SCAN_COMPLETE
#define EMBER_CALLBACK_NETWORK_FOUND
Expand Down