mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
mqtt tests: connect to local broker when running in CI to make the tests more reliable
This commit is contained in:
@@ -69,7 +69,11 @@ static void wifi_init(void)
|
||||
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, false, true, portMAX_DELAY);
|
||||
}
|
||||
|
||||
extern const uint8_t iot_eclipse_org_pem_start[] asm("_binary_iot_eclipse_org_pem_start");
|
||||
#if CONFIG_BROKER_CERTIFICATE_OVERRIDDEN == 1
|
||||
static const uint8_t iot_eclipse_org_pem_start[] = "-----BEGIN CERTIFICATE-----\n" CONFIG_BROKER_CERTIFICATE_OVERRIDE "\n-----END CERTIFICATE-----";
|
||||
#else
|
||||
extern const uint8_t iot_eclipse_org_pem_start[] asm("_binary_iot_eclipse_org_pem_start");
|
||||
#endif
|
||||
extern const uint8_t iot_eclipse_org_pem_end[] asm("_binary_iot_eclipse_org_pem_end");
|
||||
|
||||
static esp_err_t mqtt_event_handler(esp_mqtt_event_handle_t event)
|
||||
@@ -119,10 +123,11 @@ static esp_err_t mqtt_event_handler(esp_mqtt_event_handle_t event)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
||||
static void mqtt_app_start(void)
|
||||
{
|
||||
const esp_mqtt_client_config_t mqtt_cfg = {
|
||||
.uri = "mqtts://iot.eclipse.org:8883",
|
||||
.uri = CONFIG_BROKER_URI,
|
||||
.event_handle = mqtt_event_handler,
|
||||
.cert_pem = (const char *)iot_eclipse_org_pem_start,
|
||||
};
|
||||
|
Reference in New Issue
Block a user