Skip to content

Commit

Permalink
using ArduinoWiFiServer from NetApiHelpers; Mbed and WiFiC3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy committed Nov 26, 2023
1 parent f260fa5 commit d63a8ce
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 154 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ TelnetStream.h can be included not only in the ino file, but in cpp files of the

Version 1.2.0 introduced TelnetPrint object, a simpler and smaller alternative to TelnetStream. Basically it is only EthernetServer or WiFiServer instanced for use anywhere in your sketch or libraries.

TelnetStream/TelnetPrint works as it is with esp8266 and esp32 WiFi library, with the Ethernet and EthernetENC, with WiFiNINA, WiFi101, WiFiS3 and WiFiEspAT library. The RP2040 Pico Core networking libraries are supported as well.
TelnetStream/TelnetPrint works as it is with:

* esp8266 and esp32 WiFi library (including the wired network interfaces)
* Ethernet and EthernetENC library
* WiFiNINA, WiFi101 and WiFiEspAT library
* Renesas Core WiFiS3 and WiFiC3 libraries
* WiFi library of the RP2040 Pico Core (including the wired network interfaces)
* WiFi and PortentaEthernet library of the Mbed Core

Version 1.3.0 has NetApiHelpers library as dependency. NetApiHelpers library provides Arduino Server for networking libraries without print-to-all-clients functionality in their Server implementation: ESP8266WiFi, ESP32 WiFi, RP2040 Core and Mbed Core.

The library is in Library Manager. You can install it there.

Expand Down
3 changes: 2 additions & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=TelnetStream
version=1.2.6
version=1.3.0
author=Juraj Andrassy
maintainer=Juraj Andrassy <[email protected]>
sentence=Stream implementation over telnet for OTA debuging
Expand All @@ -9,3 +9,4 @@ url=https://github.com/jandrassy/TelnetStream
architectures=*
includes=TelnetStream.h,TelnetPrint.h
dot_a_linkage=true
depends=NetApiHelpers
146 changes: 0 additions & 146 deletions src/ArduinoWiFiServerESP.h

This file was deleted.

25 changes: 19 additions & 6 deletions src/NetTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ repository https://github.com/jandrassy
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#if (ARDUINO_ESP8266_MAJOR < 3)
#include "ArduinoWiFiServerESP.h"
#else
#include <ArduinoWiFiServer.h> // in ESP8266WiFi library
#include <NetApiHelpers.h>
#endif
#include <ArduinoWiFiServer.h>
#define NetClient WiFiClient
#define NetServer ArduinoWiFiServer

#elif defined(ESP32)
#include <WiFi.h>
#include "ArduinoWiFiServerESP.h"
#include <NetApiHelpers.h>
#include <ArduinoWiFiServer.h>
#define NetClient WiFiClient
#define NetServer ArduinoWiFiServer

Expand All @@ -46,6 +46,13 @@ repository https://github.com/jandrassy
#define NetClient EthernetClient
#define NetServer EthernetServerPrint

#elif __has_include(<PortentaEthernet.h>)
#include <PortentaEthernet.h>
#include <NetApiHelpers.h>
#include <ArduinoEthernetServer.h>
#define NetClient EthernetClient
#define NetServer ArduinoEthernetServer

#elif __has_include(<Ethernet.h>)
#include <Ethernet.h>
#define NetClient EthernetClient
Expand All @@ -56,14 +63,20 @@ repository https://github.com/jandrassy
#define NetClient WiFiClient
#define NetServer WiFiServer

#elif __has_include(<WiFiC3.h>)
#include <WiFiC3.h>
#define NetClient WiFiClient
#define NetServer WiFiServer

#elif __has_include(<WiFiEspAT.h>)
#include <WiFiEspAT.h>
#define NetClient WiFiClient
#define NetServer WiFiServerPrint

#elif defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)
#elif (defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)) || (defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_MBED_NANO))
#include <WiFi.h>
#include <ArduinoWiFiServerESP.h>
#include <NetApiHelpers.h>
#include <ArduinoWiFiServer.h>
#define NetClient WiFiClient
#define NetServer ArduinoWiFiServer

Expand Down

0 comments on commit d63a8ce

Please sign in to comment.