Skip to content

Commit 95f9f80

Browse files
committed
Enable TCP_SSL_DEBUG when logging is enabled and level at least equal to ESP_LOG_DEBUG
1 parent eb6630f commit 95f9f80

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tcp_mbedtls.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
#if ASYNC_TCP_SSL_ENABLED
22

3+
#include "sdkconfig.h"
34
#include "tcp_mbedtls.h"
45
#include "lwip/tcp.h"
56
#include "mbedtls/debug.h"
67
#include "mbedtls/esp_debug.h"
8+
#include "esp_log.h"
79
#include <string.h>
810

911
// stubs to call LwIP's tcp functions on the LwIP thread itself, implemented in AsyncTCP.cpp
1012
extern esp_err_t _tcp_output4ssl(struct tcp_pcb * pcb, void* client);
1113
extern esp_err_t _tcp_write4ssl(struct tcp_pcb * pcb, const char* data, size_t size, uint8_t apiflags, void* client);
1214

13-
#if 0
15+
#if defined(CONFIG_LOG_DEFAULT_LEVEL) && CONFIG_LOG_DEFAULT_LEVEL >= ESP_LOG_DEBUG
1416
#define TCP_SSL_DEBUG(...) do { ets_printf("T %s- ", pcTaskGetTaskName(xTaskGetCurrentTaskHandle())); ets_printf(__VA_ARGS__); } while(0)
1517
#else
1618
#define TCP_SSL_DEBUG(...)

0 commit comments

Comments
 (0)