Skip to content

Commit f83b339

Browse files
AdamZelikNSrlubos
authored andcommitted
zigbee: subsys: Fix compilation when FACTORY_RESET is disabled
Without this change building the application with CONFIG_ZIGBEE_FACTORY_RESET=n results in a compilation error. Signed-off-by: Adam Zelik <[email protected]>
1 parent d464236 commit f83b339

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Thread
158158
Zigbee
159159
------
160160

161-
|no_changes_yet_note|
161+
* Fixed compilation errors that previously occurred when the :kconfig:option:`CONFIG_ZIGBEE_FACTORY_RESET` Kconfig option was disabled.
162162

163163
Wi-Fi
164164
-----

include/zigbee/zigbee_app_utils.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,23 @@ void check_factory_reset_button(uint32_t button_state, uint32_t has_changed);
263263
*/
264264
bool was_factory_reset_done(void);
265265

266+
#else /* CONFIG_ZIGBEE_FACTORY_RESET */
267+
268+
static inline void register_factory_reset_button(uint32_t)
269+
{
270+
/* No action. Functionality is disabled. */
271+
}
272+
273+
static inline void check_factory_reset_button(uint32_t, uint32_t)
274+
{
275+
/* No action. Functionality is disabled. */
276+
}
277+
278+
static inline bool was_factory_reset_done(void)
279+
{
280+
return false; /* Functionality is disabled. */
281+
}
282+
266283
#endif /* CONFIG_ZIGBEE_FACTORY_RESET */
267284

268285
#ifdef __cplusplus

subsys/zigbee/lib/zigbee_app_utils/zigbee_app_utils.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,12 @@ zb_ret_t zigbee_default_signal_handler(zb_bufid_t bufid)
448448

449449
if (zb_get_network_role() ==
450450
ZB_NWK_DEVICE_TYPE_COORDINATOR) {
451+
#if defined CONFIG_ZIGBEE_FACTORY_RESET
451452
if (factory_reset_context.pibcache_pan_id_needs_reset) {
452453
zigbee_pibcache_pan_id_clear();
453454
factory_reset_context.pibcache_pan_id_needs_reset = false;
454455
}
456+
#endif
455457
/* For coordinator node,
456458
* start network formation.
457459
*/

0 commit comments

Comments
 (0)