8000 Sanitize Neopixel logging by toxuin · Pull Request #686 · nkolban/esp32-snippets · GitHub
[go: up one dir, main page]

Skip to content

Sanitize Neopixel logging #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
10000
Diff view
15 changes: 9 additions & 6 deletions cpp_utils/NeoPixelWiFiEventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
* Author: kolban
*/
#include <stdio.h>
#include <esp_log.h>
#include "NeoPixelWiFiEventHandler.h"

static const char* LOG_TAG = "NeoPixelWiFiEventHandler";

NeoPixelWiFiEventHandler::NeoPixelWiFiEventHandler(gpio_num_t gpioPin) {
this->gpioPin = gpioPin;
ws2812 = new WS2812(gpioPin, 8);
Expand All @@ -17,42 +20,42 @@ NeoPixelWiFiEventHandler::~NeoPixelWiFiEventHandler() {
}

esp_err_t NeoPixelWiFiEventHandler::apStart() {
printf("XXX apStart\n");
ESP_LOGD(LOG_TAG, "XXX apStart");
ws2812->setPixel(0, 0, 00, 64);
ws2812->show();
return ESP_OK;
}

esp_err_t NeoPixelWiFiEventHandler::staConnected(system_event_sta_connected_t info) {
printf("XXX staConnected\n");
ESP_LOGD(LOG_TAG, "XXX staConnected");
ws2812->setPixel(0, 57, 89, 66);
ws2812->show();
return ESP_OK;
}

esp_err_t NeoPixelWiFiEventHandler::staDisconnected(system_event_sta_disconnected_t info) {
printf("XXX staDisconnected\n");
ESP_LOGD(LOG_TAG, "XXX staDisconnected");
ws2812->setPixel(0, 64, 0, 0);
ws2812->show();
return ESP_OK;
}

esp_err_t NeoPixelWiFiEventHandler::staStart() {
printf("XXX staStart\n");
ESP_LOGD(LOG_TAG, "XXX staStart");
ws2812->setPixel(0, 64, 64, 0);
ws2812->show();
return ESP_OK;
}

esp_err_t NeoPixelWiFiEventHandler::staGotIp(system_event_sta_got_ip_t info) {
printf("XXX staGotIp\n");
ESP_LOGD(LOG_TAG, "XXX staGotIp");
ws2812->setPixel(0, 0, 64, 0);
ws2812->show();
return ESP_OK;
}

esp_err_t NeoPixelWiFiEventHandler::wifiReady() {
printf("XXX wifiReady\n");
ESP_LOGD(LOG_TAG, "XXX wifiReady");
ws2812->setPixel(0, 64, 64, 0);
ws2812->show();
return ESP_OK;
Expand Down
0