Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3822a68

Browse files
me-no-devP-R-O-C-H-Y
andauthored
IDF release/v5.3 (espressif#10599)
* fix(zigbee): Bump zigbee version and use 1.6.0 (espressif#10563) Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com> * fix(zigbee): Add require public for zigbee libs * fix(zigbee): Guard the Zigbee library * fix(zigbee): Fix removed cluster_role attribute (espressif#10576) * fix(hosted): Update hosted configuration * fix(hosted): Fix Hosted deinit and protect reinit for now * IDF release/v5.3 a0f798cf * IDF release/v5.3 a0f798cf --------- Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
1 parent cc40718 commit 3822a68

20 files changed

+92
-63
lines changed

‎idf_component.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ dependencies:
5252
espressif/esp_modem:
5353
version: "^1.1.0"
5454
espressif/esp-zboss-lib:
55-
version: "^1.0.1"
55+
version: "==1.6.0"
56+
require: public
5657
rules:
5758
- if: "target not in [esp32c2, esp32p4]"
5859
espressif/esp-zigbee-lib:
59-
version: "^1.0.1"
60+
version: "==1.6.0"
61+
require: public
6062
rules:
6163
- if: "target not in [esp32c2, esp32p4]"
6264
espressif/esp-dsp:
@@ -101,7 +103,7 @@ dependencies:
101103
rules:
102104
- if: "target in [esp32s3]"
103105
espressif/esp_hosted:
104-
version: "^0.0.22"
106+
version: "^0.0.25"
105107
rules:
106108
- if: "target == esp32p4"
107109
espressif/esp_wifi_remote:

‎libraries/WiFi/src/WiFiGeneric.cpp‎

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,34 @@ extern "C" void phy_bbpll_en_usb(bool en);
240240
#endif
241241

242242
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
243-
extern "C" esp_err_t esp_hosted_init(void *);
243+
extern "C" {
244+
//#include "esp_hosted.h"
245+
#include "esp_hosted_transport_config.h"
246+
extern esp_err_t esp_hosted_init();
247+
extern esp_err_t esp_hosted_deinit();
248+
};
249+
static bool hosted_initialized = false;
244250

245251
static bool wifiHostedInit() {
246-
static bool initialized = false;
247-
if (!initialized) {
248-
initialized = true;
249-
if (esp_hosted_init(NULL) != ESP_OK) {
252+
if (!hosted_initialized) {
253+
hosted_initialized = true;
254+
struct esp_hosted_sdio_config conf = INIT_DEFAULT_HOST_SDIO_CONFIG();
255+
conf.pin_clk.pin = CONFIG_ESP_SDIO_PIN_CLK;
256+
conf.pin_cmd.pin = CONFIG_ESP_SDIO_PIN_CMD;
257+
conf.pin_d0.pin = CONFIG_ESP_SDIO_PIN_D0;
258+
conf.pin_d1.pin = CONFIG_ESP_SDIO_PIN_D1;
259+
conf.pin_d2.pin = CONFIG_ESP_SDIO_PIN_D2;
260+
conf.pin_d3.pin = CONFIG_ESP_SDIO_PIN_D3;
261+
//conf.pin_rst.pin = CONFIG_ESP_SDIO_GPIO_RESET_SLAVE;
262+
// esp_hosted_sdio_set_config() will fail on second attempt but here temporarily to not cause exception on reinit
263+
if (esp_hosted_sdio_set_config(&conf) != ESP_OK || esp_hosted_init() != ESP_OK) {
250264
log_e("esp_hosted_init failed!");
265+
hosted_initialized = false;
251266
return false;
252267
}
268+
log_v("ESP-HOSTED initialized!");
253269
}
254-
// Attach pins to periman here
270+
// Attach pins to PeriMan here
255271
// Slave chip model is CONFIG_IDF_SLAVE_TARGET
256272
// CONFIG_ESP_SDIO_PIN_CMD
257273
// CONFIG_ESP_SDIO_PIN_CLK
@@ -337,6 +353,13 @@ static bool wifiLowLevelDeinit() {
337353
arduino_event_t arduino_event;
338354
arduino_event.event_id = ARDUINO_EVENT_WIFI_OFF;
339355
Network.postEvent(&arduino_event);
356+
#if CONFIG_ESP_WIFI_REMOTE_ENABLED
357+
if (hosted_initialized && esp_hosted_deinit() == ESP_OK) {
358+
hosted_initialized = false;
359+
log_v("ESP-HOSTED uninitialized!");
360+
// detach SDIO pins from PeriMan
361+
}
362+
#endif
340363
}
341364
}
342365
return !lowLevelInitDone;

‎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 & 3 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"
@@ -104,7 +104,6 @@ void ZigbeeEP::reportBatteryPercentage() {
104104
esp_zb_zcl_report_attr_cmd_t report_attr_cmd;
105105
report_attr_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT;
106106
report_attr_cmd.attributeID = ESP_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_PERCENTAGE_REMAINING_ID;
107-
report_attr_cmd.cluster_role = ESP_ZB_ZCL_CLUSTER_SERVER_ROLE;
108107
report_attr_cmd.clusterID = ESP_ZB_ZCL_CLUSTER_ID_POWER_CONFIG;
109108
report_attr_cmd.zcl_basic_cmd.src_endpoint = _endpoint;
110109

@@ -210,4 +209,4 @@ void ZigbeeEP::zbIdentify(const esp_zb_zcl_set_attr_value_message_t *message) {
210209
}
211210
}
212211

213-
#endif //SOC_IEEE802154_SUPPORTED
212+
#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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /