TinyPPP
PPP networking over any Arduino Stream
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TinyPPP_ESP32 Class Reference

PPP network interface for ESP32 (arduino-esp32 3.x): ESP-IDF lwIP PPP via esp_netif, integrated as a NetworkInterface. More...

#include <TinyPPP_ESP32.h>

Inheritance diagram for TinyPPP_ESP32:

Classes

struct  Driver
 

Public Member Functions

 TinyPPP_ESP32 ()=default
 
 TinyPPP_ESP32 (const TinyPPP_ESP32 &)=delete
 
 ~TinyPPP_ESP32 ()
 
bool begin (Stream &io, UBaseType_t taskPriority=5, BaseType_t core=tskNO_AFFINITY)
 
bool connected () const
 true when the link is up and we have an IP address
 
void end ()
 Terminates the link and removes the interface.
 
TinyPPP_ESP32 & operator= (const TinyPPP_ESP32 &)=delete
 
void setCredentials (const char *user, const char *password)
 PAP credentials, if the peer requires authentication (before begin())
 
void setLogger (Print &out)
 Debug output of the PPP state changes, e.g. setLogger(Serial1)
 
bool waitConnected (uint32_t timeoutMs=30000)
 Waits until we have got an IP address.
 

Protected Member Functions

EventGroupHandle_t _events ()
 
void log (const char *msg, int32_t id=-1)
 
void onPppEvent (int32_t id)
 
size_t printDriverInfo (Print &out) const override
 

Static Protected Member Functions

static esp_err_t postAttach (esp_netif_t *netif, void *handle)
 
static void postEvent (arduino_event_id_t id)
 
static void pppEventCb (void *arg, esp_event_base_t base, int32_t id, void *data)
 
static void rxTask (void *arg)
 
static esp_err_t transmit (void *handle, void *buffer, size_t len)
 

Protected Attributes

Driver _driver {}
 
EventGroupHandle_t _eventGroup = nullptr
 
Stream * _io = nullptr
 
Print * _log = nullptr
 
String _password
 
esp_event_handler_instance_t _pppEventInstance = nullptr
 
volatile uint32_t _restartAt = 0
 
volatile bool _running = false
 
volatile bool _stopping = false
 
TaskHandle_t _task = nullptr
 
String _user
 

Static Protected Attributes

static constexpr EventBits_t DEAD_BIT = BIT0
 

Detailed Description

PPP network interface for ESP32 (arduino-esp32 3.x): ESP-IDF lwIP PPP via esp_netif, integrated as a NetworkInterface.

Constructor & Destructor Documentation

◆ TinyPPP_ESP32() [1/2]

TinyPPP_ESP32 ( )
default

◆ TinyPPP_ESP32() [2/2]

◆ ~TinyPPP_ESP32()

~TinyPPP_ESP32 ( )
inline

Member Function Documentation

◆ _events()

EventGroupHandle_t _events ( )
inlineprotected

◆ begin()

bool begin ( Stream &  io,
UBaseType_t  taskPriority = 5,
BaseType_t  core = tskNO_AFFINITY 
)
inline

Starts PPP over the indicated stream (e.g. Serial, Serial1). The stream must already be opened. A FreeRTOS task reads the stream in the background. Returns immediately: use connected()/waitConnected().

◆ connected()

bool connected ( ) const
inline

true when the link is up and we have an IP address

◆ end()

void end ( )
inline

Terminates the link and removes the interface.

◆ log()

void log ( const char *  msg,
int32_t  id = -1 
)
inlineprotected

◆ onPppEvent()

void onPppEvent ( int32_t  id)
inlineprotected

◆ operator=()

◆ postAttach()

static esp_err_t postAttach ( esp_netif_t *  netif,
void *  handle 
)
inlinestaticprotected

◆ postEvent()

static void postEvent ( arduino_event_id_t  id)
inlinestaticprotected

◆ pppEventCb()

static void pppEventCb ( void *  arg,
esp_event_base_t  base,
int32_t  id,
void *  data 
)
inlinestaticprotected

◆ printDriverInfo()

size_t printDriverInfo ( Print &  out) const
inlineoverrideprotected

◆ rxTask()

static void rxTask ( void *  arg)
inlinestaticprotected

◆ setCredentials()

void setCredentials ( const char *  user,
const char *  password 
)
inline

PAP credentials, if the peer requires authentication (before begin())

◆ setLogger()

void setLogger ( Print &  out)
inline

Debug output of the PPP state changes, e.g. setLogger(Serial1)

◆ transmit()

static esp_err_t transmit ( void *  handle,
void *  buffer,
size_t  len 
)
inlinestaticprotected

◆ waitConnected()

bool waitConnected ( uint32_t  timeoutMs = 30000)
inline

Waits until we have got an IP address.

Member Data Documentation

◆ _driver

Driver _driver {}
protected

◆ _eventGroup

EventGroupHandle_t _eventGroup = nullptr
protected

◆ _io

Stream* _io = nullptr
protected

◆ _log

Print* _log = nullptr
protected

◆ _password

String _password
protected

◆ _pppEventInstance

esp_event_handler_instance_t _pppEventInstance = nullptr
protected

◆ _restartAt

volatile uint32_t _restartAt = 0
protected

◆ _running

volatile bool _running = false
protected

◆ _stopping

volatile bool _stopping = false
protected

◆ _task

TaskHandle_t _task = nullptr
protected

◆ _user

String _user
protected

◆ DEAD_BIT

constexpr EventBits_t DEAD_BIT = BIT0
staticconstexprprotected

The documentation for this class was generated from the following file: