8000 Sanitize Neopixel logging · exocode/esp32-snippets@5501cf6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5501cf6

Browse files
committed
Sanitize Neopixel logging
1 parent 8f106d7 commit 5501cf6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

cpp_utils/NeoPixelWiFiEventHandler.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
* Author: kolban
66
*/
77
#include <stdio.h>
8+
#include <esp_log.h>
89
#include "NeoPixelWiFiEventHandler.h"
910

11+
static const char* LOG_TAG = "NeoPixelWiFiEventHandler";
12+
1013
NeoPixelWiFiEventHandler::NeoPixelWiFiEventHandler(gpio_num_t gpioPin) {
1114
this->gpioPin = gpioPin;
1215
ws2812 = new WS2812(gpioPin, 8);
@@ -17,42 +20,42 @@ NeoPixelWiFiEventHandler::~NeoPixelWiFiEventHandler() {
1720
}
1821

1922
esp_err_t NeoPixelWiFiEventHandler::apStart() {
20-
printf("XXX apStart\n");
23+
ESP_LOGD(LOG_TAG, "XXX apStart");
2124
ws2812->setPixel(0, 0, 00, 64);
2225
ws2812->show();
2326
return ESP_OK;
2427
}
2528

2629
esp_err_t NeoPixelWiFiEventHandler::staConnected(system_event_sta_connected_t info) {
27-
printf("XXX staConnected\n");
30+
ESP_LOGD(LOG_TAG, "XXX staConnected");
2831
ws2812->setPixel(0, 57, 89, 66);
2932
ws2812->show();
3033
return ESP_OK;
3134
}
3235

3336
esp_err_t NeoPixelWiFiEventHandler::staDisconnected(system_event_sta_disconnected_t info) {
34-
printf("XXX staDisconnected\n");
37+
ESP_LOGD(LOG_TAG, "XXX staDisconnected");
3538
ws2812->setPixel(0, 64, 0, 0);
3639
ws2812->show();
3740
return ESP_OK;
3841
}
3942

4043
esp_err_t NeoPixelWiFiEventHandler::staStart() {
41-
printf("XXX staStart\n");
44+
ESP_LOGD(LOG_TAG, "XXX staStart");
4245
ws2812->setPixel(0, 64, 64, 0);
4346
ws2812->show();
4447
return ESP_OK;
4548
}
4649

4750
esp_err_t NeoPixelWiFiEventHandler::staGotIp(system_event_sta_got_ip_t info) {
48-
printf("XXX staGotIp\n");
51+
ESP_LOGD(LOG_TAG, "XXX staGotIp");
4952
ws2812->setPixel(0, 0, 64, 0);
5053
ws2812->show();
5154
return ESP_OK;
5255
}
5356

5457
esp_err_t NeoPixelWiFiEventHandler::wifiReady() {
55-
printf("XXX wifiReady\n");
58+
ESP_LOGD(LOG_TAG, "XXX wifiReady");
5659
ws2812->setPixel(0, 64, 64, 0);
5760
ws2812->show();
5861
return ESP_OK;

0 commit comments

Comments
 (0)
0