Skip to content

Commit 6e8c65e

Browse files
committed
Merge branch 'task/idf-v5.0' into 'master'
esp_rmaker_core: Minor changes for compilation with idf v5.0/master See merge request app-frameworks/esp-rainmaker!310
2 parents 00bcf4c + 88335d1 commit 6e8c65e

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.gitlab-ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,19 @@ build_idf_v4.4:
8181
variables:
8282
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3"
8383

84+
build_idf_v5.0:
85+
extends: .build_template
86+
image: espressif/idf:release-v5.0
87+
variables:
88+
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3"
89+
EXAMPLES: "switch led_light fan temperature_sensor multi_device gpio"
90+
8491
build_idf_master:
8592
extends: .build_template
8693
image: espressif/idf:latest
8794
variables:
8895
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3"
96+
EXAMPLES: "switch led_light fan temperature_sensor multi_device gpio"
8997

9098
build_docs:
9199
stage: build

components/esp_rainmaker/src/core/esp_rmaker_local_ctrl.c

+11-2
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,20 @@ static esp_err_t __esp_rmaker_start_local_ctrl_service(const char *serv_name)
266266
};
267267

268268
/* If sec1, add security type details to the config */
269-
protocomm_security_pop_t *pop = NULL;
269+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
270+
#define PROTOCOMM_SEC_DATA protocomm_security1_params_t
271+
#else
272+
#define PROTOCOMM_SEC_DATA protocomm_security_pop_t
273+
#endif /* ESP_IDF_VERSION */
274+
PROTOCOMM_SEC_DATA *pop = NULL;
270275
#if ESP_RMAKER_LOCAL_CTRL_SECURITY_TYPE == 1
271276
char *pop_str = esp_rmaker_local_ctrl_get_pop();
272277
/* Note: pop_str shouldn't be freed. If it gets freed, the pointer which is internally copied in esp_local_ctrl_start() will become invalid which would cause corruption. */
273278

274279
int sec_ver = esp_rmaker_local_ctrl_get_security_type();
275280

276281
if (sec_ver != 0 && pop_str) {
277-
pop = (protocomm_security_pop_t *)calloc(1, sizeof(protocomm_security_pop_t));
282+
pop = (PROTOCOMM_SEC_DATA *)calloc(1, sizeof(PROTOCOMM_SEC_DATA));
278283
if (!pop) {
279284
ESP_LOGE(TAG, "Failed to allocate pop");
280285
free(pop_str);
@@ -286,7 +291,11 @@ static esp_err_t __esp_rmaker_start_local_ctrl_service(const char *serv_name)
286291

287292
config.proto_sec.version = sec_ver;
288293
config.proto_sec.custom_handle = NULL;
294+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
295+
config.proto_sec.sec_params = pop;
296+
#else
289297
config.proto_sec.pop = pop;
298+
#endif /* ESP_IDF_VERSION */
290299
#endif
291300

292301
/* Start esp_local_ctrl service */

0 commit comments

Comments
 (0)