RSeries astromech firmware
WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE > Class Template Reference

#include <wifi/WifiMarcduinoReceiver.h>

Detailed Description

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
class WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >

Base template of Marcduino receiver over WiFi.

Instances of this template will invoke the provided callback function when a complete Marcduino command has been received over TCP/IP on port 2000 (default).

WifiAccess wifiAccess("MyAccessPoint", "MyPassword");
WifiMarcduinoReceiver wifiMarcduinoReceiver(wifiAccess, 2000);

To support more than one client (for example) use:

WifiMarcduinoReceiverBase<2> wifiMarcduinoReceiver(wifiAccess, 2000);
+ Inheritance diagram for WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >:
+ Collaboration diagram for WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >:

Public Member Functions

 WifiMarcduinoReceiverBase (WifiAccess &wifiAccess, uint16_t port=2000)
 Constructor. More...
 
void setCommandHandler (void(*commandHandler)(const char *cmd))
 
void setEnabled (bool enabled)
 
bool enabled ()
 
virtual void wifiConnected (WifiAccess &access) override
 
virtual void wifiDisconnected (WifiAccess &access) override
 
virtual void animate () override
 Dispatch any received i2c event to CommandEvent. More...
 
- Public Member Functions inherited from AnimatedEvent
 AnimatedEvent ()
 Default Constructor. More...
 
void setLoopDoneCallback (AnimatedLoopDone loopProc)
 

Public Attributes

WiFiClient fClients [maxClients]
 
uint32_t fClientLastMsg [maxClients] = {}
 

Additional Inherited Members

- Static Public Member Functions inherited from AnimatedEvent
static void process ()
 Calls animate() for each created AnimatedEvent subclass. More...
 

Constructor & Destructor Documentation

◆ WifiMarcduinoReceiverBase()

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::WifiMarcduinoReceiverBase ( WifiAccess wifiAccess,
uint16_t  port = 2000 
)
inline

Constructor.

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

Parameters
portthe port number of this service

Member Function Documentation

◆ animate()

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
virtual void WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::animate ( )
inlineoverridevirtual

Dispatch any received i2c event to CommandEvent.

Implements AnimatedEvent.

◆ enabled()

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
bool WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::enabled ( )
inline

◆ setCommandHandler()

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
void WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::setCommandHandler ( void(*)(const char *cmd)  commandHandler)
inline

◆ setEnabled()

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
void WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::setEnabled ( bool  enabled)
inline

◆ wifiConnected()

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
virtual void WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::wifiConnected ( WifiAccess access)
inlineoverridevirtual

Implements WifiAccess::Notify.

◆ wifiDisconnected()

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
virtual void WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::wifiDisconnected ( WifiAccess access)
inlineoverridevirtual

Implements WifiAccess::Notify.

Member Data Documentation

◆ fClientLastMsg

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
uint32_t WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::fClientLastMsg[maxClients] = {}

◆ fClients

template<unsigned maxClients = 1, uint16_t BUFFER_SIZE = 64>
WiFiClient WifiMarcduinoReceiverBase< maxClients, BUFFER_SIZE >::fClients[maxClients]

The documentation for this class was generated from the following file:
WifiAccess
Definition: WifiAccess.h:25
WifiMarcduinoReceiverBase
Base template of Marcduino receiver over WiFi.
Definition: WifiMarcduinoReceiver.h:38
WifiMarcduinoReceiver.h