Skip to content

Commit 27c2d6f

Browse files
P-R-O-C-H-Yme-no-dev
authored andcommitted
fix(zigbee): Guard the Zigbee library
1 parent f87fa09 commit 27c2d6f

17 files changed

+41
-34
lines changed

libraries/Zigbee/src/ZigbeeCore.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Zigbee Core Functions */
22

33
#include "ZigbeeCore.h"
4-
#if SOC_IEEE802154_SUPPORTED
4+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
55

66
#include "ZigbeeHandlers.cpp"
77
#include "Arduino.h"
@@ -407,4 +407,4 @@ const char *ZigbeeCore::getDeviceTypeString(esp_zb_ha_standard_devices_t deviceI
407407

408408
ZigbeeCore Zigbee = ZigbeeCore();
409409

410-
#endif //SOC_IEEE802154_SUPPORTED
410+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ZigbeeCore.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#pragma once
44

55
#include "soc/soc_caps.h"
6-
#if SOC_IEEE802154_SUPPORTED
6+
#include "sdkconfig.h"
7+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
78

89
#include "esp_zigbee_core.h"
910
#include "zdo/esp_zigbee_zdo_common.h"
@@ -122,4 +123,4 @@ class ZigbeeCore {
122123

123124
extern ZigbeeCore Zigbee;
124125

125-
#endif //SOC_IEEE802154_SUPPORTED
126+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ZigbeeEP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "ZigbeeEP.h"
44

5-
#if SOC_IEEE802154_SUPPORTED
5+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
66

77
#include "esp_zigbee_cluster.h"
88
#include "zcl/esp_zigbee_zcl_power_config.h"
@@ -210,4 +210,4 @@ void ZigbeeEP::zbIdentify(const esp_zb_zcl_set_attr_value_message_t *message) {
210210
}
211211
}
212212

213-
#endif //SOC_IEEE802154_SUPPORTED
213+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ZigbeeEP.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#pragma once
44

55
#include "ZigbeeCore.h"
6-
#if SOC_IEEE802154_SUPPORTED
6+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
77

88
#include <Arduino.h>
99

@@ -126,4 +126,4 @@ class ZigbeeEP {
126126
friend class ZigbeeCore;
127127
};
128128

129-
#endif //SOC_IEEE802154_SUPPORTED
129+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ZigbeeHandlers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "ZigbeeCore.h"
33
#include "Arduino.h"
44

5-
#if SOC_IEEE802154_SUPPORTED
5+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
66

77
// forward declaration of all implemented handlers
88
static esp_err_t zb_attribute_set_handler(const esp_zb_zcl_set_attr_value_message_t *message);
@@ -138,4 +138,4 @@ static esp_err_t zb_cmd_default_resp_handler(const esp_zb_zcl_cmd_default_resp_m
138138
return ESP_OK;
139139
}
140140

141-
#endif //SOC_IEEE802154_SUPPORTED
141+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "ZigbeeColorDimmableLight.h"
2-
#if SOC_IEEE802154_SUPPORTED
2+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
33

44
ZigbeeColorDimmableLight::ZigbeeColorDimmableLight(uint8_t endpoint) : ZigbeeEP(endpoint) {
55
_device_id = ESP_ZB_HA_COLOR_DIMMABLE_LIGHT_DEVICE_ID;
@@ -109,4 +109,4 @@ void ZigbeeColorDimmableLight::lightChanged() {
109109
}
110110
}
111111

112-
#endif //SOC_IEEE802154_SUPPORTED
112+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#pragma once
44

55
#include "soc/soc_caps.h"
6-
#if SOC_IEEE802154_SUPPORTED
6+
#include "sdkconfig.h"
7+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
78

89
#include "ZigbeeEP.h"
910
#include "ha/esp_zigbee_ha_standard.h"
@@ -38,4 +39,4 @@ class ZigbeeColorDimmableLight : public ZigbeeEP {
3839
uint16_t _current_blue;
3940
};
4041

41-
#endif //SOC_IEEE802154_SUPPORTED
42+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "ZigbeeColorDimmerSwitch.h"
2-
#if SOC_IEEE802154_SUPPORTED
2+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
33

44
// Initialize the static instance pointer
55
ZigbeeColorDimmerSwitch *ZigbeeColorDimmerSwitch::_instance = nullptr;
@@ -400,4 +400,4 @@ void ZigbeeColorDimmerSwitch::setLightColor(uint8_t red, uint8_t green, uint8_t
400400
}
401401
}
402402

403-
#endif //SOC_IEEE802154_SUPPORTED
403+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#pragma once
44

55
#include "soc/soc_caps.h"
6-
#if SOC_IEEE802154_SUPPORTED
6+
#include "sdkconfig.h"
7+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
78

89
#include "ZigbeeEP.h"
910
#include "ha/esp_zigbee_ha_standard.h"
@@ -57,4 +58,4 @@ class ZigbeeColorDimmerSwitch : public ZigbeeEP {
5758
void calculateXY(uint8_t red, uint8_t green, uint8_t blue, uint16_t &x, uint16_t &y);
5859
};
5960

60-
#endif //SOC_IEEE802154_SUPPORTED
61+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

libraries/Zigbee/src/ep/ZigbeeLight.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "ZigbeeLight.h"
2-
#if SOC_IEEE802154_SUPPORTED
2+
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
33

44
ZigbeeLight::ZigbeeLight(uint8_t endpoint) : ZigbeeEP(endpoint) {
55
_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID;
@@ -33,4 +33,4 @@ void ZigbeeLight::lightChanged() {
3333
}
3434
}
3535

36-
#endif //SOC_IEEE802154_SUPPORTED
36+
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED

0 commit comments

Comments
 (0)