bulk update
This commit is contained in:
-1337
File diff suppressed because it is too large
Load Diff
@@ -1,166 +0,0 @@
|
||||
/*!
|
||||
@file WiFiConnectParam.cpp
|
||||
|
||||
WiFi Connection Manager with Captive Portal
|
||||
|
||||
Introduction
|
||||
|
||||
This is the documentation for WiFiConnect for the Arduino platform.
|
||||
It is a WiFi connection manager for use with the popular ESP8266 and ESP32 chips.
|
||||
It contains a captive portal to allow easy connection and changing of WiFi netwoks
|
||||
via a web based interface and allows for additional user parameters.
|
||||
It can also display messages via a OLED screen see WiFiConnectOLED class.
|
||||
|
||||
This is a heavily customised version from the original <a href="https://github.com/tzapu/WiFiManager">WiFiManager</a>
|
||||
developed by https://github.com/tzapu .
|
||||
|
||||
Dependencies
|
||||
|
||||
This library depends on <a href="https://github.com/esp8266/Arduino">
|
||||
ESP8266 Arduino Core</a> and <a href="https://github.com/espressif/arduino-esp32">ESP32 Arduino Core</a> being present on your system.
|
||||
Please make sure you have installed the latest version before using this library.
|
||||
|
||||
|
||||
Written by Stuart Blair.
|
||||
|
||||
License
|
||||
|
||||
GNU General Public License v3.0 licence, all text here must be included in any redistribution and you should receive a copy of the license file.
|
||||
|
||||
*/
|
||||
#include "WiFiConnectParam.h"
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Class object initialiser
|
||||
@param custom
|
||||
Custom HTML to be displayed in the access point for this item.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
WiFiConnectParam::WiFiConnectParam(const char *custom) {
|
||||
_id = NULL;
|
||||
_placeholder = NULL;
|
||||
_length = 0;
|
||||
_value = NULL;
|
||||
|
||||
_customHTML = custom;
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Class object initialiser
|
||||
@param id
|
||||
The unique ID for the html input box markup for this item
|
||||
@param placeholder
|
||||
Text to be displayed as the input box placeholder for this item
|
||||
@param defaultValue
|
||||
Default text to be displayed in the input box for this item
|
||||
@param length
|
||||
The maximum input text length for this item
|
||||
*/
|
||||
/**************************************************************************/
|
||||
WiFiConnectParam::WiFiConnectParam(const char *id, const char *placeholder, const char *defaultValue, int length) {
|
||||
init(id, placeholder, defaultValue, length, "");
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Class object initialiser
|
||||
@param id
|
||||
The unique ID for the html input box markup for this item
|
||||
@param placeholder
|
||||
Text to be displayed as the input box placeholder for this item
|
||||
@param defaultValue
|
||||
Default text to be displayed in the input box for this item
|
||||
@param length
|
||||
The maximum input text length for this item
|
||||
@param custom
|
||||
Custom HTML to be displayed in the access point for this item.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
WiFiConnectParam::WiFiConnectParam(const char *id, const char *placeholder, const char *defaultValue, int length, const char *custom) {
|
||||
init(id, placeholder, defaultValue, length, custom);
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Initialiser method
|
||||
@param id
|
||||
The unique ID for the html input box markup for this item
|
||||
@param placeholder
|
||||
Text to be displayed as the input box placeholder for this item
|
||||
@param defaultValue
|
||||
Default text to be displayed in the input box for this item
|
||||
@param length
|
||||
The maximum input text length for this item
|
||||
@param custom
|
||||
Custom HTML to be displayed in the access point for this item.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void WiFiConnectParam::init(const char *id, const char *placeholder, const char *defaultValue, int length, const char *custom) {
|
||||
_id = id;
|
||||
_placeholder = placeholder;
|
||||
_length = length;
|
||||
setValue(defaultValue);
|
||||
|
||||
_customHTML = custom;
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Method to change the current value of the item
|
||||
@param newValue
|
||||
The new string value for the item
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void WiFiConnectParam::setValue(const char *newValue){
|
||||
if(_length>0){
|
||||
_value = new char[_length + 1];
|
||||
for (int i = 0; i < _length; i++) {
|
||||
_value[i] = 0;
|
||||
}
|
||||
if (newValue != NULL) {
|
||||
strncpy(_value, newValue, _length);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Function to get the current value of the item
|
||||
@return The current value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
const char* WiFiConnectParam::getValue() {
|
||||
return _value;
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Function to get the current id of the item
|
||||
@return The current id
|
||||
*/
|
||||
/**************************************************************************/
|
||||
const char* WiFiConnectParam::getID() {
|
||||
return _id;
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Function to get the current placeholder text of the item
|
||||
@return The current placeholder text
|
||||
*/
|
||||
/**************************************************************************/
|
||||
const char* WiFiConnectParam::getPlaceholder() {
|
||||
return _placeholder;
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Function to get the maximum length allowed for the value of the item
|
||||
@return The current maximum value length
|
||||
*/
|
||||
/**************************************************************************/
|
||||
int WiFiConnectParam::getValueLength() {
|
||||
return _length;
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Function to get the current custom html markup of the item
|
||||
@return The current custom html markup
|
||||
*/
|
||||
/**************************************************************************/
|
||||
const char* WiFiConnectParam::getCustomHTML() {
|
||||
return _customHTML;
|
||||
}
|
||||
+2
-3
@@ -2956,7 +2956,7 @@ void BuildAdvancedRDS() {
|
||||
tft.drawLine(66, 30, 66, 0, FrameColor);
|
||||
tft.drawLine(105, 30, 105, 0, FrameColor);
|
||||
tft.drawLine(162, 30, 162, 0, FrameColor);
|
||||
tft.drawLine(210, 30, 210, 217, FrameColor);
|
||||
tft.drawLine(210, 30, 210, 193, FrameColor);
|
||||
tft.drawLine(248, 30, 248, 0, FrameColor);
|
||||
|
||||
tftPrint(ALEFT, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
@@ -2972,14 +2972,13 @@ void BuildAdvancedRDS() {
|
||||
tftPrint(ALEFT, "PTY", 3, 109, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "RT+", 3, 147, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "EON", 3, 174, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "AF", 3, 199, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "ECC", 3, 199, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "RT", 3, 222, ActiveColor, ActiveColorSmooth, 16);
|
||||
|
||||
tftPrint(ALEFT, "A:", 66, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "B:", 104, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "C:", 142, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "D:", 180, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ALEFT, "ECC", 214, 199, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, "Dynamic PTY", 300, 130, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, "Artificial head", 300, 145, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(ARIGHT, "Compressed", 300, 160, ActiveColor, ActiveColorSmooth, 16);
|
||||
|
||||
+4
-5
@@ -12,8 +12,8 @@ using fs::FS;
|
||||
#include <WebServer.h>
|
||||
#include <SPIFFS.h>
|
||||
#include "NTPupdate.h"
|
||||
#include "WiFiConnect.h"
|
||||
#include "WiFiConnectParam.h"
|
||||
#include <WiFiConnect.h>
|
||||
#include <WiFiConnectParam.h>
|
||||
#include "FONT16.h"
|
||||
#include "FONT16_CHS.h"
|
||||
#include "FONT28.h"
|
||||
@@ -43,8 +43,8 @@ using fs::FS;
|
||||
#define TOUCHIRQ 33
|
||||
#define EXT_IRQ 14
|
||||
|
||||
#define DYNAMIC_SPI_SPEED // uncomment to enable dynamic SPI Speed https://github.com/ohmytime/TFT_eSPI_DynamicSpeed
|
||||
//#define HAS_AIR_BAND // uncomment to enable Air Band(Make sure you have Air Band extend board)
|
||||
#define DYNAMIC_SPI_SPEED
|
||||
//#define HAS_AIR_BAND
|
||||
|
||||
#ifdef ARS
|
||||
TFT_eSPI tft = TFT_eSPI(320, 240);
|
||||
@@ -1633,7 +1633,6 @@ void GetData() {
|
||||
if (!afscreen && !rdsstatscreen) {
|
||||
if (!screenmute) ShowErrors();
|
||||
showPTY();
|
||||
showECC();
|
||||
showRadioText();
|
||||
if (millis() >= tuningtimer + 200) doAF();
|
||||
}
|
||||
|
||||
+19
-58
@@ -49,8 +49,6 @@ void ShowAdvancedRDS() {
|
||||
}
|
||||
}
|
||||
|
||||
String afstring;
|
||||
if (radio.rds.hasAF && radio.af_counter > 0) for (byte i = 0; i < radio.af_counter; i++) afstring += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (i == radio.af_counter - 1 ? " " : " | "); else afstring = textUI(87);
|
||||
if (hasafold != radio.rds.hasAF) {
|
||||
if (!screenmute) {
|
||||
if (radio.rds.hasAF) tftPrint(ALEFT, "AF", 50, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "AF", 50, 51, GreyoutColor, BackgroundColor, 16);
|
||||
@@ -58,36 +56,27 @@ void ShowAdvancedRDS() {
|
||||
hasafold = radio.rds.hasAF;
|
||||
}
|
||||
|
||||
if (afstring != afstringold) {
|
||||
afstringWidth = RDSSprite.textWidth(afstring);
|
||||
afstringold = afstring;
|
||||
}
|
||||
|
||||
if (RDSSprite.textWidth(radio.trimTrailingSpaces(afstring)) < 165) {
|
||||
xPos2 = 0;
|
||||
RDSSprite.fillSprite(BackgroundColor);
|
||||
if (RDSstatus) RDSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RDSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||
RDSSprite.drawString(afstring, xPos2, 2);
|
||||
RDSSprite.pushSprite(35, 197);
|
||||
} else {
|
||||
if (millis() - afticker >= 5) {
|
||||
if (xPos2 < -afstringWidth) xPos2 = 0;
|
||||
if (xPos2 == 0) {
|
||||
if (millis() - aftickerhold >= 2000) {
|
||||
xPos2--;
|
||||
aftickerhold = millis();
|
||||
if (ECCold != radio.rds.ECC) {
|
||||
if (advancedRDS) {
|
||||
if (!screenmute) {
|
||||
if (radio.rds.hasECC) ECCString = (radio.rds.ECCtext.length() == 0 ? textUI(73) : radio.rds.ECCtext); else ECCString = "N/A";
|
||||
if (ECCString != ECColdString) {
|
||||
tftPrint(ALEFT, "N/A", 35, 199, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, ECColdString, 35, 199, BackgroundColor, BackgroundColor, 16);
|
||||
}
|
||||
} else {
|
||||
xPos2--;
|
||||
aftickerhold = millis();
|
||||
tftPrint(ALEFT, ECCString, 35, 199, RDSColor, RDSColorSmooth, 16);
|
||||
}
|
||||
RDSSprite.fillSprite(BackgroundColor);
|
||||
if (RDSstatus) RDSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else RDSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||
RDSSprite.drawString(afstring, xPos2, 2);
|
||||
RDSSprite.drawString(afstring, xPos2 + afstringWidth, 2);
|
||||
RDSSprite.pushSprite(35, 197);
|
||||
afticker = millis();
|
||||
ECColdString = ECCString;
|
||||
}
|
||||
|
||||
if (wifi) {
|
||||
Udp.beginPacket(remoteip, 9030);
|
||||
Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";ECC=");
|
||||
if (radio.rds.ECC < 0x10) Udp.print("0");
|
||||
Udp.print(String(radio.rds.ECC, HEX));
|
||||
Udp.endPacket();
|
||||
}
|
||||
ECCold = radio.rds.ECC;
|
||||
}
|
||||
|
||||
String eonstring;
|
||||
@@ -229,31 +218,6 @@ void doAF() {
|
||||
}
|
||||
}
|
||||
|
||||
void showECC() {
|
||||
if (ECCold != radio.rds.ECC) {
|
||||
if (advancedRDS) {
|
||||
if (!screenmute) {
|
||||
if (radio.rds.hasECC) ECCString = (radio.rds.ECCtext.length() == 0 ? textUI(73) : radio.rds.ECCtext); else ECCString = "N/A";
|
||||
if (ECCString != ECColdString) {
|
||||
tftPrint(ALEFT, "N/A", 242, 199, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(ALEFT, ECColdString, 242, 199, BackgroundColor, BackgroundColor, 16);
|
||||
}
|
||||
tftPrint(ALEFT, ECCString, 242, 199, RDSColor, RDSColorSmooth, 16);
|
||||
}
|
||||
ECColdString = ECCString;
|
||||
}
|
||||
|
||||
if (wifi) {
|
||||
Udp.beginPacket(remoteip, 9030);
|
||||
Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";ECC=");
|
||||
if (radio.rds.ECC < 0x10) Udp.print("0");
|
||||
Udp.print(String(radio.rds.ECC, HEX));
|
||||
Udp.endPacket();
|
||||
}
|
||||
ECCold = radio.rds.ECC;
|
||||
}
|
||||
}
|
||||
|
||||
void readRds() {
|
||||
if (band >= BAND_GAP) return;
|
||||
|
||||
@@ -261,10 +225,8 @@ void readRds() {
|
||||
RDSstatus = radio.rds.hasRDS;
|
||||
ShowRDSLogo(RDSstatus);
|
||||
|
||||
// Handle RDS dropout / recovery only when screen is active
|
||||
if (!screenmute && !afscreen) {
|
||||
if (!RDSstatus) {
|
||||
// --- RDS dropout (lost signal) ---
|
||||
if (radio.rds.correctPI != 0 && !dropout) {
|
||||
if (!rdsstatscreen) {
|
||||
if (radio.rds.region == 0) tftPrint(ACENTER, PIold, 275, advancedRDS ? 75 : 187, RDSDropoutColor, RDSDropoutColorSmooth, 28);
|
||||
@@ -334,9 +296,8 @@ void readRds() {
|
||||
}
|
||||
}
|
||||
|
||||
// --- Data output for RDS Spy / XDRGTK ---
|
||||
if (bitRead(radio.rds.rdsStat, 9)) {
|
||||
char hexbuf[5]; // buffer for 4-digit HEX
|
||||
char hexbuf[5];
|
||||
|
||||
// RDS Spy output
|
||||
if (RDSstatus && (RDSSPYUSB || RDSSPYTCP)) {
|
||||
|
||||
Reference in New Issue
Block a user