friendev EtherDune TCP/IP library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Stateful Class Reference

Maintains a state variable and allows to pull out a state string representation for debugging. More...

#include <Stateful.h>

Inheritance diagram for Stateful:
DHCP TCPSocket HTTPClient HTTPServer TCPListener< SOCKET, MAX_CLIENTS >

Public Member Functions

uint8_t getState ()
 

Protected Member Functions

void setState (uint8_t newState, uint8_t timeout)
 Changes to a new state More...
 

Protected Attributes

uint8_t stateTimer
 state timer, in ticks More...
 
uint8_t state
 state code More...
 

Detailed Description

Maintains a state variable and allows to pull out a state string representation for debugging.

Complements other classes by adding a state variable and providing a way to obtain a string representation of the current state when debugging. This class also allows to keep a timer variable associated with the state in case the state has to time out.

Definition at line 31 of file Stateful.h.

Member Function Documentation

uint8_t Stateful::getState ( )
inline

Definition at line 41 of file Stateful.h.

void Stateful::setState ( uint8_t  newState,
uint8_t  timeout 
)
protected

Changes to a new state

Parameters
newStateThe new state.
timeoutThe timeout, in ticks

Definition at line 28 of file Stateful.cpp.

Member Data Documentation

uint8_t Stateful::state
protected

state code

Definition at line 35 of file Stateful.h.

uint8_t Stateful::stateTimer
protected

state timer, in ticks

Definition at line 34 of file Stateful.h.


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