forked from espressif/arduino-esp32
Summary Added compiler.warning_flags to all chips in platform.txt to reflect users setting of warning level output during compilation (set up in Arduino IDE preferences) Impact When a warning is set to none the compilation will no longer display warnings Related links Solves issue #6118
This commit is contained in:
@ -36,6 +36,7 @@ void sysProvEvent(arduino_event_t *sys_event)
|
||||
printQR(service_name, pop, "ble");
|
||||
#endif
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@ void sysProvEvent(arduino_event_t *sys_event)
|
||||
Serial.printf("\nConnected to Wi-Fi!\n");
|
||||
digitalWrite(gpio_led, true);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ void sysProvEvent(arduino_event_t *sys_event)
|
||||
printQR(service_name, pop, "ble");
|
||||
#endif
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
|
||||
|
21
libraries/RainMaker/src/RMakerQR.cpp
Normal file
21
libraries/RainMaker/src/RMakerQR.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include "RMakerQR.h"
|
||||
#ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK
|
||||
void printQR(const char *name, const char *pop, const char *transport)
|
||||
{
|
||||
if (!name || !pop || !transport) {
|
||||
log_w("Cannot generate QR code payload. Data missing.");
|
||||
return;
|
||||
}
|
||||
char payload[150];
|
||||
snprintf(payload, sizeof(payload), "{\"ver\":\"%s\",\"name\":\"%s\"" \
|
||||
",\"pop\":\"%s\",\"transport\":\"%s\"}",
|
||||
PROV_QR_VERSION, name, pop, transport);
|
||||
if(Serial){
|
||||
Serial.printf("Scan this QR code from the ESP RainMaker phone app.\n");
|
||||
}
|
||||
qrcode_display(payload);
|
||||
if(Serial){
|
||||
Serial.printf("If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s\n", QRCODE_BASE_URL, payload);
|
||||
}
|
||||
}
|
||||
#endif
|
@ -14,24 +14,12 @@
|
||||
#pragma once
|
||||
#include "sdkconfig.h"
|
||||
#ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK
|
||||
#include "RMaker.h"
|
||||
#include "esp_system.h"
|
||||
#include <qrcode.h>
|
||||
|
||||
#define PROV_QR_VERSION "v1"
|
||||
#define QRCODE_BASE_URL "https://rainmaker.espressif.com/qrcode.html"
|
||||
|
||||
static void printQR(const char *name, const char *pop, const char *transport)
|
||||
{
|
||||
if (!name || !pop || !transport) {
|
||||
log_w("Cannot generate QR code payload. Data missing.");
|
||||
return;
|
||||
}
|
||||
char payload[150];
|
||||
snprintf(payload, sizeof(payload), "{\"ver\":\"%s\",\"name\":\"%s\"" \
|
||||
",\"pop\":\"%s\",\"transport\":\"%s\"}",
|
||||
PROV_QR_VERSION, name, pop, transport);
|
||||
Serial.printf("Scan this QR code from the ESP RainMaker phone app.\n");
|
||||
qrcode_display(payload);
|
||||
Serial.printf("If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s\n", QRCODE_BASE_URL, payload);
|
||||
}
|
||||
void printQR(const char *name, const char *pop, const char *transport);
|
||||
#endif
|
12
libraries/RainMaker/src/RMakerUtils.cpp
Normal file
12
libraries/RainMaker/src/RMakerUtils.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "RMakerUtils.h"
|
||||
#ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK
|
||||
void RMakerFactoryReset(int seconds)
|
||||
{
|
||||
esp_rmaker_factory_reset(0, seconds);
|
||||
}
|
||||
|
||||
void RMakerWiFiReset(int seconds)
|
||||
{
|
||||
esp_rmaker_wifi_reset(0, seconds);
|
||||
}
|
||||
#endif
|
@ -14,16 +14,10 @@
|
||||
#pragma once
|
||||
#include "sdkconfig.h"
|
||||
#ifdef CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK
|
||||
#include "RMaker.h"
|
||||
#include "esp_system.h"
|
||||
#include <esp_rmaker_utils.h>
|
||||
|
||||
static void RMakerFactoryReset(int seconds)
|
||||
{
|
||||
esp_rmaker_factory_reset(0, seconds);
|
||||
}
|
||||
|
||||
static void RMakerWiFiReset(int seconds)
|
||||
{
|
||||
esp_rmaker_wifi_reset(0, seconds);
|
||||
}
|
||||
void RMakerFactoryReset(int seconds);
|
||||
void RMakerWiFiReset(int seconds);
|
||||
#endif
|
Reference in New Issue
Block a user