RSeries astromech firmware
WifiWebServer< maxClients, numPages > Class Template Reference

#include <wifi/WifiWebServer.h>

Detailed Description

template<unsigned maxClients = 10, unsigned numPages = 0>
class WifiWebServer< maxClients, numPages >

Simple WiFi web server.

WifiAccess wifiAccess("MyAccessPoint", "MyPassword");
WElement mainContents[] = {
W1("Hello World"),
WButton("Hello", "hello", []() {
DEBUG_PRINTLN("Hello World");
})
};
WPage pages[] = {
WPage("/", mainContents, SizeOfArray(mainContents)),
};
WifiWebServer<1,SizeOfArray(pages)> myWeb(pages, WIFI_AP_NAME, WIFI_AP_PASSPHRASE, WIFI_ACCESS_POINT);
+ Inheritance diagram for WifiWebServer< maxClients, numPages >:
+ Collaboration diagram for WifiWebServer< maxClients, numPages >:

Public Member Functions

 WifiWebServer (const WPage pages[], WifiAccess &wifiAccess, uint16_t port=80)
 Constructor. More...
 
void setConnect (void(*callback)())
 
void setActivity (void(*callback)())
 
bool enabled ()
 
virtual void wifiConnected (WifiAccess &access) override
 
virtual void wifiDisconnected (WifiAccess &access) override
 
void handle ()
 Dispatch any received i2c event to CommandEvent. More...
 

Public Attributes

WiFiClient fClients [maxClients]
 

Constructor & Destructor Documentation

◆ WifiWebServer()

template<unsigned maxClients = 10, unsigned numPages = 0>
WifiWebServer< maxClients, numPages >::WifiWebServer ( const WPage  pages[],
WifiAccess wifiAccess,
uint16_t  port = 80 
)
inline

Constructor.

Only a single instance of WifiSerialBridge should be created per sketch.

Parameters
portthe port number of this service

Member Function Documentation

◆ enabled()

template<unsigned maxClients = 10, unsigned numPages = 0>
bool WifiWebServer< maxClients, numPages >::enabled ( )
inline

◆ handle()

template<unsigned maxClients = 10, unsigned numPages = 0>
void WifiWebServer< maxClients, numPages >::handle ( )
inline

Dispatch any received i2c event to CommandEvent.

◆ setActivity()

template<unsigned maxClients = 10, unsigned numPages = 0>
void WifiWebServer< maxClients, numPages >::setActivity ( void(*)()  callback)
inline

◆ setConnect()

template<unsigned maxClients = 10, unsigned numPages = 0>
void WifiWebServer< maxClients, numPages >::setConnect ( void(*)()  callback)
inline

◆ wifiConnected()

template<unsigned maxClients = 10, unsigned numPages = 0>
virtual void WifiWebServer< maxClients, numPages >::wifiConnected ( WifiAccess access)
inlineoverridevirtual

Implements WifiAccess::Notify.

◆ wifiDisconnected()

template<unsigned maxClients = 10, unsigned numPages = 0>
virtual void WifiWebServer< maxClients, numPages >::wifiDisconnected ( WifiAccess access)
inlineoverridevirtual

Implements WifiAccess::Notify.

Member Data Documentation

◆ fClients

template<unsigned maxClients = 10, unsigned numPages = 0>
WiFiClient WifiWebServer< maxClients, numPages >::fClients[maxClients]

The documentation for this class was generated from the following file:
W1
Definition: WifiWebServer.h:703
WButton
Definition: WifiWebServer.h:390
WifiAccess
Definition: WifiAccess.h:25
WifiWebServer.h
DEBUG_PRINTLN
#define DEBUG_PRINTLN(s)
Definition: ReelTwo.h:188
WPage
Definition: WifiWebServer.h:868
WElement
Definition: WifiWebServer.h:133
WifiAccess.h
SizeOfArray
#define SizeOfArray(arr)
Definition: ReelTwo.h:213
WifiWebServer
Simple WiFi web server.
Definition: WifiWebServer.h:1171