Select one of the symbols to view example projects that use it.
 
Outline
#include <stdio.h>
#include <stdlib.h>
#include "esp_log.h"
#include "esp_attr.h"
#define VPRINTF_STACK_BUFFER_SIZE
lib_printf(const char *, const char *, va_list)
pp_printf(const char *, ...)
sc_printf(const char *, ...)
core_printf(const char *, ...)
net80211_printf(const char *, ...)
target_printf(const char *, ...)
wapi_printf(const char *, ...)
mesh_printf(const char *, ...)
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/esp_wifi/src/lib_printf.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2016-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ /** * @file lib_printf.c * * This file contains library-specific printf functions * used by WiFi libraries in the `lib` directory. * These function are used to catch any output which gets printed * by libraries, and redirect it to ESP_LOG macros. * * Eventually WiFi libraries will use ESP_LOG functions internally * and these definitions will be removed. *//* ... */ #include <stdio.h> #include <stdlib.h> #include "esp_log.h" #include "esp_attr.h" #define VPRINTF_STACK_BUFFER_SIZE 80 static int lib_printf(const char* tag, const char* format, va_list arg) { char temp[VPRINTF_STACK_BUFFER_SIZE]; int len = vsnprintf(temp, sizeof(temp) - 1, format, arg); temp[sizeof(temp) - 1] = 0; int i; for (i = len - 1; i >= 0; --i) { if (temp[i] != '\n' && temp[i] != '\r' && temp[i] != ' ') { break; }{...} temp[i] = 0; }{...} if (i > 0) { ESP_LOGI(tag, "%s", temp); }{...} va_end(arg); return len; }{ ... } int pp_printf(const char* format, ...) { va_list arg; va_start(arg, format); int res = lib_printf("pp", format, arg); va_end(arg); return res; }{ ... } int sc_printf(const char* format, ...) { va_list arg; va_start(arg, format); int res = lib_printf("smartconfig", format, arg); va_end(arg); return res; }{ ... } int core_printf(const char* format, ...) { va_list arg; va_start(arg, format); int res = lib_printf("core", format, arg); va_end(arg); return res; }{ ... } int net80211_printf(const char* format, ...) { va_list arg; va_start(arg, format); int res = lib_printf("net80211", format, arg); va_end(arg); return res; }{ ... } int target_printf(const char* format, ...) { va_list arg; va_start(arg, format); int res = lib_printf("target", format, arg); va_end(arg); return res; }{ ... } int wapi_printf(const char* format, ...) { va_list arg; va_start(arg, format); int res = lib_printf("wapi", format, arg); va_end(arg); return res; }{ ... } int mesh_printf(const char* format, ...) { va_list arg; va_start(arg, format); int res = lib_printf("mesh", format, arg); va_end(arg); return res; }{ ... }
Details