1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Add code-spell spelling checks to CI (#8067)

Help find and fix silly spelling errors as they are added to the repo.
This commit is contained in:
Earle F. Philhower, III 2021-05-23 08:53:04 -07:00 committed by GitHub
parent 78a2ed6bd8
commit 60fe7b4ca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
133 changed files with 273 additions and 260 deletions

View File

@ -269,3 +269,18 @@ jobs:
bash ./tests/ci/build_boards.sh bash ./tests/ci/build_boards.sh
bash ./tests/ci/eboot_test.sh bash ./tests/ci/eboot_test.sh
bash ./tests/ci/pkgrefs_test.sh bash ./tests/ci/pkgrefs_test.sh
# Validate orthography
code-spell:
name: Check spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Run codespell
uses: codespell-project/actions-codespell@master
with:
skip: ./libraries/ESP8266SdFat,./libraries/LittleFS/lib,./tools/pyserial,./tools/sdk,./tools/esptool,./libraries/SoftwareSerial,./libraries/Ethernet,./github/workflows,./libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino,./libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino,./libraries/esp8266/examples/StreamString/StreamString.ino,./libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino,./libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino,./libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino,./libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino,./cores/esp8266/spiffs,./tests/device/test_libc/libm_string.c, ./libraries/Netdump/examples/Netdump/Netdump.ino,./libraries/ESP8266WiFi/examples/BearSSL_Server,./cores/esp8266/LwipIntfDev.h
ignore_words_list: ESP8266,esp8266,esp,dout,DOUT,ser,ans

View File

@ -1,9 +1,8 @@
#ifndef __CALLBACKLIST_H__ #ifndef __CALLBACKLIST_H__
#define __CALLBACKLIST_H__ #define __CALLBACKLIST_H__
/* /*
CallBackList, An implemention for handling callback execution CallBackList, An implementation for handling callback execution
Copyright (c) 2019 Herman Reintke. All rights reserved. Copyright (c) 2019 Herman Reintke. All rights reserved.
This file is part of the esp8266 core for Arduino environment. This file is part of the esp8266 core for Arduino environment.

View File

@ -25,7 +25,7 @@
void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag) void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
{ {
// L2 / Euclidian norm of free block sizes. // L2 / Euclidean norm of free block sizes.
// Having getFreeHeap()=sum(hole-size), fragmentation is given by // Having getFreeHeap()=sum(hole-size), fragmentation is given by
// 100 * (1 - sqrt(sum(hole-size²)) / sum(hole-size)) // 100 * (1 - sqrt(sum(hole-size²)) / sum(hole-size))

View File

@ -26,7 +26,7 @@
#include "spi_vendors.h" #include "spi_vendors.h"
/** /**
* AVR macros for WDT managment * AVR macros for WDT management
*/ */
typedef enum { typedef enum {
WDTO_0MS = 0, //!< WDTO_0MS WDTO_0MS = 0, //!< WDTO_0MS
@ -264,7 +264,7 @@ class EspClass {
static bool flashReplaceBlock(uint32_t address, const uint8_t *value, uint32_t byteCount); static bool flashReplaceBlock(uint32_t address, const uint8_t *value, uint32_t byteCount);
/** /**
* @brief Write up to @a size bytes from @a data to flash at @a address * @brief Write up to @a size bytes from @a data to flash at @a address
* This function takes case of unaligned memory acces by copying @a data to a temporary buffer, * This function takes case of unaligned memory access by copying @a data to a temporary buffer,
* it also takes care of page boundary crossing see @a flashWritePageBreak as to why it's done. * it also takes care of page boundary crossing see @a flashWritePageBreak as to why it's done.
* Less than @a size bytes may be written, due to 4 byte alignment requirement of spi_flash_write * Less than @a size bytes may be written, due to 4 byte alignment requirement of spi_flash_write
* @param address address on flash where write should start * @param address address on flash where write should start

View File

@ -15,7 +15,7 @@ void close_all_fs(void)
} }
// default weak definitions // default weak definitions
// they are overriden in their respective real implementation // they are overridden in their respective real implementation
// hint: https://github.com/esp8266/Arduino/pull/6699#issuecomment-549085382 // hint: https://github.com/esp8266/Arduino/pull/6699#issuecomment-549085382
void littlefs_request_end(void) __attribute__((weak)); void littlefs_request_end(void) __attribute__((weak));

View File

@ -132,7 +132,7 @@ public:
int peek(void) override int peek(void) override
{ {
// return -1 when data is unvailable (arduino api) // return -1 when data is unavailable (arduino api)
return uart_peek_char(_uart); return uart_peek_char(_uart);
} }
@ -162,7 +162,7 @@ public:
int read(void) override int read(void) override
{ {
// return -1 when data is unvailable (arduino api) // return -1 when data is unavailable (arduino api)
return uart_read_char(_uart); return uart_read_char(_uart);
} }
// ::read(buffer, size): same as readBytes without timeout // ::read(buffer, size): same as readBytes without timeout

View File

@ -51,7 +51,7 @@ extern "C"
// trying to change legacy behavor // trying to change legacy behavor
// `fw_has_started_softap_dhcps` will be read in DhcpServer::DhcpServer // `fw_has_started_softap_dhcps` will be read in DhcpServer::DhcpServer
// which is called when c++ ctors are initialized, specifically // which is called when c++ ctors are initialized, specifically
// dhcpSoftAP intialized with AP interface number above. // dhcpSoftAP initialized with AP interface number above.
fw_has_started_softap_dhcps = 1; fw_has_started_softap_dhcps = 1;
#endif #endif
} }

View File

@ -195,7 +195,7 @@ DhcpServer::DhcpServer(netif* netif): _netif(netif)
{ 0 } // gateway 0.0.0.0 { 0 } // gateway 0.0.0.0
}; };
begin(&ip); begin(&ip);
fw_has_started_softap_dhcps = 2; // not 1, ending intial boot sequence fw_has_started_softap_dhcps = 2; // not 1, ending initial boot sequence
} }
}; };
@ -454,10 +454,10 @@ uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
*optptr++ = 1; *optptr++ = 1;
*optptr++ = 0x00; *optptr++ = 0x00;
#if 0 // vendor specific unititialized (??) #if 0 // vendor specific uninitialized (??)
*optptr++ = 43; // vendor specific *optptr++ = 43; // vendor specific
*optptr++ = 6; *optptr++ = 6;
// unitialized ? // uninitialized ?
#endif #endif
#if 0 // already set (DHCP_OPTION_SUBNET_MASK==1) (??) #if 0 // already set (DHCP_OPTION_SUBNET_MASK==1) (??)

View File

@ -76,7 +76,7 @@ class Print {
inline size_t write(int8_t c) { return write((uint8_t) c); } inline size_t write(int8_t c) { return write((uint8_t) c); }
// default to zero, meaning "a single write may block" // default to zero, meaning "a single write may block"
// should be overriden by subclasses with buffering // should be overridden by subclasses with buffering
virtual int availableForWrite() { return 0; } virtual int availableForWrite() { return 0; }
size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3))); size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3)));

View File

@ -148,7 +148,7 @@ long Stream::parseInt(char skipChar) {
do { do {
if(c == skipChar) if(c == skipChar)
; // ignore this charactor ; // ignore this character
else if(c == '-') else if(c == '-')
isNegative = true; isNegative = true;
else if(c >= '0' && c <= '9') // is c a digit? else if(c >= '0' && c <= '9') // is c a digit?

View File

@ -162,27 +162,27 @@ class Stream: public Print {
// ::send*() methods: // ::send*() methods:
// - always stop before timeout when "no-more-input-possible-data" // - always stop before timeout when "no-more-input-possible-data"
// or "no-more-output-possible-data" condition is met // or "no-more-output-possible-data" condition is met
// - always return number of transfered bytes // - always return number of transferred bytes
// When result is 0 or less than requested maxLen, Print::getLastSend() // When result is 0 or less than requested maxLen, Print::getLastSend()
// contains an error reason. // contains an error reason.
// transfers already buffered / immediately available data (no timeout) // transfers already buffered / immediately available data (no timeout)
// returns number of transfered bytes // returns number of transferred bytes
size_t sendAvailable (Print* to) { return sendGeneric(to, -1, -1, oneShotMs::alwaysExpired); } size_t sendAvailable (Print* to) { return sendGeneric(to, -1, -1, oneShotMs::alwaysExpired); }
size_t sendAvailable (Print& to) { return sendAvailable(&to); } size_t sendAvailable (Print& to) { return sendAvailable(&to); }
// transfers data until timeout // transfers data until timeout
// returns number of transfered bytes // returns number of transferred bytes
size_t sendAll (Print* to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, -1, timeoutMs); } size_t sendAll (Print* to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, -1, timeoutMs); }
size_t sendAll (Print& to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendAll(&to, timeoutMs); } size_t sendAll (Print& to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendAll(&to, timeoutMs); }
// transfers data until a char is encountered (the char is swallowed but not transfered) with timeout // transfers data until a char is encountered (the char is swallowed but not transferred) with timeout
// returns number of transfered bytes // returns number of transferred bytes
size_t sendUntil (Print* to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, readUntilChar, timeoutMs); } size_t sendUntil (Print* to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, readUntilChar, timeoutMs); }
size_t sendUntil (Print& to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendUntil(&to, readUntilChar, timeoutMs); } size_t sendUntil (Print& to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendUntil(&to, readUntilChar, timeoutMs); }
// transfers data until requested size or timeout // transfers data until requested size or timeout
// returns number of transfered bytes // returns number of transferred bytes
size_t sendSize (Print* to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, maxLen, -1, timeoutMs); } size_t sendSize (Print* to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, maxLen, -1, timeoutMs); }
size_t sendSize (Print& to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendSize(&to, maxLen, timeoutMs); } size_t sendSize (Print& to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendSize(&to, maxLen, timeoutMs); }

View File

@ -230,7 +230,7 @@ public:
StreamString(StreamString&& bro): String(bro), S2Stream(this) { } StreamString(StreamString&& bro): String(bro), S2Stream(this) { }
StreamString(const StreamString& bro): String(bro), S2Stream(this) { } StreamString(const StreamString& bro): String(bro), S2Stream(this) { }
// duplicate String contructors and operator=: // duplicate String constructors and operator=:
StreamString(const char* text = nullptr): String(text), S2Stream(this) { } StreamString(const char* text = nullptr): String(text), S2Stream(this) { }
StreamString(const String& string): String(string), S2Stream(this) { } StreamString(const String& string): String(string), S2Stream(this) { }

View File

@ -410,7 +410,7 @@ size_t UpdaterClass::write(uint8_t *data, size_t len) {
left -= toBuff; left -= toBuff;
if(!_async) yield(); if(!_async) yield();
} }
//lets see whats left //lets see what's left
memcpy(_buffer + _bufferLen, data + (len - left), left); memcpy(_buffer + _bufferLen, data + (len - left), left);
_bufferLen += left; _bufferLen += left;
if(_bufferLen == remaining()){ if(_bufferLen == remaining()){

View File

@ -108,12 +108,12 @@ class UpdaterClass {
bool setMD5(const char * expected_md5); bool setMD5(const char * expected_md5);
/* /*
returns the MD5 String of the sucessfully ended firmware returns the MD5 String of the successfully ended firmware
*/ */
String md5String(void){ return _md5.toString(); } String md5String(void){ return _md5.toString(); }
/* /*
populated the result with the md5 bytes of the sucessfully ended firmware populated the result with the md5 bytes of the successfully ended firmware
*/ */
void md5(uint8_t * result){ return _md5.getBytes(result); } void md5(uint8_t * result){ return _md5.getBytes(result); }

View File

@ -483,7 +483,7 @@ void i2s_set_dividers(uint8_t div1, uint8_t div2) {
i2sc_temp |= (I2STXR); // Hold transmitter in reset i2sc_temp |= (I2STXR); // Hold transmitter in reset
I2SC = i2sc_temp; I2SC = i2sc_temp;
// trans master(active low), recv master(active_low), !bits mod(==16 bits/chanel), clear clock dividers // trans master(active low), recv master(active_low), !bits mod(==16 bits/channel), clear clock dividers
i2sc_temp &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD)); i2sc_temp &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));
// I2SRF = Send/recv right channel first (? may be swapped form I2S spec of WS=0 => left) // I2SRF = Send/recv right channel first (? may be swapped form I2S spec of WS=0 => left)

View File

@ -290,7 +290,7 @@ void init_done() {
know if other features are using this, or if this memory is going to be know if other features are using this, or if this memory is going to be
used in future SDK releases. used in future SDK releases.
WPS beeing flawed by its poor security, or not beeing used by lots of WPS being flawed by its poor security, or not being used by lots of
users, it has been decided that we are still going to use that memory for users, it has been decided that we are still going to use that memory for
user's stack and disable the use of WPS. user's stack and disable the use of WPS.

View File

@ -1,5 +1,5 @@
/* /*
core_esp8266_noniso.c - nonstandard (but usefull) conversion functions core_esp8266_noniso.c - nonstandard (but useful) conversion functions
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment. This file is part of the esp8266 core for Arduino environment.

View File

@ -289,7 +289,7 @@ static const uint8_t ICACHE_FLASH_ATTR phy_init_data[128] =
}; };
// These functions will be overriden from C++ code. // These functions will be overridden from C++ code.
// Unfortunately, we can't use extern "C" because Arduino preprocessor // Unfortunately, we can't use extern "C" because Arduino preprocessor
// doesn't generate forward declarations for extern "C" functions correctly, // doesn't generate forward declarations for extern "C" functions correctly,
// so we use mangled names here. // so we use mangled names here.

View File

@ -56,7 +56,7 @@ _SPICommand(volatile uint32_t spiIfNum,
if (spiIfNum>1) if (spiIfNum>1)
return SPI_RESULT_ERR; return SPI_RESULT_ERR;
// force SPI register access via base+offest. // force SPI register access via base+offset.
// Prevents loading individual address constants from flash. // Prevents loading individual address constants from flash.
uint32_t *spibase = (uint32_t*)(spiIfNum ? &(SPI1CMD) : &(SPI0CMD)); uint32_t *spibase = (uint32_t*)(spiIfNum ? &(SPI1CMD) : &(SPI0CMD));
#define SPIREG(reg) (*((volatile uint32_t *)(spibase+(&(reg) - &(SPI0CMD))))) #define SPIREG(reg) (*((volatile uint32_t *)(spibase+(&(reg) - &(SPI0CMD)))))
@ -141,7 +141,7 @@ _SPICommand(volatile uint32_t spiIfNum,
* data has been sent. * data has been sent.
* *
* Note: This code has only been tested with SPI bus 0, but should work * Note: This code has only been tested with SPI bus 0, but should work
* equally well with other busses. The ESP8266 has bus 0 and 1, * equally well with other buses. The ESP8266 has bus 0 and 1,
* newer chips may have more one day. * newer chips may have more one day.
*/ */
SpiOpResult SPI0Command(uint8_t cmd, uint32_t *data, uint32_t mosi_bits, uint32_t miso_bits) { SpiOpResult SPI0Command(uint8_t cmd, uint32_t *data, uint32_t mosi_bits, uint32_t miso_bits) {

View File

@ -1,4 +1,3 @@
/* /*
core_esp8266_version.h - parse "git describe" at compile time core_esp8266_version.h - parse "git describe" at compile time
Copyright (c) 2018 david gauchard. All rights reserved. Copyright (c) 2018 david gauchard. All rights reserved.
@ -159,7 +158,7 @@ int coreVersionSubRevision ()
} }
/* /*
* unique revision indentifier (never decreases) * unique revision identifier (never decreases)
*/ */
constexpr constexpr
int coreVersionNumeric () int coreVersionNumeric ()

View File

@ -69,8 +69,8 @@ void micros_overflow_tick(void* arg) {
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// millis() 'magic multiplier' approximation // millis() 'magic multiplier' approximation
// //
// This function corrects the cumlative (296us / usec overflow) drift // This function corrects the cumulative (296us / usec overflow) drift
// seen in the orignal 'millis()' function. // seen in the original 'millis()' function.
// //
// Input: // Input:
// 'm' - 32-bit usec counter, 0 <= m <= 0xFFFFFFFF // 'm' - 32-bit usec counter, 0 <= m <= 0xFFFFFFFF

View File

@ -163,7 +163,7 @@ extern volatile uint32_t* const esp8266_gpioToFn[16];
#define TCIS 8 //Interrupt Status #define TCIS 8 //Interrupt Status
#define TCTE 7 //Timer Enable #define TCTE 7 //Timer Enable
#define TCAR 6 //AutoReload (restart timer when condition is reached) #define TCAR 6 //AutoReload (restart timer when condition is reached)
#define TCPD 2 //Prescale Devider (2bit) 0:1(12.5ns/tick), 1:16(0.2us/tick), 2/3:256(3.2us/tick) #define TCPD 2 //Prescale Divider (2bit) 0:1(12.5ns/tick), 1:16(0.2us/tick), 2/3:256(3.2us/tick)
#define TCIT 0 //Interrupt Type 0:edge, 1:level #define TCIT 0 //Interrupt Type 0:edge, 1:level
//RTC Registers //RTC Registers
@ -271,7 +271,7 @@ extern volatile uint32_t* const esp8266_gpioToFn[16];
#define UCRXI 19 //Invert RX #define UCRXI 19 //Invert RX
#define UCTXRST 18 //Reset TX FIFO #define UCTXRST 18 //Reset TX FIFO
#define UCRXRST 17 //Reset RX FIFO #define UCRXRST 17 //Reset RX FIFO
#define UCTXHFE 15 //TX Harware Flow Enable #define UCTXHFE 15 //TX Hardware Flow Enable
#define UCLBE 14 //LoopBack Enable #define UCLBE 14 //LoopBack Enable
#define UCBRK 8 //Send Break on the TX line #define UCBRK 8 //Send Break on the TX line
#define UCSWDTR 7 //Set this bit to assert DTR #define UCSWDTR 7 //Set this bit to assert DTR
@ -283,11 +283,11 @@ extern volatile uint32_t* const esp8266_gpioToFn[16];
//UART CONF1 Registers Bits //UART CONF1 Registers Bits
#define UCTOE 31 //RX TimeOut Enable #define UCTOE 31 //RX TimeOut Enable
#define UCTOT 24 //RX TimeOut Treshold (7bit) #define UCTOT 24 //RX TimeOut Threshold (7bit)
#define UCRXHFE 23 //RX Harware Flow Enable #define UCRXHFE 23 //RX Hardware Flow Enable
#define UCRXHFT 16 //RX Harware Flow Treshold (7bit) #define UCRXHFT 16 //RX Hardware Flow Threshold (7bit)
#define UCFET 8 //TX FIFO Empty Treshold (7bit) #define UCFET 8 //TX FIFO Empty Threshold (7bit)
#define UCFFT 0 //RX FIFO Full Treshold (7bit) #define UCFFT 0 //RX FIFO Full Threshold (7bit)
//WDT Feed (the dog) Register //WDT Feed (the dog) Register
#define WDTFEED ESP8266_REG(0x914) #define WDTFEED ESP8266_REG(0x914)
@ -372,7 +372,7 @@ extern volatile uint32_t* const esp8266_gpioToFn[16];
#define SPI1E3 ESP8266_REG(0x1FC) #define SPI1E3 ESP8266_REG(0x1FC)
#define SPI1W(p) ESP8266_REG(0x140 + ((p & 0xF) * 4)) #define SPI1W(p) ESP8266_REG(0x140 + ((p & 0xF) * 4))
//SPI0, SPI1 & I2S Interupt Register //SPI0, SPI1 & I2S Interrupt Register
#define SPIIR ESP8266_DREG(0x20) #define SPIIR ESP8266_DREG(0x20)
#define SPII0 4 //SPI0 Interrupt #define SPII0 4 //SPI0 Interrupt
#define SPII1 7 //SPI1 Interrupt #define SPII1 7 //SPI1 Interrupt

View File

@ -185,7 +185,7 @@ typedef void (*fn_c_exception_handler_t)(struct __exception_frame *ef, int cause
_xtos_c_handler_table[]. It is present when an exception handler has not been _xtos_c_handler_table[]. It is present when an exception handler has not been
registered. It simply consist of a single instruction, `ret`. registered. It simply consist of a single instruction, `ret`.
It is also internally used by `_xtos_set_exception_handler(cause, NULL)` to It is also internally used by `_xtos_set_exception_handler(cause, NULL)` to
reset a "C" exception handler back to the unhandled state. The coresponding reset a "C" exception handler back to the unhandled state. The corresponding
`_xtos_exc_handler_table` entry will be set to `_xtos_unhandled_exception`. `_xtos_exc_handler_table` entry will be set to `_xtos_unhandled_exception`.
Note, if nesting handlers is desired this must be implemented in the new "C" Note, if nesting handlers is desired this must be implemented in the new "C"
exception handler(s) being registered. exception handler(s) being registered.

View File

@ -47,7 +47,7 @@
* https://github.com/qca/open-ath9k-htc-firmware/blob/master/sboot/magpie_1_1/sboot/athos/src/xtos/exc-sethandler.c * https://github.com/qca/open-ath9k-htc-firmware/blob/master/sboot/magpie_1_1/sboot/athos/src/xtos/exc-sethandler.c
* *
* It has been revised to use Arduino ESP8266 core includes, types, and * It has been revised to use Arduino ESP8266 core includes, types, and
* formating. * formatting.
*/ */
/* exc-sethandler.c - register an exception handler in XTOS */ /* exc-sethandler.c - register an exception handler in XTOS */

View File

@ -27,7 +27,7 @@ extern "C" {
* @brief Initialize GDB stub, if present * @brief Initialize GDB stub, if present
* *
* By default, this function is a no-op. When GDBStub library is linked, * By default, this function is a no-op. When GDBStub library is linked,
* this function is overriden and does necessary initialization of that library. * this function is overridden and does necessary initialization of that library.
* Called early at startup. * Called early at startup.
*/ */
void gdb_init(void); void gdb_init(void);
@ -36,7 +36,7 @@ void gdb_init(void);
* @brief Break into GDB, if present * @brief Break into GDB, if present
* *
* By default, this function is a no-op. When GDBStub library is linked, * By default, this function is a no-op. When GDBStub library is linked,
* this function is overriden and triggers entry into the debugger, which * this function is overridden and triggers entry into the debugger, which
* looks like a breakpoint hit. * looks like a breakpoint hit.
*/ */
void gdb_do_break(void); void gdb_do_break(void);
@ -45,7 +45,7 @@ void gdb_do_break(void);
* @brief Check if GDB stub is present. * @brief Check if GDB stub is present.
* *
* By default, this function returns false. When GDBStub library is linked, * By default, this function returns false. When GDBStub library is linked,
* this function is overriden and returns true. Can be used to check whether * this function is overridden and returns true. Can be used to check whether
* GDB is used. * GDB is used.
* *
* @return true if GDB stub is present * @return true if GDB stub is present
@ -58,7 +58,7 @@ bool gdb_present(void);
* @brief Check if GDB is installing a putc1 callback. * @brief Check if GDB is installing a putc1 callback.
* *
* By default, this function returns false. When GDBStub library is linked, * By default, this function returns false. When GDBStub library is linked,
* this function is overriden and returns true. * this function is overridden and returns true.
* *
* @return true if GDB is installing a putc1 callback * @return true if GDB is installing a putc1 callback
*/ */
@ -69,7 +69,7 @@ bool gdbstub_has_putc1_control(void);
* @param func function GDB will proxy putc1 data to * @param func function GDB will proxy putc1 data to
* *
* By default, this function is a no-op. When GDBStub library is linked, * By default, this function is a no-op. When GDBStub library is linked,
* this function is overriden and sets GDB stub's secondary putc1 callback to * this function is overridden and sets GDB stub's secondary putc1 callback to
* func. When GDB stub is linked, but a GDB session is not current attached, * func. When GDB stub is linked, but a GDB session is not current attached,
* then GDB stub will pass putc1 chars directly to this function. * then GDB stub will pass putc1 chars directly to this function.
*/ */
@ -79,7 +79,7 @@ void gdbstub_set_putc1_callback(void (*func)(char));
* @brief Check if GDB is installing a uart0 isr callback. * @brief Check if GDB is installing a uart0 isr callback.
* *
* By default, this function returns false. When GDBStub library is linked, * By default, this function returns false. When GDBStub library is linked,
* this function is overriden and returns true. * this function is overridden and returns true.
* *
* @return true if GDB is installing a uart0 isr callback * @return true if GDB is installing a uart0 isr callback
*/ */
@ -90,7 +90,7 @@ bool gdbstub_has_uart_isr_control(void);
* @param func function GDB will proxy uart0 isr data to * @param func function GDB will proxy uart0 isr data to
* *
* By default, this function is a no-op. When GDBStub library is linked, * By default, this function is a no-op. When GDBStub library is linked,
* this function is overriden and sets GDB stub's secondary uart0 isr callback * this function is overridden and sets GDB stub's secondary uart0 isr callback
* to func. When GDB stub is linked, but a GDB session is not current attached, * to func. When GDB stub is linked, but a GDB session is not current attached,
* then GDB stub will pass uart0 isr data back to this function. * then GDB stub will pass uart0 isr data back to this function.
*/ */
@ -101,7 +101,7 @@ void gdbstub_set_uart_isr_callback(void (*func)(void*, uint8_t), void* arg);
* @param c character to write * @param c character to write
* *
* By default, this function is a no-op. When GDBStub library is linked, * By default, this function is a no-op. When GDBStub library is linked,
* this function is overriden and writes a char to either the GDB session on * this function is overridden and writes a char to either the GDB session on
* uart0 or directly to uart0 if not GDB session is attached. * uart0 or directly to uart0 if not GDB session is attached.
*/ */
void gdbstub_write_char(char c); void gdbstub_write_char(char c);
@ -112,7 +112,7 @@ void gdbstub_write_char(char c);
* @param size length of buffer * @param size length of buffer
* *
* By default, this function is a no-op. When GDBStub library is linked, * By default, this function is a no-op. When GDBStub library is linked,
* this function is overriden and writes a buffer to either the GDB session on * this function is overridden and writes a buffer to either the GDB session on
* uart0 or directly to uart0 if not GDB session is attached. * uart0 or directly to uart0 if not GDB session is attached.
*/ */
void gdbstub_write(const char* buf, size_t size); void gdbstub_write(const char* buf, size_t size);

View File

@ -42,7 +42,7 @@ extern "C" {
#define UMM_REALLOC_FL(p,s,f,l) realloc(p,s) #define UMM_REALLOC_FL(p,s,f,l) realloc(p,s)
#define UMM_FREE_FL(p,f,l) free(p) #define UMM_FREE_FL(p,f,l) free(p)
// STATIC_ALWAYS_INLINE only applys to the non-debug build path, // STATIC_ALWAYS_INLINE only applies to the non-debug build path,
// it must not be enabled on the debug build path. // it must not be enabled on the debug build path.
#define STATIC_ALWAYS_INLINE static ALWAYS_INLINE #define STATIC_ALWAYS_INLINE static ALWAYS_INLINE
#endif #endif
@ -226,10 +226,10 @@ void IRAM_ATTR print_oom_size(size_t size)
b. Before, when the *alloc function creates a new, not modified, allocation. b. Before, when the *alloc function creates a new, not modified, allocation.
In a free() or realloc() call, the focus is on their allocation. It is In a free() or realloc() call, the focus is on their allocation. It is
checked 1st and reported on 1ST if an error exists. Full Posion Check is checked 1st and reported on 1ST if an error exists. Full Poison Check is
done after. done after.
For malloc(), calloc(), and zalloc() Full Posion Check is done 1st since For malloc(), calloc(), and zalloc() Full Poison Check is done 1st since
these functions do not modify an existing allocation. these functions do not modify an existing allocation.
*/ */
void* IRAM_ATTR malloc(size_t size) void* IRAM_ATTR malloc(size_t size)

View File

@ -376,7 +376,7 @@ extern hwdt_info_t hwdt_info;
#undef hwdt_info_ #undef hwdt_info_
#undef hwdt_info #undef hwdt_info
#undef HWDT_VERIFY_HWDT_INFO #undef HWDT_VERIFY_HWDT_INFO
static_assert(sizeof(hwdt_info_t) == sizeof(LOCAL_HWDT_INFO_T), "Local and include verison of hwdt_info_t do not match."); static_assert(sizeof(hwdt_info_t) == sizeof(LOCAL_HWDT_INFO_T), "Local and include version of hwdt_info_t do not match.");
#endif #endif
@ -411,7 +411,7 @@ static_assert(sizeof(hwdt_info_t) == sizeof(LOCAL_HWDT_INFO_T), "Local and inclu
#define CONT_STACK_A16_SZ (MK_ALIGN16_SZ(sizeof(cont_t))) #define CONT_STACK_A16_SZ (MK_ALIGN16_SZ(sizeof(cont_t)))
/* /*
* For WPS support, cont stack comes out of the user's heap address space. * For WPS support, cont stack comes out of the user's heap address space.
* The the NONOS-SDK stack address is initialized before tbe reserved ROM stack * The NONOS-SDK stack address is initialized before the reserved ROM stack
* space. In this configuration there is no extra 4K in the heap. * space. In this configuration there is no extra 4K in the heap.
* Memory map: 0x3FFE8000, ..., (CONT_STACK), ..., (SYS), (ROM_STACK), 0x4000000 * Memory map: 0x3FFE8000, ..., (CONT_STACK), ..., (SYS), (ROM_STACK), 0x4000000
* *
@ -764,8 +764,8 @@ void adjust_uart_speed(uint32_t uart_divisor) {
* stablilize, and let the remote receiver come to an idle state before * stablilize, and let the remote receiver come to an idle state before
* continuing. * continuing.
* *
* Load a Rubout character for the final charcter shifting out to stop * Load a Rubout character for the final character shifting out to stop
* the last charcter from getting crunched during the speed change. * the last character from getting crunched during the speed change.
* *
* The thinking is if the speed changes while shifting out, as long as the * The thinking is if the speed changes while shifting out, as long as the
* start bit gets out before the change. The change will not be noticed * start bit gets out before the change. The change will not be noticed

View File

@ -3,7 +3,7 @@
#include <Arduino.h> #include <Arduino.h>
// these auto classes wrap up xt_rsil so your code can be simplier, but can only be // these auto classes wrap up xt_rsil so your code can be simpler, but can only be
// used in an ino or cpp files. // used in an ino or cpp files.
// InterruptLock is used when you want to completely disable interrupts // InterruptLock is used when you want to completely disable interrupts

View File

@ -80,7 +80,7 @@ extern "C" {
* *
* "Cache_Read_Enable" is underdocumented. Main sources of information were from * "Cache_Read_Enable" is underdocumented. Main sources of information were from
* rboot, zboot, https://richard.burtons.org/2015/06/12/esp8266-cache_read_enable/, * rboot, zboot, https://richard.burtons.org/2015/06/12/esp8266-cache_read_enable/,
* and other places. And some additional expermentation. * and other places. And some additional experimentation.
* *
* Searching through the NONOS SDK shows nothing on this API; however, some * Searching through the NONOS SDK shows nothing on this API; however, some
* clues on what the NONOS SDK might be doing with ICACHE related calls can be * clues on what the NONOS SDK might be doing with ICACHE related calls can be

View File

@ -122,7 +122,7 @@ bool mmu_is_icache(const void *addr) {
/* /*
* Some inlines to allow faster random access to non32bit access of iRAM or * Some inlines to allow faster random access to non32bit access of iRAM or
* iCACHE data elements. These remove the extra time and stack space that would * iCACHE data elements. These remove the extra time and stack space that would
* have occured by relying on exception processing. * have occurred by relying on exception processing.
*/ */
static inline __attribute__((always_inline)) static inline __attribute__((always_inline))
uint8_t mmu_get_uint8(const void *p8) { uint8_t mmu_get_uint8(const void *p8) {

View File

@ -19,10 +19,10 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
This implementation is based on the original implementation of the ROM. This implementation is based on the original implementation of the ROM.
It was shortend to reduce the memory usage. The complete version and the It was shortened to reduce the memory usage. The complete version and the
development history can be found in: development history can be found in:
https://github.com/twischer/Arduino/tree/reboot_uart_download_full https://github.com/twischer/Arduino/tree/reboot_uart_download_full
This might be usefull in case of issues. This might be useful in case of issues.
*/ */
#include "reboot_uart_dwnld.h" #include "reboot_uart_dwnld.h"
#include <stdnoreturn.h> #include <stdnoreturn.h>

View File

@ -113,7 +113,7 @@ Choosing the page size for the system involves many factors:
- How fast must spiffs be - How fast must spiffs be
- Other things impossible to find out - Other things impossible to find out
So, chosing the Optimal Page Size (tm) seems tricky, to say the least. Don't So, choosing the Optimal Page Size (tm) seems tricky, to say the least. Don't
fret - there is no optimal page size. This varies from how the target will use fret - there is no optimal page size. This varies from how the target will use
spiffs. Use the golden rule: spiffs. Use the golden rule:

View File

@ -695,7 +695,7 @@ s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh);
* in this callback will mess things up for sure - do not do this. * in this callback will mess things up for sure - do not do this.
* This can be used to track where files are and move around during garbage * This can be used to track where files are and move around during garbage
* collection, which in turn can be used to build location tables in ram. * collection, which in turn can be used to build location tables in ram.
* Used in conjuction with SPIFFS_open_by_page this may improve performance * Used in conjunction with SPIFFS_open_by_page this may improve performance
* when opening a lot of files. * when opening a lot of files.
* Must be invoked after mount. * Must be invoked after mount.
* *
@ -710,7 +710,7 @@ s32_t SPIFFS_set_file_callback_func(spiffs *fs, spiffs_file_callback cb_func);
* Maps the first level index lookup to a given memory map. * Maps the first level index lookup to a given memory map.
* This will make reading big files faster, as the memory map will be used for * This will make reading big files faster, as the memory map will be used for
* looking up data pages instead of searching for the indices on the physical * looking up data pages instead of searching for the indices on the physical
* medium. When mapping, all affected indicies are found and the information is * medium. When mapping, all affected indices are found and the information is
* copied to the array. * copied to the array.
* Whole file or only parts of it may be mapped. The index map will cover file * Whole file or only parts of it may be mapped. The index map will cover file
* contents from argument offset until and including arguments (offset+len). * contents from argument offset until and including arguments (offset+len).

View File

@ -353,7 +353,7 @@ extern "C" {
if ((ph).span_ix != (spix)) return SPIFFS_ERR_DATA_SPAN_MISMATCH; if ((ph).span_ix != (spix)) return SPIFFS_ERR_DATA_SPAN_MISMATCH;
// check id, only visit matching objec ids // check id, only visit matching object ids
#define SPIFFS_VIS_CHECK_ID (1<<0) #define SPIFFS_VIS_CHECK_ID (1<<0)
// report argument object id to visitor - else object lookup id is reported // report argument object id to visitor - else object lookup id is reported
#define SPIFFS_VIS_CHECK_PH (1<<1) #define SPIFFS_VIS_CHECK_PH (1<<1)

View File

@ -1,5 +1,5 @@
/* /*
stdlib_noniso.h - nonstandard (but usefull) conversion functions stdlib_noniso.h - nonstandard (but useful) conversion functions
Copyright (c) 2021 David Gauchard. All rights reserved. Copyright (c) 2021 David Gauchard. All rights reserved.
This file is part of the esp8266 core for Arduino environment. This file is part of the esp8266 core for Arduino environment.

View File

@ -1,5 +1,5 @@
/* /*
stdlib_noniso.h - nonstandard (but usefull) conversion functions stdlib_noniso.h - nonstandard (but useful) conversion functions
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment. This file is part of the esp8266 core for Arduino environment.

View File

@ -126,7 +126,7 @@ later.
The result is that a block of memory on the free list uses just 8 bytes The result is that a block of memory on the free list uses just 8 bytes
instead of 16. instead of 16.
In fact, we go even one step futher when we realize that the free block In fact, we go even one step further when we realize that the free block
index values are available to store data when the block is allocated. index values are available to store data when the block is allocated.
The overhead of an allocated block is therefore just 4 bytes. The overhead of an allocated block is therefore just 4 bytes.
@ -205,7 +205,7 @@ described.
allocated for use by the upper block. allocated for use by the upper block.
While we're talking about "upper" and "lower" blocks, we should make While we're talking about "upper" and "lower" blocks, we should make
a comment about adresses. In the diagrams, a block higher up in the a comment about addresses. In the diagrams, a block higher up in the
picture is at a lower address. And the blocks grow downwards their picture is at a lower address. And the blocks grow downwards their
block index increases as does their physical address. block index increases as does their physical address.
@ -347,7 +347,7 @@ nf |*?? | ?? | ?? | cf | nf | ?? | ?? | ?? | pf |
``` ```
This one is prety easy too, except we don't need to mess with the This one is prety easy too, except we don't need to mess with the
free list indexes at all becasue we'll allocate the new block at the free list indexes at all because we'll allocate the new block at the
end of the current free block. We do, however have to adjust the end of the current free block. We do, however have to adjust the
indexes in cf, c, and n. indexes in cf, c, and n.
@ -539,5 +539,5 @@ BEFORE AFTER
+----+----+----+----+ +----+----+----+----+ +----+----+----+----+ +----+----+----+----+
``` ```
Then we call free() with the adress of the data portion of the new Then we call free() with the address of the data portion of the new
block (s) which adds it to the free list. block (s) which adds it to the free list.

View File

@ -13,7 +13,7 @@
* to set the trace level #define DBGLOG_LEVEL x * to set the trace level #define DBGLOG_LEVEL x
* *
* To update which of the DBGLOG macros are compiled in, you must redefine the * To update which of the DBGLOG macros are compiled in, you must redefine the
* DBGLOG_LEVEL macro and the inlcude the dbglog.h file again, like this: * DBGLOG_LEVEL macro and the include the dbglog.h file again, like this:
* *
* #undef DBGLOG_LEVEL * #undef DBGLOG_LEVEL
* #define DBGLOG_LEVEL 6 * #define DBGLOG_LEVEL 6

View File

@ -7,7 +7,7 @@
#define ALWAYS_INLINE inline __attribute__ ((always_inline)) #define ALWAYS_INLINE inline __attribute__ ((always_inline))
#endif #endif
// Use FORCE_ALWAYS_INLINE to ensure HeapSelect... construtor/deconstructor // Use FORCE_ALWAYS_INLINE to ensure HeapSelect... constructor/deconstructor
// are placed in IRAM // are placed in IRAM
#ifdef FORCE_ALWAYS_INLINE_HEAP_SELECT #ifdef FORCE_ALWAYS_INLINE_HEAP_SELECT
#define MAYBE_ALWAYS_INLINE ALWAYS_INLINE #define MAYBE_ALWAYS_INLINE ALWAYS_INLINE

View File

@ -197,7 +197,7 @@ size_t umm_max_block_size( void ) {
/* /*
Without build option UMM_INLINE_METRICS, calls to umm_usage_metric() or Without build option UMM_INLINE_METRICS, calls to umm_usage_metric() or
umm_fragmentation_metric() must to be preceeded by a call to umm_info(NULL, false) umm_fragmentation_metric() must to be preceded by a call to umm_info(NULL, false)
for updated results. for updated results.
*/ */
int umm_usage_metric_core( umm_heap_context_t *_context ) { int umm_usage_metric_core( umm_heap_context_t *_context ) {

View File

@ -6,7 +6,7 @@
#if defined(UMM_CRITICAL_METRICS) #if defined(UMM_CRITICAL_METRICS)
/* /*
* umm_malloc performance measurments for critical sections * umm_malloc performance measurements for critical sections
*/ */
UMM_TIME_STATS time_stats = { UMM_TIME_STATS time_stats = {
{0xFFFFFFFF, 0U, 0U, 0U}, {0xFFFFFFFF, 0U, 0U, 0U},

View File

@ -585,7 +585,7 @@ void umm_free( void *ptr ) {
return; return;
} }
/* Free the memory withing a protected critical section */ /* Free the memory within a protected critical section */
UMM_CRITICAL_ENTRY(id_free); UMM_CRITICAL_ENTRY(id_free);
@ -671,7 +671,7 @@ static void *umm_malloc_core( umm_heap_context_t *_context, size_t size ) {
*/ */
if( blockSize == blocks ) { if( blockSize == blocks ) {
/* It's an exact fit and we don't neet to split off a block. */ /* It's an exact fit and we don't need to split off a block. */
DBGLOG_DEBUG( "Allocating %6d blocks starting at %6d - exact\n", blocks, cf ); DBGLOG_DEBUG( "Allocating %6d blocks starting at %6d - exact\n", blocks, cf );
/* Disconnect this block from the FREE list */ /* Disconnect this block from the FREE list */
@ -755,7 +755,7 @@ void *umm_malloc( size_t size ) {
* For allocating APIs `umm_heap_cur` is used to index and select a value for * For allocating APIs `umm_heap_cur` is used to index and select a value for
* `_context`. If an allocation is made from an ISR, this value is ignored and * `_context`. If an allocation is made from an ISR, this value is ignored and
* the heap context for DRAM is loaded. For APIs that require operating on an * the heap context for DRAM is loaded. For APIs that require operating on an
* existing allcation such as realloc and free, the heap context selected is * existing allocation such as realloc and free, the heap context selected is
* done by matching the allocation's address with that of one of the heap * done by matching the allocation's address with that of one of the heap
* address ranges. * address ranges.
* *
@ -798,7 +798,7 @@ void *umm_malloc( size_t size ) {
return( ptr ); return( ptr );
} }
/* Allocate the memory withing a protected critical section */ /* Allocate the memory within a protected critical section */
UMM_CRITICAL_ENTRY(id_malloc); UMM_CRITICAL_ENTRY(id_malloc);

View File

@ -564,7 +564,7 @@ static inline void _critical_exit(UMM_TIME_STAT *p, uint32_t *saved_ps) {
* direction of the beginning of the heap when possible. * direction of the beginning of the heap when possible.
* *
* Status: TODO: These are new options introduced to optionally restore the * Status: TODO: These are new options introduced to optionally restore the
* previous defrag propery of realloc. The issue has been raised in the upstream * previous defrag property of realloc. The issue has been raised in the upstream
* repo. No response at this time. Based on response, may propose for upstream. * repo. No response at this time. Based on response, may propose for upstream.
*/ */
/* /*
@ -796,7 +796,7 @@ extern "C" {
// Arduino.h recall us to redefine them // Arduino.h recall us to redefine them
#include <pgmspace.h> #include <pgmspace.h>
// Reuse pvPort* calls, since they already support passing location information. // Reuse pvPort* calls, since they already support passing location information.
// Specificly the debug version (heap_...) that does not force DRAM heap. // Specifically the debug version (heap_...) that does not force DRAM heap.
void* IRAM_ATTR heap_pvPortMalloc(size_t size, const char* file, int line); void* IRAM_ATTR heap_pvPortMalloc(size_t size, const char* file, int line);
void* IRAM_ATTR heap_pvPortCalloc(size_t count, size_t size, const char* file, int line); void* IRAM_ATTR heap_pvPortCalloc(size_t count, size_t size, const char* file, int line);
void* IRAM_ATTR heap_pvPortRealloc(void *ptr, size_t size, const char* file, int line); void* IRAM_ATTR heap_pvPortRealloc(void *ptr, size_t size, const char* file, int line);

View File

@ -54,7 +54,7 @@
* stack frame is limited to 128 bytes (currently at 64). * stack frame is limited to 128 bytes (currently at 64).
*/ */
STRUCT_BEGIN STRUCT_BEGIN
STRUCT_FIELD (long,4,KEXC_,pc) /* "parm" */ STRUCT_FIELD (long,4,KEXC_,pc) /* "param" */
STRUCT_FIELD (long,4,KEXC_,ps) STRUCT_FIELD (long,4,KEXC_,ps)
STRUCT_AFIELD(long,4,KEXC_,areg, 4) /* a12 .. a15 */ STRUCT_AFIELD(long,4,KEXC_,areg, 4) /* a12 .. a15 */
STRUCT_FIELD (long,4,KEXC_,sar) /* "save" */ STRUCT_FIELD (long,4,KEXC_,sar) /* "save" */

View File

@ -5,7 +5,7 @@ Intro
----- -----
PROGMEM is a Arduino AVR feature that has been ported to ESP8266 to PROGMEM is a Arduino AVR feature that has been ported to ESP8266 to
ensure compatability with existing Arduino libraries, as well as, saving ensure compatibility with existing Arduino libraries, as well as, saving
RAM. On the esp8266 declaring a string such as ``const char * xyz = RAM. On the esp8266 declaring a string such as ``const char * xyz =
"this is a string"`` will place this string in RAM, not flash. It is "this is a string"`` will place this string in RAM, not flash. It is
possible to place a String into flash, and then load it into RAM when possible to place a String into flash, and then load it into RAM when
@ -283,7 +283,7 @@ generate as they are basically ``const char *``. On the other hand
conversions from, very useful when overloading functions, and doing conversions from, very useful when overloading functions, and doing
implicit type conversions. It is worth adding that if you wish to store implicit type conversions. It is worth adding that if you wish to store
an ``int``, ``float`` or pointer these can be stored and read back an ``int``, ``float`` or pointer these can be stored and read back
directly as they are 4 bytes in size and therefor will be always directly as they are 4 bytes in size and therefore will be always
aligned! aligned!
Hope this helps. Hope this helps.

View File

@ -44,8 +44,8 @@ Usage
5. Check the Serial Output 5. Check the Serial Output
Informations Information
------------ -----------
It work with every sketch that enables the Serial interface that is It work with every sketch that enables the Serial interface that is
selected as debug port. selected as debug port.

View File

@ -51,7 +51,7 @@ Example:
<<<stack<<< <<<stack<<<
The first number after ``Exception`` gives the cause of the reset. a The first number after ``Exception`` gives the cause of the reset. a
full ist of all causes can be found `here <../exception_causes.rst>`__ full list of all causes can be found `here <../exception_causes.rst>`__
the hex after are the stack dump. the hex after are the stack dump.
Decode Decode

View File

@ -6,13 +6,13 @@ Generic ESP8266 Module
These modules come in different form factors and pinouts. See the page at ESP8266 community wiki for more info: `ESP8266 Module Family <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`__. These modules come in different form factors and pinouts. See the page at ESP8266 community wiki for more info: `ESP8266 Module Family <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`__.
Usually these modules have no bootstapping resistors on board, insufficient decoupling capacitors, no voltage regulator, no reset circuit, and no USB-serial adapter. This makes using them somewhat tricky, compared to development boards which add these features. Usually these modules have no bootstrapping resistors on board, insufficient decoupling capacitors, no voltage regulator, no reset circuit, and no USB-serial adapter. This makes using them somewhat tricky, compared to development boards which add these features.
In order to use these modules, make sure to observe the following: In order to use these modules, make sure to observe the following:
- **Provide sufficient power to the module.** For stable use of the ESP8266 a power supply with 3.3V and >= 250mA is required. Using the power available from USB to Serial adapter is not recommended, these adapters typically do not supply enough current to run ESP8266 reliably in every situation. An external supply or regulator alongwith filtering capacitors is preferred. - **Provide sufficient power to the module.** For stable use of the ESP8266 a power supply with 3.3V and >= 250mA is required. Using the power available from USB to Serial adapter is not recommended, these adapters typically do not supply enough current to run ESP8266 reliably in every situation. An external supply or regulator alongwith filtering capacitors is preferred.
- **Connect bootstapping resistors** to GPIO0, GPIO2, GPIO15 according to the schematics below. - **Connect bootstrapping resistors** to GPIO0, GPIO2, GPIO15 according to the schematics below.
- **Put ESP8266 into bootloader mode** before uploading code. - **Put ESP8266 into bootloader mode** before uploading code.

View File

@ -31,8 +31,8 @@ example private hardware path
Windows: C:\Users\[username]\AppData\Roaming\Arduino15\packages\esp8266\hardware Windows: C:\Users\[username]\AppData\Roaming\Arduino15\packages\esp8266\hardware
Linux: /home/[username]/.arduino15/packages/esp8266/hardware Linux: /home/[username]/.arduino15/packages/esp8266/hardware
Eclipse wont build Eclipse won't build
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
if eclipse dont find the path to the Compiler add to the platform.txt if eclipse dont find the path to the Compiler add to the platform.txt
after: after:

View File

@ -36,7 +36,7 @@ Sets an elliptic curve certificate and key for the server. Needs to be called b
Client sessions (Resuming connections fast) Client sessions (Resuming connections fast)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The TLS handshake process takes a long time because of all the back and forth between the client and the server. You can shorten it by caching the clients' sessions which will skip a few steps in the TLS handshake. In order for this to work, your client also needs to cache the session. `BearSSL::WiFiClientSecure <bearssl-client-secure-class.rst#sessions-resuming-connections-fast>`__ can do that as well as modern web browers. The TLS handshake process takes a long time because of all the back and forth between the client and the server. You can shorten it by caching the clients' sessions which will skip a few steps in the TLS handshake. In order for this to work, your client also needs to cache the session. `BearSSL::WiFiClientSecure <bearssl-client-secure-class.rst#sessions-resuming-connections-fast>`__ can do that as well as modern web browsers.
Here are the kind of performance improvements that you'll be able to see for TLS handshakes with an ESP8266 with it's clock set at 160MHz on a network with fairly low latency: Here are the kind of performance improvements that you'll be able to see for TLS handshakes with an ESP8266 with it's clock set at 160MHz on a network with fairly low latency:

View File

@ -47,7 +47,7 @@ and WiFi does not start automatically at boot** (see PR `#7902 <https://github.c
Previously, SDK was automatically starting WiFi at boot. This was probably Previously, SDK was automatically starting WiFi at boot. This was probably
intended for the Espressif AT FW which is interactive and preserves WiFi intended for the Espressif AT FW which is interactive and preserves WiFi
state accross reboots. This behavior is generally irrelevant with the state across reboots. This behavior is generally irrelevant with the
Arduino API because sketches start with ``WiFi.begin()`` or Arduino API because sketches start with ``WiFi.begin()`` or
``WiFi.softAP()``. ``WiFi.softAP()``.

View File

@ -127,7 +127,7 @@ when updgrading core versions.
SPIFFS file system limitations SPIFFS file system limitations
------------------------------ ------------------------------
The SPIFFS implementation for ESP8266 had to accomodate the The SPIFFS implementation for ESP8266 had to accommodate the
constraints of the chip, among which its limited RAM. constraints of the chip, among which its limited RAM.
`SPIFFS <https://github.com/pellepl/spiffs>`__ was selected because it `SPIFFS <https://github.com/pellepl/spiffs>`__ was selected because it
is designed for small systems, but that comes at the cost of some is designed for small systems, but that comes at the cost of some

View File

@ -172,7 +172,7 @@ Libraries that don't rely on low-level access to AVR registers should work well.
- `RTC <https://github.com/Makuna/Rtc>`__ - Arduino Library for Ds1307 & Ds3231 compatible with ESP8266. - `RTC <https://github.com/Makuna/Rtc>`__ - Arduino Library for Ds1307 & Ds3231 compatible with ESP8266.
- `Souliss, Smart Home <https://github.com/souliss/souliss>`__ - Framework for Smart Home based on Arduino, Android and openHAB. - `Souliss, Smart Home <https://github.com/souliss/souliss>`__ - Framework for Smart Home based on Arduino, Android and openHAB.
- `ST7735 <https://github.com/nzmichaelh/Adafruit-ST7735-Library>`__ - Adafruit's ST7735 library modified to be compatible with ESP8266. Just make sure to modify the pins in the examples as they are still AVR specific. - `ST7735 <https://github.com/nzmichaelh/Adafruit-ST7735-Library>`__ - Adafruit's ST7735 library modified to be compatible with ESP8266. Just make sure to modify the pins in the examples as they are still AVR specific.
- `Task <https://github.com/Makuna/Task>`__ - Arduino Nonpreemptive multitasking library. While similiar to the included Ticker library in the functionality provided, this library was meant for cross Arduino compatibility. - `Task <https://github.com/Makuna/Task>`__ - Arduino Nonpreemptive multitasking library. While similar to the included Ticker library in the functionality provided, this library was meant for cross Arduino compatibility.
- `TickerScheduler <https://github.com/Toshik/TickerScheduler>`__ - Library provides simple scheduler for ``Ticker`` to avoid WDT reset - `TickerScheduler <https://github.com/Toshik/TickerScheduler>`__ - Library provides simple scheduler for ``Ticker`` to avoid WDT reset
- `Teleinfo <https://github.com/hallard/LibTeleinfo>`__ - Generic French Power Meter library to read Teleinfo energy monitoring data such as consuption, contract, power, period, ... This library is cross platform, ESP8266, Arduino, Particle, and simple C++. French dedicated `post <https://hallard.me/libteleinfo/>`__ on author's blog and all related information about `Teleinfo <https://hallard.me/category/tinfo/>`__ also available. - `Teleinfo <https://github.com/hallard/LibTeleinfo>`__ - Generic French Power Meter library to read Teleinfo energy monitoring data such as consuption, contract, power, period, ... This library is cross platform, ESP8266, Arduino, Particle, and simple C++. French dedicated `post <https://hallard.me/libteleinfo/>`__ on author's blog and all related information about `Teleinfo <https://hallard.me/category/tinfo/>`__ also available.
- `UTFT-ESP8266 <https://github.com/gnulabis/UTFT-ESP8266>`__ - UTFT display library with support for ESP8266. Only serial interface (SPI) displays are supported for now (no 8-bit parallel mode, etc). Also includes support for the hardware SPI controller of the ESP8266. - `UTFT-ESP8266 <https://github.com/gnulabis/UTFT-ESP8266>`__ - UTFT display library with support for ESP8266. Only serial interface (SPI) displays are supported for now (no 8-bit parallel mode, etc). Also includes support for the hardware SPI controller of the ESP8266.

View File

@ -50,7 +50,7 @@ Signed updates are updates whose compiled binaries are signed with a private key
Cryptographic signing only protects against tampering with binaries delivered via OTA. If someone has physical access, they will always be able to flash the device over the serial port. Signing also does not encrypt anything but the hash (so that it can't be modified), so this does not protect code inside the device: if a user has physical access they can read out your program. Cryptographic signing only protects against tampering with binaries delivered via OTA. If someone has physical access, they will always be able to flash the device over the serial port. Signing also does not encrypt anything but the hash (so that it can't be modified), so this does not protect code inside the device: if a user has physical access they can read out your program.
**Securing your private key is paramount. The same private/public keypair that was used with the original upload must also be used to sign later binaries. Loss of the private key associated with a binary means that you will not be able to OTA-update any of your devices in the field. Alternatively, if someone else copies the private key, then they will be able to use it to sign binaries which will be accepted by the ESP.** **Securing your private key is paramount. The same private/public key pair that was used with the original upload must also be used to sign later binaries. Loss of the private key associated with a binary means that you will not be able to OTA-update any of your devices in the field. Alternatively, if someone else copies the private key, then they will be able to use it to sign binaries which will be accepted by the ESP.**
Signed Binary Format Signed Binary Format
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
@ -68,7 +68,7 @@ Signed Binary Prerequisites
OpenSSL is required to run the standard signing steps, and should be available on any UNIX-like or Windows system. As usual, the latest stable version of OpenSSL is recommended. OpenSSL is required to run the standard signing steps, and should be available on any UNIX-like or Windows system. As usual, the latest stable version of OpenSSL is recommended.
Signing requires the generation of an RSA-2048 key (other bit lengths are supported as well, but 2048 is a good selection today) using any appropriate tool. The following shell commands will generate a new public/private keypair. Run them in the sketch directory: Signing requires the generation of an RSA-2048 key (other bit lengths are supported as well, but 2048 is a good selection today) using any appropriate tool. The following shell commands will generate a new public/private key pair. Run them in the sketch directory:
.. code:: bash .. code:: bash

View File

@ -362,7 +362,7 @@ Arduino API
} }
} }
One will notice that in the network to serial direction, data are transfered One will notice that in the network to serial direction, data are transferred
byte by byte while data are available. In the other direction, a temporary byte by byte while data are available. In the other direction, a temporary
buffer is created on stack, filled with available serial data, then buffer is created on stack, filled with available serial data, then
transferred to network. transferred to network.

View File

@ -33,7 +33,7 @@ struct DNSHeader
uint16_t ID; // identification number uint16_t ID; // identification number
unsigned char RD : 1; // recursion desired unsigned char RD : 1; // recursion desired
unsigned char TC : 1; // truncated message unsigned char TC : 1; // truncated message
unsigned char AA : 1; // authoritive answer unsigned char AA : 1; // authoritative answer
unsigned char OPCode : 4; // message_type unsigned char OPCode : 4; // message_type
unsigned char QR : 1; // query/response flag unsigned char QR : 1; // query/response flag
unsigned char RCode : 4; // response code unsigned char RCode : 4; // response code

View File

@ -189,7 +189,7 @@ void ESP8266AVRISP::get_parameter(uint8_t c) {
} }
void ESP8266AVRISP::set_parameters() { void ESP8266AVRISP::set_parameters() {
// call this after reading paramter packet into buff[] // call this after reading parameter packet into buff[]
param.devicecode = buff[0]; param.devicecode = buff[0];
param.revision = buff[1]; param.revision = buff[1];
param.progtype = buff[2]; param.progtype = buff[2];

View File

@ -57,7 +57,7 @@ void loop() {
// file found at server // file found at server
if (httpCode == HTTP_CODE_OK) { if (httpCode == HTTP_CODE_OK) {
// get lenght of document (is -1 when Server sends no Content-Length header) // get length of document (is -1 when Server sends no Content-Length header)
int len = http.getSize(); int len = http.getSize();
// create buffer for read // create buffer for read

View File

@ -68,7 +68,7 @@ void loop() {
// file found at server // file found at server
if (httpCode == HTTP_CODE_OK) { if (httpCode == HTTP_CODE_OK) {
// get lenght of document (is -1 when Server sends no Content-Length header) // get length of document (is -1 when Server sends no Content-Length header)
int len = https.getSize(); int len = https.getSize();
// create buffer for read // create buffer for read

View File

@ -321,7 +321,7 @@ bool HTTPClient::setURL(const String& url)
} }
/** /**
* set redirect follow mode. See `followRedirects_t` enum for avaliable modes. * set redirect follow mode. See `followRedirects_t` enum for available modes.
* @param follow * @param follow
*/ */
void HTTPClient::setFollowRedirects(followRedirects_t follow) void HTTPClient::setFollowRedirects(followRedirects_t follow)
@ -481,7 +481,7 @@ int HTTPClient::sendRequest(const char * type, const uint8_t * payload, size_t s
// no redirection // no redirection
break; break;
} }
// redirect using the same request method and payload, diffrent URL // redirect using the same request method and payload, different URL
redirect = true; redirect = true;
} }
break; break;
@ -703,7 +703,7 @@ const String& HTTPClient::getString(void)
_payload.reset(new StreamString()); _payload.reset(new StreamString());
if(_size > 0) { if(_size > 0) {
// try to reserve needed memmory // try to reserve needed memory
if(!_payload->reserve((_size + 1))) { if(!_payload->reserve((_size + 1))) {
DEBUG_HTTPCLIENT("[HTTP-Client][getString] not enough memory to reserve a string! need: %d\n", (_size + 1)); DEBUG_HTTPCLIENT("[HTTP-Client][getString] not enough memory to reserve a string! need: %d\n", (_size + 1));
return *_payload; return *_payload;

View File

@ -161,7 +161,7 @@ public:
bool begin(WiFiClient &client, const String& url); bool begin(WiFiClient &client, const String& url);
bool begin(WiFiClient &client, const String& host, uint16_t port, const String& uri = "/", bool https = false); bool begin(WiFiClient &client, const String& host, uint16_t port, const String& uri = "/", bool https = false);
// old API is now explicitely forbidden // old API is now explicitly forbidden
bool begin(String url) __attribute__ ((error("obsolete API, use ::begin(WiFiClient, url)"))); bool begin(String url) __attribute__ ((error("obsolete API, use ::begin(WiFiClient, url)")));
bool begin(String host, uint16_t port, String uri = "/") __attribute__ ((error("obsolete API, use ::begin(WiFiClient, host, port, uri)"))); bool begin(String host, uint16_t port, String uri = "/") __attribute__ ((error("obsolete API, use ::begin(WiFiClient, host, port, uri)")));
bool begin(String url, const uint8_t httpsFingerprint[20]) __attribute__ ((error("obsolete API, use ::begin(WiFiClientSecure, ...)"))); bool begin(String url, const uint8_t httpsFingerprint[20]) __attribute__ ((error("obsolete API, use ::begin(WiFiClientSecure, ...)")));

View File

@ -72,7 +72,7 @@ void ESP8266HTTPUpdateServerTemplate<ServerType>::setup(ESP8266WebServerTemplate
ESP.restart(); ESP.restart();
} }
},[&](){ },[&](){
// handler for the file upload, get's the sketch bytes, and writes // handler for the file upload, gets the sketch bytes, and writes
// them through the Update object // them through the Update object
HTTPUpload& upload = _server->upload(); HTTPUpload& upload = _server->upload();

View File

@ -7,7 +7,7 @@
* Version 1.1 * Version 1.1
* Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) * Copyright (c) 2013 Tony DiCola (tony@tonydicola.com)
* ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) * ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com)
* MDNS-SD Suport 2015 Hristo Gochkov * MDNS-SD Support 2015 Hristo Gochkov
* Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com) * Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com)
* *
* License (MIT license): * License (MIT license):

View File

@ -7,7 +7,7 @@
* Version 1.1 * Version 1.1
* Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) * Copyright (c) 2013 Tony DiCola (tony@tonydicola.com)
* ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) * ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com)
* MDNS-SD Suport 2015 Hristo Gochkov * MDNS-SD Support 2015 Hristo Gochkov
* Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com) * Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com)
* *
* License (MIT license): * License (MIT license):

View File

@ -25,7 +25,7 @@ Usage
file. file.
2. Include the ESP8266LLMNR library in the sketch. 2. Include the ESP8266LLMNR library in the sketch.
3. Call the LLMNR.begin() method in the sketch's setup() function, and provide 3. Call the LLMNR.begin() method in the sketch's setup() function, and provide
the hostname to advertize. This should not include any ".local" prefix. the hostname to advertise. This should not include any ".local" prefix.
4. If ESP8266 AP mode is enabled, disabled, or the WiFi or AP configuration is 4. If ESP8266 AP mode is enabled, disabled, or the WiFi or AP configuration is
changed, call LLMNR.notify_ap_change() after the change is made. changed, call LLMNR.notify_ap_change() after the change is made.
@ -70,7 +70,7 @@ ESP8266 Multicast DNS (port of CC3000 Multicast DNS library)
Version 1.1 Version 1.1
Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) Copyright (c) 2013 Tony DiCola (tony@tonydicola.com)
ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com)
MDNS-SD Suport 2015 Hristo Gochkov MDNS-SD Support 2015 Hristo Gochkov
Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com) Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -7,7 +7,7 @@
Version 1.1 Version 1.1
Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) Copyright (c) 2013 Tony DiCola (tony@tonydicola.com)
ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com)
MDNS-SD Suport 2015 Hristo Gochkov MDNS-SD Support 2015 Hristo Gochkov
Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com) Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com)
License (MIT license): License (MIT license):

View File

@ -171,7 +171,7 @@ void handleStatus() {
/* /*
Return the list of files in the directory specified by the "dir" query string parameter. Return the list of files in the directory specified by the "dir" query string parameter.
Also demonstrates the use of chuncked responses. Also demonstrates the use of chunked responses.
*/ */
void handleFileList() { void handleFileList() {
if (!fsOK) { if (!fsOK) {
@ -479,7 +479,7 @@ void handleFileUpload() {
/* /*
The "Not Found" handler catches all URI not explicitely declared in code The "Not Found" handler catches all URI not explicitly declared in code
First try to find and return the requested file from the filesystem, First try to find and return the requested file from the filesystem,
and if it fails, return a 404 page with debug information and if it fails, return a 404 page with debug information
*/ */
@ -555,7 +555,7 @@ void setup(void) {
DBG_OUTPUT_PORT.println(fsOK ? F("Filesystem initialized.") : F("Filesystem init failed!")); DBG_OUTPUT_PORT.println(fsOK ? F("Filesystem initialized.") : F("Filesystem init failed!"));
#ifdef USE_SPIFFS #ifdef USE_SPIFFS
// Debug: dump on console contents of filessytem with no filter and check filenames validity // Debug: dump on console contents of filesystem with no filter and check filenames validity
Dir dir = fileSystem->openDir(""); Dir dir = fileSystem->openDir("");
DBG_OUTPUT_PORT.println(F("List of files at root of filesystem:")); DBG_OUTPUT_PORT.println(F("List of files at root of filesystem:"));
while (dir.next()) { while (dir.next()) {

View File

@ -134,7 +134,7 @@ bool handleFileRead(String path) {
/* /*
The "Not Found" handler catches all URI not explicitely declared in code The "Not Found" handler catches all URI not explicitly declared in code
First try to find and return the requested file from the filesystem, First try to find and return the requested file from the filesystem,
and if it fails, return a 404 page with debug information and if it fails, return a 404 page with debug information
*/ */

View File

@ -73,7 +73,7 @@ int fetchMaxFragmentLength() {
// returns true then you can use the ::setBufferSizes(rx, tx) to shrink // returns true then you can use the ::setBufferSizes(rx, tx) to shrink
// the needed BearSSL memory while staying within protocol limits. // the needed BearSSL memory while staying within protocol limits.
// //
// If MFLN is not supported, you may still be able to mimimize the buffer // If MFLN is not supported, you may still be able to minimize the buffer
// sizes assuming you can ensure the server never transmits fragments larger // sizes assuming you can ensure the server never transmits fragments larger
// than the size (i.e. by using HTTP GET RANGE methods, etc.). // than the size (i.e. by using HTTP GET RANGE methods, etc.).

View File

@ -142,7 +142,7 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
#define USE_CACHE // Enable SSL session caching. #define USE_CACHE // Enable SSL session caching.
// Caching SSL sessions shortens the length of the SSL handshake. // Caching SSL sessions shortens the length of the SSL handshake.
// You can see the performance improvement by looking at the // You can see the performance improvement by looking at the
// Network tab of the developper tools of your browser. // Network tab of the developer tools of your browser.
//#define DYNAMIC_CACHE // Whether to dynamically allocate the cache. //#define DYNAMIC_CACHE // Whether to dynamically allocate the cache.
#if defined(USE_CACHE) && defined(DYNAMIC_CACHE) #if defined(USE_CACHE) && defined(DYNAMIC_CACHE)

View File

@ -135,7 +135,7 @@ vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
BearSSL::Session session; BearSSL::Session session;
client.setSession(&session); client.setSession(&session);
Serial.printf("Connecting with an unitialized session..."); Serial.printf("Connecting with an uninitialized session...");
start = millis(); start = millis();
client.setTrustAnchors(&cert); client.setTrustAnchors(&cert);
fetchURL(&client, host, port, path); fetchURL(&client, host, port, path);

View File

@ -123,7 +123,7 @@ void setup() {
} }
String line = client.readStringUntil('\n'); String line = client.readStringUntil('\n');
if (line.startsWith("{\"state\":\"success\"")) { if (line.startsWith("{\"state\":\"success\"")) {
Serial.println("esp8266/Arduino CI successfull!"); Serial.println("esp8266/Arduino CI successful!");
} else { } else {
Serial.println("esp8266/Arduino CI has failed"); Serial.println("esp8266/Arduino CI has failed");
} }

View File

@ -149,7 +149,7 @@ void loop() {
//check TCP clients for data //check TCP clients for data
#if 1 #if 1
// Incredibly, this code is faster than the bufferred one below - #4620 is needed // Incredibly, this code is faster than the buffered one below - #4620 is needed
// loopback/3000000baud average 348KB/s // loopback/3000000baud average 348KB/s
for (int i = 0; i < MAX_SRV_CLIENTS; i++) for (int i = 0; i < MAX_SRV_CLIENTS; i++)
while (serverClients[i].available() && Serial.availableForWrite() > 0) { while (serverClients[i].available() && Serial.availableForWrite() > 0) {

View File

@ -161,7 +161,7 @@ class ServerSessions {
ServerSessions(ServerSession *sessions, uint32_t size) : ServerSessions(sessions, size, false) {} ServerSessions(ServerSession *sessions, uint32_t size) : ServerSessions(sessions, size, false) {}
// Dynamically allocates a cache for the given number of sessions and initializes it. // Dynamically allocates a cache for the given number of sessions and initializes it.
// If the allocation of the buffer wasn't successfull, the value // If the allocation of the buffer wasn't successful, the value
// returned by size() will be 0. // returned by size() will be 0.
ServerSessions(uint32_t size) : ServerSessions(size > 0 ? new ServerSession[size] : nullptr, size, true) {} ServerSessions(uint32_t size) : ServerSessions(size > 0 ? new ServerSession[size] : nullptr, size, true) {}
@ -178,7 +178,7 @@ class ServerSessions {
// Size of the store in sessions. // Size of the store in sessions.
uint32_t _size; uint32_t _size;
// Store where the informations for the sessions are stored. // Store where the information for the sessions are stored.
ServerSession *_store; ServerSession *_store;
// Whether the store is dynamically allocated. // Whether the store is dynamically allocated.
// If this is true, the store needs to be freed in the destructor. // If this is true, the store needs to be freed in the destructor.

View File

@ -273,7 +273,7 @@ int8_t ESP8266WiFiMulti::startScan()
* @param connectTimeoutMs * @param connectTimeoutMs
* WiFi connect timeout in ms * WiFi connect timeout in ms
* @return * @return
* WiFi conneciton status * WiFi connection status
*/ */
wl_status_t ESP8266WiFiMulti::connectWiFiMulti(uint32_t connectTimeoutMs) wl_status_t ESP8266WiFiMulti::connectWiFiMulti(uint32_t connectTimeoutMs)
{ {

View File

@ -506,7 +506,7 @@ IPAddress ESP8266WiFiSTAClass::dnsIP(uint8_t dns_no) {
/** /**
* Get the broadcast ip address. * Get the broadcast ip address.
* @return IPAddress Bradcast IP * @return IPAddress Broadcast IP
*/ */
IPAddress ESP8266WiFiSTAClass::broadcastIP() IPAddress ESP8266WiFiSTAClass::broadcastIP()
{ {

View File

@ -947,7 +947,7 @@ extern "C" {
uint16_t suites[cipher_cnt]; uint16_t suites[cipher_cnt];
memcpy_P(suites, cipher_list, cipher_cnt * sizeof(cipher_list[0])); memcpy_P(suites, cipher_list, cipher_cnt * sizeof(cipher_list[0]));
br_ssl_client_zero(cc); br_ssl_client_zero(cc);
br_ssl_engine_add_flags(&cc->eng, BR_OPT_NO_RENEGOTIATION); // forbid SSL renegociation, as we free the Private Key after handshake br_ssl_engine_add_flags(&cc->eng, BR_OPT_NO_RENEGOTIATION); // forbid SSL renegotiation, as we free the Private Key after handshake
br_ssl_engine_set_versions(&cc->eng, BR_TLS10, BR_TLS12); br_ssl_engine_set_versions(&cc->eng, BR_TLS10, BR_TLS12);
br_ssl_engine_set_suites(&cc->eng, suites, (sizeof suites) / (sizeof suites[0])); br_ssl_engine_set_suites(&cc->eng, suites, (sizeof suites) / (sizeof suites[0]));
br_ssl_client_set_default_rsapub(cc); br_ssl_client_set_default_rsapub(cc);
@ -973,7 +973,7 @@ extern "C" {
uint16_t suites[cipher_cnt]; uint16_t suites[cipher_cnt];
memcpy_P(suites, cipher_list, cipher_cnt * sizeof(cipher_list[0])); memcpy_P(suites, cipher_list, cipher_cnt * sizeof(cipher_list[0]));
br_ssl_server_zero(cc); br_ssl_server_zero(cc);
br_ssl_engine_add_flags(&cc->eng, BR_OPT_NO_RENEGOTIATION); // forbid SSL renegociation, as we free the Private Key after handshake br_ssl_engine_add_flags(&cc->eng, BR_OPT_NO_RENEGOTIATION); // forbid SSL renegotiation, as we free the Private Key after handshake
br_ssl_engine_set_versions(&cc->eng, BR_TLS10, BR_TLS12); br_ssl_engine_set_versions(&cc->eng, BR_TLS10, BR_TLS12);
br_ssl_engine_set_suites(&cc->eng, suites, (sizeof suites) / (sizeof suites[0])); br_ssl_engine_set_suites(&cc->eng, suites, (sizeof suites) / (sizeof suites[0]));
#ifndef BEARSSL_SSL_BASIC #ifndef BEARSSL_SSL_BASIC

View File

@ -34,7 +34,7 @@ extern "C" {
// lwIP-v2 backlog facility allows to keep memory safe by limiting the // lwIP-v2 backlog facility allows to keep memory safe by limiting the
// maximum number of incoming *pending clients*. Default number of possibly // maximum number of incoming *pending clients*. Default number of possibly
// simultaneously pending clients is defined in WiFiServer.cpp // simultaneously pending clients is defined in WiFiServer.cpp
// (MAX_PENDING_CLIENTS_PER_PORT=5). User can overide it at runtime from // (MAX_PENDING_CLIENTS_PER_PORT=5). User can override it at runtime from
// sketch: // sketch:
// WiFiServer::begin(port, max-simultaneous-pending-clients); // WiFiServer::begin(port, max-simultaneous-pending-clients);
// //

View File

@ -44,7 +44,7 @@ public:
// initialize, start listening on specified port. // initialize, start listening on specified port.
// Returns 1 if successful, 0 if there are no sockets available to use // Returns 1 if successful, 0 if there are no sockets available to use
uint8_t begin(uint16_t port) override; uint8_t begin(uint16_t port) override;
// Finish with the UDP connetion // Finish with the UDP connection
void stop() override; void stop() override;
// join a multicast group and listen on the given port // join a multicast group and listen on the given port
uint8_t beginMulticast(IPAddress interfaceAddr, IPAddress multicast, uint16_t port); uint8_t beginMulticast(IPAddress interfaceAddr, IPAddress multicast, uint16_t port);
@ -58,7 +58,7 @@ public:
// Returns 1 if successful, 0 if there was a problem resolving the hostname or port // Returns 1 if successful, 0 if there was a problem resolving the hostname or port
int beginPacket(const char *host, uint16_t port) override; int beginPacket(const char *host, uint16_t port) override;
// Start building up a packet to send to the multicast address // Start building up a packet to send to the multicast address
// multicastAddress - muticast address to send to // multicastAddress - multicast address to send to
// interfaceAddress - the local IP address of the interface that should be used // interfaceAddress - the local IP address of the interface that should be used
// use WiFi.localIP() or WiFi.softAPIP() depending on the interface you need // use WiFi.localIP() or WiFi.softAPIP() depending on the interface you need
// ttl - multicast packet TTL (default is 1) // ttl - multicast packet TTL (default is 1)

View File

@ -1,5 +1,5 @@
/* /*
* empty wrappers to play with linker and reenable wifi at boot time * empty wrappers to play with linker and re-enable wifi at boot time
*/ */
#include "coredecls.h" #include "coredecls.h"
@ -21,7 +21,7 @@ extern "C" void __disableWiFiAtBootTime()
// Does (almost) nothing: WiFi is enabled by default in nonos-sdk // Does (almost) nothing: WiFi is enabled by default in nonos-sdk
// ... but restores legacy WiFi credentials persistence to true at boot time // ... but restores legacy WiFi credentials persistence to true at boot time
// (can be still overriden by user before setting up WiFi, like before) // (can be still overrisden by user before setting up WiFi, like before)
// (note: c++ ctors not called yet at this point) // (note: c++ ctors not called yet at this point)
ESP8266WiFiClass::persistent(true); ESP8266WiFiClass::persistent(true);

View File

@ -186,7 +186,7 @@ public:
// this helper is ready to be used when debugging UDP // this helper is ready to be used when debugging UDP
void printChain (const pbuf* pb, const char* msg, size_t n) const void printChain (const pbuf* pb, const char* msg, size_t n) const
{ {
// printf the pb pbuf chain, bufferred and all at once // printf the pb pbuf chain, buffered and all at once
char buf[128]; char buf[128];
int l = snprintf(buf, sizeof(buf), "UDP: %s %u: ", msg, n); int l = snprintf(buf, sizeof(buf), "UDP: %s %u: ", msg, n);
while (pb) while (pb)
@ -266,7 +266,7 @@ public:
return true; return true;
} }
// We have interleaved informations on addresses within received pbuf chain: // We have interleaved information on addresses within received pbuf chain:
// (before ipv6 code we had: (data-pbuf) -> (data-pbuf) -> (data-pbuf) -> ... in the receiving order) // (before ipv6 code we had: (data-pbuf) -> (data-pbuf) -> (data-pbuf) -> ... in the receiving order)
// Now: (address-info-pbuf -> chained-data-pbuf [-> chained-data-pbuf...]) -> // Now: (address-info-pbuf -> chained-data-pbuf [-> chained-data-pbuf...]) ->
// (chained-address-info-pbuf -> chained-data-pbuf [-> chained...]) -> ... // (chained-address-info-pbuf -> chained-data-pbuf [-> chained...]) -> ...

View File

@ -286,7 +286,7 @@ It is important to realize that there is no global message ID counter, only the
### <a name="FAQStartupCrash"></a>My ESP8266 crashes on start-up when I use the library! ### <a name="FAQStartupCrash"></a>My ESP8266 crashes on start-up when I use the library!
This could be caused by incorrect arguments to the constructors of the library. Usually you would get a Serial Monitor print of the error in question, but if the constructor is called before you call `Serial.begin(115200)` then there will be nothing to print to. The solution is first to check so that all constructor arguments are valid, e.g. that the mesh password has the correct length and does not contain any forbidden characters. If everything checks out you can try to move all the library contructors you use into the `setup()` function of your sketch, after the position where `Serial.begin(115200)` is called. That should give you a proper error message in the Serial Monitor, so you can locate the problem. This could be caused by incorrect arguments to the constructors of the library. Usually you would get a Serial Monitor print of the error in question, but if the constructor is called before you call `Serial.begin(115200)` then there will be nothing to print to. The solution is first to check so that all constructor arguments are valid, e.g. that the mesh password has the correct length and does not contain any forbidden characters. If everything checks out you can try to move all the library constructors you use into the `setup()` function of your sketch, after the position where `Serial.begin(115200)` is called. That should give you a proper error message in the Serial Monitor, so you can locate the problem.
### <a name="FAQSSIDAmnesia"></a>The node does not remember the SSID I assign to it! ### <a name="FAQSSIDAmnesia"></a>The node does not remember the SSID I assign to it!

View File

@ -53,7 +53,7 @@ EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse,
@param request The request string received from another node in the mesh @param request The request string received from another node in the mesh
@param meshInstance The MeshBackendBase instance that called the function. @param meshInstance The MeshBackendBase instance that called the function.
@return The string to send back to the other node. For ESP-NOW, return an empy string ("") if no response should be sent. @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
*/ */
String manageRequest(const String &request, MeshBackendBase &meshInstance) { String manageRequest(const String &request, MeshBackendBase &meshInstance) {
// To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled) // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
@ -346,7 +346,7 @@ void loop() {
espnowDelay(100); // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response). espnowDelay(100); // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response).
// If you have a data array containing null values it is possible to transmit the raw data by making the array into a multiString as shown below. // If you have a data array containing null values it is possible to transmit the raw data by making the array into a multiString as shown below.
// You can use String::c_str() or String::begin() to retreive the data array later. // You can use String::c_str() or String::begin() to retrieve the data array later.
// Note that certain String methods such as String::substring use null values to determine String length, which means they will not work as normal with multiStrings. // Note that certain String methods such as String::substring use null values to determine String length, which means they will not work as normal with multiStrings.
uint8_t dataArray[] = {0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e'}; uint8_t dataArray[] = {0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e'};
String espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.'); String espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');

View File

@ -37,7 +37,7 @@ TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, net
@param request The request string received from another node in the mesh @param request The request string received from another node in the mesh
@param meshInstance The MeshBackendBase instance that called the function. @param meshInstance The MeshBackendBase instance that called the function.
@return The string to send back to the other node. For ESP-NOW, return an empy string ("") if no response should be sent. @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
*/ */
String manageRequest(const String &request, MeshBackendBase &meshInstance) { String manageRequest(const String &request, MeshBackendBase &meshInstance) {
// To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled) // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)

View File

@ -84,7 +84,7 @@ bool ESP8266WiFiMesh::waitForClient(WiFiClient &currClient, int maxWait)
* and pass that to the user-supplied handler. * and pass that to the user-supplied handler.
* *
* @message The string to send to the node. * @message The string to send to the node.
* @returns: True if the exchange was a succes, false otherwise. * @returns: True if the exchange was a success, false otherwise.
* *
*/ */
// DEPRECATED! // DEPRECATED!

View File

@ -182,7 +182,7 @@ public:
* A vector that contains the NetworkInfo for each WiFi network to connect to. * A vector that contains the NetworkInfo for each WiFi network to connect to.
* The connectionQueue vector is cleared before each new scan and filled via the networkFilter callback function once the scan completes. * The connectionQueue vector is cleared before each new scan and filled via the networkFilter callback function once the scan completes.
* WiFi connections will start with connectionQueue[0] and then incrementally proceed to higher vector positions. * WiFi connections will start with connectionQueue[0] and then incrementally proceed to higher vector positions.
* Note that old network indicies often are invalidated whenever a new WiFi network scan occurs. * Note that old network indices often are invalidated whenever a new WiFi network scan occurs.
*/ */
static std::vector<NetworkInfo> connectionQueue; static std::vector<NetworkInfo> connectionQueue;
@ -190,7 +190,7 @@ public:
* A vector with the TransmissionResult for each AP to which a transmission was attempted during the latest attemptTransmission call. * A vector with the TransmissionResult for each AP to which a transmission was attempted during the latest attemptTransmission call.
* The latestTransmissionOutcomes vector is cleared before each new transmission attempt. * The latestTransmissionOutcomes vector is cleared before each new transmission attempt.
* Connection attempts are indexed in the same order they were attempted. * Connection attempts are indexed in the same order they were attempted.
* Note that old network indicies often are invalidated whenever a new WiFi network scan occurs. * Note that old network indices often are invalidated whenever a new WiFi network scan occurs.
*/ */
static std::vector<TransmissionResult> latestTransmissionOutcomes; static std::vector<TransmissionResult> latestTransmissionOutcomes;

View File

@ -172,7 +172,7 @@ public:
* This vector is unique for each mesh backend, but NetworkInfo elements can be directly transferred between the vectors as long as both SSID and BSSID are present. * This vector is unique for each mesh backend, but NetworkInfo elements can be directly transferred between the vectors as long as both SSID and BSSID are present.
* The connectionQueue vector is cleared before each new scan and filled via the networkFilter callback function once the scan completes. * The connectionQueue vector is cleared before each new scan and filled via the networkFilter callback function once the scan completes.
* WiFi connections will start with connectionQueue[0] and then incrementally proceed to higher vector positions. * WiFi connections will start with connectionQueue[0] and then incrementally proceed to higher vector positions.
* Note that old network indicies often are invalidated whenever a new WiFi network scan occurs. * Note that old network indices often are invalidated whenever a new WiFi network scan occurs.
* *
* Since the connectionQueue() is iterated over during transmissions, always use constConnectionQueue() from callbacks other than NetworkFilter. * Since the connectionQueue() is iterated over during transmissions, always use constConnectionQueue() from callbacks other than NetworkFilter.
*/ */
@ -188,7 +188,7 @@ public:
* This vector is unique for each mesh backend. * This vector is unique for each mesh backend.
* The latestTransmissionOutcomes vector is cleared before each new transmission attempt. * The latestTransmissionOutcomes vector is cleared before each new transmission attempt.
* Connection attempts are indexed in the same order they were attempted. * Connection attempts are indexed in the same order they were attempted.
* Note that old network indicies often are invalidated whenever a new WiFi network scan occurs. * Note that old network indices often are invalidated whenever a new WiFi network scan occurs.
*/ */
static std::vector<TransmissionOutcome> & latestTransmissionOutcomes(); static std::vector<TransmissionOutcome> & latestTransmissionOutcomes();
@ -260,7 +260,7 @@ public:
/* /*
* Will ensure that an encrypted connection exists to each target node before sending the message, * Will ensure that an encrypted connection exists to each target node before sending the message,
* establishing a temporary encrypted connection with duration getAutoEncryptionDuration() first if neccessary. * establishing a temporary encrypted connection with duration getAutoEncryptionDuration() first if necessary.
* If an encrypted connection cannot be established to a target node, no message will be sent to that node. * If an encrypted connection cannot be established to a target node, no message will be sent to that node.
* Note that if an encrypted connection to a target node is not present before this method is called, the response from said node will likely not be received * Note that if an encrypted connection to a target node is not present before this method is called, the response from said node will likely not be received
* since it will be encrypted and the auto encrypted connection to the node is immediately removed after transmission (unless the requestPermanentConnections argument is set to true). * since it will be encrypted and the auto encrypted connection to the node is immediately removed after transmission (unless the requestPermanentConnections argument is set to true).
@ -808,7 +808,7 @@ public:
* @param peerMac The MAC of the other node to which the request should be sent. * @param peerMac The MAC of the other node to which the request should be sent.
* @param durationMs The desired duration of the connection. * @param durationMs The desired duration of the connection.
* *
* @return EncryptedConnectionStatus::CONNECTION_ESTABLISHED if the request was succesful. EncryptedConnectionStatus::SOFT_LIMIT_CONNECTION_ESTABLISHED if only a temporary soft limit connection could be established (see the setEncryptedConnectionsSoftLimit method documentation for details). Otherwise another status code based on the outcome. * @return EncryptedConnectionStatus::CONNECTION_ESTABLISHED if the request was successful. EncryptedConnectionStatus::SOFT_LIMIT_CONNECTION_ESTABLISHED if only a temporary soft limit connection could be established (see the setEncryptedConnectionsSoftLimit method documentation for details). Otherwise another status code based on the outcome.
*/ */
EncryptedConnectionStatus requestTemporaryEncryptedConnection(const uint8_t *peerMac, const uint32_t durationMs); EncryptedConnectionStatus requestTemporaryEncryptedConnection(const uint8_t *peerMac, const uint32_t durationMs);
@ -825,7 +825,7 @@ public:
* @param peerMac The MAC of the other node to which the request should be sent. * @param peerMac The MAC of the other node to which the request should be sent.
* @param minDurationMs The desired minimum duration of the connection. * @param minDurationMs The desired minimum duration of the connection.
* *
* @return EncryptedConnectionStatus::CONNECTION_ESTABLISHED if the request was succesful. EncryptedConnectionStatus::SOFT_LIMIT_CONNECTION_ESTABLISHED if only a temporary soft limit connection could be established (see the setEncryptedConnectionsSoftLimit method documentation for details). Otherwise another status code based on the outcome. * @return EncryptedConnectionStatus::CONNECTION_ESTABLISHED if the request was successful. EncryptedConnectionStatus::SOFT_LIMIT_CONNECTION_ESTABLISHED if only a temporary soft limit connection could be established (see the setEncryptedConnectionsSoftLimit method documentation for details). Otherwise another status code based on the outcome.
*/ */
EncryptedConnectionStatus requestFlexibleTemporaryEncryptedConnection(const uint8_t *peerMac, const uint32_t minDurationMs); EncryptedConnectionStatus requestFlexibleTemporaryEncryptedConnection(const uint8_t *peerMac, const uint32_t minDurationMs);

View File

@ -317,7 +317,7 @@ TransmissionStatusType EspnowTransmitter::espnowSendToNodeUnsynchronized(const S
transmission[transmissionsRemainingIndex] = (char)transmissionsRemaining; transmission[transmissionsRemainingIndex] = (char)transmissionsRemaining;
} }
// Fills indicies in range [transmissionMacIndex, transmissionMacIndex + 5] (6 bytes) with the MAC address of the WiFi AP interface. // Fills indices in range [transmissionMacIndex, transmissionMacIndex + 5] (6 bytes) with the MAC address of the WiFi AP interface.
// We always transmit from the station interface (due to using ESP_NOW_ROLE_CONTROLLER), so this makes it possible to always know both interface MAC addresses of a node that sends a transmission. // We always transmit from the station interface (due to using ESP_NOW_ROLE_CONTROLLER), so this makes it possible to always know both interface MAC addresses of a node that sends a transmission.
WiFi.softAPmacAddress(transmission + transmissionMacIndex); WiFi.softAPmacAddress(transmission + transmissionMacIndex);
@ -391,7 +391,7 @@ TransmissionStatusType EspnowTransmitter::espnowSendToNodeUnsynchronized(const S
return TransmissionStatusType::TRANSMISSION_FAILED; return TransmissionStatusType::TRANSMISSION_FAILED;
} }
--transmissionsRemaining; // This is used when transfering multi-transmission messages. --transmissionsRemaining; // This is used when transferring multi-transmission messages.
} while(transmissionsRemaining >= 0); } while(transmissionsRemaining >= 0);

View File

@ -386,7 +386,7 @@ void FloodingMesh::restoreDefaultResponseTransmittedHook()
* *
* @param request The request string received from another node in the mesh * @param request The request string received from another node in the mesh
* @param meshInstance The MeshBackendBase instance that called the function. * @param meshInstance The MeshBackendBase instance that called the function.
* @return The string to send back to the other node. For ESP-NOW, return an empy string ("") if no response should be sent. * @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
*/ */
String FloodingMesh::_defaultRequestHandler(const String &request, MeshBackendBase &meshInstance) String FloodingMesh::_defaultRequestHandler(const String &request, MeshBackendBase &meshInstance)
{ {

View File

@ -182,7 +182,7 @@ public:
* *
* ########## WARNING! This an experimental feature. API may change at any time. Only use if you like it when things break. ########## * ########## WARNING! This an experimental feature. API may change at any time. Only use if you like it when things break. ##########
* Will be very slow compared to unencrypted broadcasts. Probably works OK in a small mesh with a maximum of 2-3 new messages transmitted in the mesh every second. * Will be very slow compared to unencrypted broadcasts. Probably works OK in a small mesh with a maximum of 2-3 new messages transmitted in the mesh every second.
* Because of the throughput difference, mixing encypted and unencrypted broadcasts is not recommended if there are frequent mesh broadcasts (multiple per second), * Because of the throughput difference, mixing encrypted and unencrypted broadcasts is not recommended if there are frequent mesh broadcasts (multiple per second),
* since a lot of unencrypted broadcasts can build up while a single encrypted broadcast is sent. * since a lot of unencrypted broadcasts can build up while a single encrypted broadcast is sent.
* *
* It is recommended that verboseMode is turned off if using this, to avoid slowdowns due to excessive Serial printing. * It is recommended that verboseMode is turned off if using this, to avoid slowdowns due to excessive Serial printing.

View File

@ -70,7 +70,7 @@ public:
* This vector is unique for each mesh backend, but NetworkInfo elements can be directly transferred between the vectors as long as both SSID and BSSID are present. * This vector is unique for each mesh backend, but NetworkInfo elements can be directly transferred between the vectors as long as both SSID and BSSID are present.
* The connectionQueue vector is cleared before each new scan and filled via the networkFilter callback function once the scan completes. * The connectionQueue vector is cleared before each new scan and filled via the networkFilter callback function once the scan completes.
* WiFi connections will start with connectionQueue[0] and then incrementally proceed to higher vector positions. * WiFi connections will start with connectionQueue[0] and then incrementally proceed to higher vector positions.
* Note that old network indicies often are invalidated whenever a new WiFi network scan occurs. * Note that old network indices often are invalidated whenever a new WiFi network scan occurs.
* *
* Since the connectionQueue() is iterated over during transmissions, always use constConnectionQueue() from callbacks other than NetworkFilter. * Since the connectionQueue() is iterated over during transmissions, always use constConnectionQueue() from callbacks other than NetworkFilter.
*/ */
@ -86,7 +86,7 @@ public:
* This vector is unique for each mesh backend. * This vector is unique for each mesh backend.
* The latestTransmissionOutcomes vector is cleared before each new transmission attempt. * The latestTransmissionOutcomes vector is cleared before each new transmission attempt.
* Connection attempts are indexed in the same order they were attempted. * Connection attempts are indexed in the same order they were attempted.
* Note that old network indicies often are invalidated whenever a new WiFi network scan occurs. * Note that old network indices often are invalidated whenever a new WiFi network scan occurs.
*/ */
static std::vector<TransmissionOutcome> & latestTransmissionOutcomes(); static std::vector<TransmissionOutcome> & latestTransmissionOutcomes();

View File

@ -93,7 +93,7 @@ public:
_followRedirects = follow ? HTTPC_STRICT_FOLLOW_REDIRECTS : HTTPC_DISABLE_FOLLOW_REDIRECTS; _followRedirects = follow ? HTTPC_STRICT_FOLLOW_REDIRECTS : HTTPC_DISABLE_FOLLOW_REDIRECTS;
} }
/** /**
* set redirect follow mode. See `followRedirects_t` enum for avaliable modes. * set redirect follow mode. See `followRedirects_t` enum for available modes.
* @param follow * @param follow
*/ */
void setFollowRedirects(followRedirects_t follow) void setFollowRedirects(followRedirects_t follow)

View File

@ -3,7 +3,7 @@
This example demonstrates two features of the LEA MDNSResponder: This example demonstrates two features of the LEA MDNSResponder:
1. The host and service domain negotiation process that ensures 1. The host and service domain negotiation process that ensures
the uniqueness of the finally choosen host and service domain name. the uniqueness of the finally chosen host and service domain name.
2. The dynamic MDNS service TXT feature 2. The dynamic MDNS service TXT feature
A 'clock' service in announced via the MDNS responder and the current A 'clock' service in announced via the MDNS responder and the current
@ -11,7 +11,7 @@
The time value is updated every second! The time value is updated every second!
The ESP is initially announced to clients as 'esp8266.local', if this host domain The ESP is initially announced to clients as 'esp8266.local', if this host domain
is already used in the local network, another host domain is negociated. Keep an is already used in the local network, another host domain is negotiated. Keep an
eye to the serial output to learn the final host domain for the clock service. eye to the serial output to learn the final host domain for the clock service.
The service itself is is announced as 'host domain'._espclk._tcp.local. The service itself is is announced as 'host domain'._espclk._tcp.local.
As the service uses port 80, a very simple HTTP server is installed also to deliver As the service uses port 80, a very simple HTTP server is installed also to deliver
@ -57,7 +57,7 @@
const char* ssid = STASSID; const char* ssid = STASSID;
const char* password = STAPSK; const char* password = STAPSK;
char* pcHostDomain = 0; // Negociated host domain char* pcHostDomain = 0; // Negotiated host domain
bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain
MDNSResponder::hMDNSService hMDNSService = 0; // The handle of the clock service in the MDNS responder MDNSResponder::hMDNSService hMDNSService = 0; // The handle of the clock service in the MDNS responder
@ -90,7 +90,7 @@ void setClock(void) {
configTime((TIMEZONE_OFFSET * 3600), (DST_OFFSET * 3600), "pool.ntp.org", "time.nist.gov", "time.windows.com"); configTime((TIMEZONE_OFFSET * 3600), (DST_OFFSET * 3600), "pool.ntp.org", "time.nist.gov", "time.windows.com");
Serial.print("Waiting for NTP time sync: "); Serial.print("Waiting for NTP time sync: ");
time_t now = time(nullptr); // Secs since 01.01.1970 (when uninitalized starts with (8 * 3600 = 28800) time_t now = time(nullptr); // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
while (now < 8 * 3600 * 2) { // Wait for realistic value while (now < 8 * 3600 * 2) { // Wait for realistic value
delay(500); delay(500);
Serial.print("."); Serial.print(".");

View File

@ -3,7 +3,7 @@
This example demonstrates two features of the LEA MDNSResponder: This example demonstrates two features of the LEA MDNSResponder:
1. The host and service domain negotiation process that ensures 1. The host and service domain negotiation process that ensures
the uniqueness of the finally choosen host and service domain name. the uniqueness of the finally chosen host and service domain name.
2. The dynamic MDNS service lookup/query feature. 2. The dynamic MDNS service lookup/query feature.
A list of 'HTTP' services in the local network is created and kept up to date. A list of 'HTTP' services in the local network is created and kept up to date.
@ -11,7 +11,7 @@
and announced as a service. and announced as a service.
The ESP itself is initially announced to clients as 'esp8266.local', if this host domain The ESP itself is initially announced to clients as 'esp8266.local', if this host domain
is already used in the local network, another host domain is negociated. Keep an is already used in the local network, another host domain is negotiated. Keep an
eye to the serial output to learn the final host domain for the HTTP service. eye to the serial output to learn the final host domain for the HTTP service.
The service itself is is announced as 'host domain'._http._tcp.local. The service itself is is announced as 'host domain'._http._tcp.local.
The HTTP server delivers a short greeting and the current list of other 'HTTP' services (not updated). The HTTP server delivers a short greeting and the current list of other 'HTTP' services (not updated).
@ -49,7 +49,7 @@
const char* ssid = STASSID; const char* ssid = STASSID;
const char* password = STAPSK; const char* password = STAPSK;
char* pcHostDomain = 0; // Negociated host domain char* pcHostDomain = 0; // Negotiated host domain
bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain
MDNSResponder::hMDNSService hMDNSService = 0; // The handle of the http service in the MDNS responder MDNSResponder::hMDNSService hMDNSService = 0; // The handle of the http service in the MDNS responder
MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery = 0; // The handle of the 'http.tcp' service query in the MDNS responder MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery = 0; // The handle of the 'http.tcp' service query in the MDNS responder

View File

@ -55,9 +55,9 @@ const char* ap_default_psk = APPSK; ///< Default PSK.
@param pass String pointer for storing PSK. @param pass String pointer for storing PSK.
@return True or False. @return True or False.
The config file have to containt the WiFi SSID in the first line The config file has to contain the WiFi SSID in the first line
and the WiFi PSK in the second line. and the WiFi PSK in the second line.
Line seperator can be \r\n (CR LF) \r or \n. Line separator can be \r\n (CR LF) \r or \n.
*/ */
bool loadConfig(String *ssid, String *pass) { bool loadConfig(String *ssid, String *pass) {
// open file for reading. // open file for reading.
@ -74,7 +74,7 @@ bool loadConfig(String *ssid, String *pass) {
content.trim(); content.trim();
// Check if ther is a second line available. // Check if there is a second line available.
int8_t pos = content.indexOf("\r\n"); int8_t pos = content.indexOf("\r\n");
uint8_t le = 2; uint8_t le = 2;
// check for linux and mac line ending. // check for linux and mac line ending.

View File

@ -3,7 +3,7 @@ version=1.2
author=multiple, see files author=multiple, see files
maintainer=LaborEtArs maintainer=LaborEtArs
sentence=Creates a mDNS responder. sentence=Creates a mDNS responder.
paragraph=Creates a mDNS responder to ensure host domain uniqueness in local networks and to allow for mDNS service discovery and announcment. paragraph=Creates a mDNS responder to ensure host domain uniqueness in local networks and to allow for mDNS service discovery and announcement.
category=Communication category=Communication
url=https://github.com/LaborEtArs/ESP8266mDNS url=https://github.com/LaborEtArs/ESP8266mDNS
architectures=esp8266 architectures=esp8266

View File

@ -3,7 +3,7 @@
This file is part of the esp8266 core for Arduino environment. This file is part of the esp8266 core for Arduino environment.
Legacy_ESP8266mDNS: Legacy_ESP8266mDNS:
The well known, thouroughly tested (yet no flawless) default mDNS library for the ESP8266 family The well known, thoroughly tested (yet no flawless) default mDNS library for the ESP8266 family
LEA_ESP8266mDNS: LEA_ESP8266mDNS:
An (currently) experimental mDNS implementation, that supports a lot more of mDNS features than Legacy_ESP8266mDNS, like: An (currently) experimental mDNS implementation, that supports a lot more of mDNS features than Legacy_ESP8266mDNS, like:
@ -19,7 +19,7 @@
- Dynamic queries for DNS-SD services with cached and updated answers and user notifications - Dynamic queries for DNS-SD services with cached and updated answers and user notifications
- Support for multi-homed client host domains - Support for multi-homed client host domains
See 'LEA_ESP8266mDNS/EPS8266mDNS.h' for more implementation details and usage informations. See 'LEA_ESP8266mDNS/EPS8266mDNS.h' for more implementation details and usage information.
See 'examples/mDNS_Clock' and 'examples/mDNS_ServiceMonitor' for implementation examples of the advanced features. See 'examples/mDNS_Clock' and 'examples/mDNS_ServiceMonitor' for implementation examples of the advanced features.
LEA_ESP8266mDNS is (mostly) client source code compatible to 'Legacy_ESP8266mDNS', so it could be LEA_ESP8266mDNS is (mostly) client source code compatible to 'Legacy_ESP8266mDNS', so it could be

View File

@ -1132,7 +1132,7 @@ bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServ
MDNSResponder::answerTxts MDNSResponder::answerTxts
Returns all TXT items for the given service as a ';'-separated string. Returns all TXT items for the given service as a ';'-separated string.
If not already existing; the string is alloced, filled and attached to the answer. If not already existing; the string is allocated, filled and attached to the answer.
*/ */
const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery, const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
@ -1165,7 +1165,7 @@ const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_h
Set a global callback for probe results. The callback is called, when probing Set a global callback for probe results. The callback is called, when probing
for the host domain (or a service domain, without specific probe result callback) for the host domain (or a service domain, without specific probe result callback)
failes or succeedes. fails or succeeds.
In the case of failure, the domain name should be changed via 'setHostname' or 'setServiceName'. In the case of failure, the domain name should be changed via 'setHostname' or 'setServiceName'.
When succeeded, the host or service domain will be announced by the MDNS responder. When succeeded, the host or service domain will be announced by the MDNS responder.
@ -1191,7 +1191,7 @@ bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
MDNSResponder::setServiceProbeResultCallback MDNSResponder::setServiceProbeResultCallback
Set a service specific callback for probe results. The callback is called, when probing Set a service specific callback for probe results. The callback is called, when probing
for the service domain failes or succeedes. for the service domain fails or succeeds.
In the case of failure, the service name should be changed via 'setServiceName'. In the case of failure, the service name should be changed via 'setServiceName'.
When succeeded, the service domain will be announced by the MDNS responder. When succeeded, the service domain will be announced by the MDNS responder.

View File

@ -8,7 +8,7 @@
Essentially, this is an rewrite of the original EPS8266 Multicast DNS code (ESP8266mDNS). Essentially, this is an rewrite of the original EPS8266 Multicast DNS code (ESP8266mDNS).
The target of this rewrite was to keep the existing interface as stable as possible while The target of this rewrite was to keep the existing interface as stable as possible while
adding and extending the supported set of mDNS features. adding and extending the supported set of mDNS features.
A lot of the additions were basicly taken from Erik Ekman's lwIP mdns app code. A lot of the additions were basically taken from Erik Ekman's lwIP mdns app code.
Supported mDNS features (in some cases somewhat limited): Supported mDNS features (in some cases somewhat limited):
- Presenting a DNS-SD service to interested observers, eg. a http server by presenting _http._tcp service - Presenting a DNS-SD service to interested observers, eg. a http server by presenting _http._tcp service
@ -52,7 +52,7 @@
Static: Static:
Call 'uint32_t u32AnswerCount = MDNS.queryService("http", "tcp");' Call 'uint32_t u32AnswerCount = MDNS.queryService("http", "tcp");'
Iterate answers by: 'for (uint32_t u=0; u<u32AnswerCount; ++u) { const char* pHostname = MDNS.answerHostname(u); }' Iterate answers by: 'for (uint32_t u=0; u<u32AnswerCount; ++u) { const char* pHostname = MDNS.answerHostname(u); }'
You should call MDNS.removeQuery() sometimes later (when the answers are nott needed anymore) You should call MDNS.removeQuery() sometimes later (when the answers are not needed anymore)
Dynamic: Dynamic:
Install a dynamic query by calling 'DNSResponder::hMDNSServiceQuery hServiceQuery = MDNS.installServiceQuery("http", "tcp", serviceQueryCallback, &userData);' Install a dynamic query by calling 'DNSResponder::hMDNSServiceQuery hServiceQuery = MDNS.installServiceQuery("http", "tcp", serviceQueryCallback, &userData);'
@ -195,7 +195,7 @@ public:
// Finish MDNS processing // Finish MDNS processing
bool close(void); bool close(void);
// for esp32 compatability // for esp32 compatibility
bool end(void); bool end(void);
// Change hostname (probing is restarted) // Change hostname (probing is restarted)
bool setHostname(const char* p_pcHostname); bool setHostname(const char* p_pcHostname);
@ -241,7 +241,7 @@ public:
{ {
setHostname(p_pcHostname); setHostname(p_pcHostname);
} }
// for esp32 compatibilty // for esp32 compatibility
void setInstanceName(const String& s_pcHostname) void setInstanceName(const String& s_pcHostname)
{ {
setInstanceName(s_pcHostname.c_str()); setInstanceName(s_pcHostname.c_str());
@ -1180,7 +1180,7 @@ protected:
uint8_t m_u8HostReplyMask; // Flags for reply components/answers uint8_t m_u8HostReplyMask; // Flags for reply components/answers
bool m_bLegacyQuery; // Flag: Legacy query bool m_bLegacyQuery; // Flag: Legacy query
bool m_bResponse; // Flag: Response to a query bool m_bResponse; // Flag: Response to a query
bool m_bAuthorative; // Flag: Authorative (owner) response bool m_bAuthorative; // Flag: Authoritative (owner) response
bool m_bCacheFlush; // Flag: Clients should flush their caches bool m_bCacheFlush; // Flag: Clients should flush their caches
bool m_bUnicast; // Flag: Unicast response bool m_bUnicast; // Flag: Unicast response
bool m_bUnannounce; // Flag: Unannounce service bool m_bUnannounce; // Flag: Unannounce service

View File

@ -395,7 +395,7 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr); IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress) if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
{ {
// SAME IP address -> We've received an old message from ourselfs (same IP) // SAME IP address -> We've received an old message from ourselves (same IP)
DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n"));); DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n")););
m_HostProbeInformation.m_bTiebreakNeeded = false; m_HostProbeInformation.m_bTiebreakNeeded = false;
} }
@ -410,7 +410,7 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
} }
else // WON tiebreak else // WON tiebreak
{ {
//TiebreakState = TiebreakState_Won; // We received an 'old' message from ourselfs -> Just ignore //TiebreakState = TiebreakState_Won; // We received an 'old' message from ourselves -> Just ignore
DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n"));); DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
m_HostProbeInformation.m_bTiebreakNeeded = false; m_HostProbeInformation.m_bTiebreakNeeded = false;
} }
@ -501,7 +501,7 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
(hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain)) // Host domain match (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain)) // Host domain match
{ {
// We've received an old message from ourselfs (same SRV) // We've received an old message from ourselves (same SRV)
DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n"));); DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
pService->m_ProbeInformation.m_bTiebreakNeeded = false; pService->m_ProbeInformation.m_bTiebreakNeeded = false;
} }
@ -516,7 +516,7 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
} }
else // WON tiebreak else // WON tiebreak
{ {
//TiebreakState = TiebreakState_Won; // We received an 'old' message from ourselfs -> Just ignore //TiebreakState = TiebreakState_Won; // We received an 'old' message from ourselves -> Just ignore
DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n"));); DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
pService->m_ProbeInformation.m_bTiebreakNeeded = false; pService->m_ProbeInformation.m_bTiebreakNeeded = false;
} }
@ -1560,7 +1560,7 @@ bool MDNSResponder::_announce(bool p_bAnnounce,
bResult = true; bResult = true;
sendParameter.m_bResponse = true; // Announces are 'Unsolicited authorative responses' sendParameter.m_bResponse = true; // Announces are 'Unsolicited authoritative responses'
sendParameter.m_bAuthorative = true; sendParameter.m_bAuthorative = true;
sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers
@ -1612,7 +1612,7 @@ bool MDNSResponder::_announceService(stcMDNSService& p_rService,
if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus) if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
{ {
sendParameter.m_bResponse = true; // Announces are 'Unsolicited authorative responses' sendParameter.m_bResponse = true; // Announces are 'Unsolicited authoritative responses'
sendParameter.m_bAuthorative = true; sendParameter.m_bAuthorative = true;
sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers

Some files were not shown because too many files have changed in this diff Show More