Skip to content

Commit

Permalink
idf 5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
256dpi committed Jan 11, 2023
1 parent 9fd8eac commit c6066b1
Show file tree
Hide file tree
Showing 5 changed files with 576 additions and 304 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash

ESP_IDF_VERSION := "v4.4"
ESP_IDF_VERSION := "v5.0-rc1"

fmt:
clang-format -i ./*.c ./*.h -style="{BasedOnStyle: Google, ColumnLimit: 120, SortIncludes: false}"
Expand Down
2 changes: 1 addition & 1 deletion esp_tls_lwmqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ lwmqtt_err_t esp_tls_lwmqtt_network_connect(esp_tls_lwmqtt_network_t *n, char *h
if (flags != 0) {
char verify_buf[100] = {0};
mbedtls_x509_crt_verify_info(verify_buf, sizeof(verify_buf), " ! ", flags);
ESP_LOGE("esp-mqtt", "%mbedtls_ssl_get_verify_result: %s (%d)", verify_buf, flags);
ESP_LOGE("esp-mqtt", "%mbedtls_ssl_get_verify_result: %s (%ld)", verify_buf, flags);
}
}

Expand Down
1 change: 0 additions & 1 deletion esp_tls_lwmqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <esp_log.h>
#include <lwmqtt.h>
#include <mbedtls/certs.h>
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/entropy.h>
#include <mbedtls/error.h>
Expand Down
10 changes: 5 additions & 5 deletions test/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ static void restart(void *_) {
static void event_handler(void *event_handler_arg, esp_event_base_t event_base, int32_t event_id, void *event_data) {
if (event_base == WIFI_EVENT) {
switch (event_id) {
case SYSTEM_EVENT_STA_START:
case WIFI_EVENT_STA_START:
// connect to ap
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_connect());

break;

case SYSTEM_EVENT_STA_GOT_IP:
case IP_EVENT_STA_GOT_IP:
break;

case SYSTEM_EVENT_STA_DISCONNECTED:
case WIFI_EVENT_STA_DISCONNECTED:
// reconnect Wi-Fi
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_wifi_connect());

Expand Down Expand Up @@ -136,6 +136,6 @@ void app_main() {
esp_mqtt_init(status_callback, message_callback, 256, 2000, 1);

// create tasks
xTaskCreatePinnedToCore(process, "process", 2048, NULL, 10, NULL, 1);
xTaskCreatePinnedToCore(restart, "restart", 2048, NULL, 10, NULL, 1);
xTaskCreatePinnedToCore(process, "process", 4096, NULL, 10, NULL, 1);
xTaskCreatePinnedToCore(restart, "restart", 4066, NULL, 10, NULL, 1);
}
Loading

0 comments on commit c6066b1

Please sign in to comment.