Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openmrn_arduino::Esp32WiFiManager::WiFiStackFlow Class Reference

StateFlow that is responsible for startup and maintenance of the WiFi stack. More...

Inheritance diagram for openmrn_arduino::Esp32WiFiManager::WiFiStackFlow:
StateFlowBase Executable Notifiable QMember Destructable

Public Member Functions

 WiFiStackFlow (Esp32WiFiManager *parent)
 Constructor.
 
- Public Member Functions inherited from StateFlowBase
void run () override
 Callback from the executor.
 
void notify () override
 Wakeup call arrived.
 
Serviceservice ()
 Return a pointer to the service I am bound to.
 
- Public Member Functions inherited from Executable
void test_deletion ()
 
- Public Member Functions inherited from QMember
void init ()
 Initiailize a QMember, in place of a public placement construction.
 

Private Member Functions

Action startup ()
 Initial state for this flow.
 
Action noop ()
 No-op state used when the WiFi system is not enabled and events are received.
 
Action init_interface ()
 Initializes the ESP32 WiFi interfaces that are maintained by this flow.
 
Action init_wifi ()
 Initializes the ESP32 WiFi subsystems prior to configuration.
 
Action configure_station ()
 Configures the ESP32 WiFi Station interface.
 
Action configure_softap ()
 Configures the ESP32 WiFi SoftAP interface.
 
Action start_wifi ()
 Starts the ESP32 WiFi subsystem which will trigger the startup of the SoftAP interface (if configured) and Station interface (if configured).
 
Action wait_for_connect ()
 Re-entrant state that periodically checks if the Station interface has successfully connected to the SSID and if it has received an IP address.
 
Action reload ()
 State which processes a configuration reload or the initial configuration of the hub and uplink tasks (if either are enabled).
 

Private Attributes

StateFlowTimer timer_ {this}
 StateFlowTimer used for periodic wakeup of wait_for_connect.
 
Esp32WiFiManagerparent_
 Esp32WiFiManager instance that is being maintained.
 
uint8_t wifiConnectAttempts_ {0}
 Number of attempts to connect to the SSID before timing out.
 
uint32_t wifiConnectBitMask_
 Bit mask used for checking WiFi connection process events in wait_for_connect.
 

Additional Inherited Members

- Static Public Member Functions inherited from StateFlowBase
template<class T , typename... Args>
static void invoke_subflow_and_ignore_result (FlowInterface< Buffer< T > > *target_flow, Args &&... args)
 Calls a helper flow to perform some actions.
 
- Protected Types inherited from StateFlowBase
typedef Action(StateFlowBase::* Callback) ()
 State Flow callback prototype.
 
- Protected Member Functions inherited from StateFlowBase
 StateFlowBase (Service *service)
 Constructor.
 
 ~StateFlowBase ()
 Destructor.
 
void reset_flow (Callback c)
 Resets the flow to the specified state.
 
bool is_state (Callback c)
 
bool is_terminated ()
 
void start_flow (Callback c)
 Resets the flow to the specified state and starts it.
 
Action again ()
 Call the current state again via call_immediately.
 
Action exit ()
 Terminate current StateFlow activity.
 
Action delete_this ()
 Terminates the flow and deletes *this.
 
Action set_terminated ()
 Sets the flow to terminated state.
 
Action call_immediately (Callback c)
 Imediately call the next state upon return.
 
Action wait ()
 Wait for an asynchronous call.
 
Action wait_and_call (Callback c)
 Wait for resource to become available before proceeding to next state.
 
template<class T >
Action allocate_and_call (FlowInterface< Buffer< T > > *target_flow, Callback c, Pool *pool=nullptr)
 Allocates a buffer from a pool and proceed to the next state when allocation is successful.
 
Action allocate_and_call (Callback c, QAsync *queue)
 Allocates an entry from an asynchronous queue, and transitions to a state once the allocation is complete.
 
template<class T >
Buffer< T > * full_allocation_result (FlowInterface< Buffer< T > > *target_flow)
 Takes the result of the asynchronous allocation without resetting the object.
 
template<class T >
T * full_allocation_result (TypedQAsync< T > *queue)
 Takes the result of the asynchronous allocation without resetting the object.
 
template<class T >
void cast_allocation_result (T **member)
 Takes the result of the asynchronous allocation without resetting the object.
 
template<class T >
Buffer< T > * get_allocation_result (FlowInterface< Buffer< T > > *target_flow)
 Takes the result of the asynchronous allocation.
 
Action yield_and_call (Callback c)
 Place the current flow to the back of the executor, and transition to a new state after we get the CPU again.
 
Action yield ()
 Place the current flow to the back of the executor, and re-try the current state after we get the CPU again.
 
Action sleep_and_call (::Timer *timer, long long timeout_nsec, Callback c)
 Suspends execution of this control flow for a specified time.
 
template<class T , typename... Args>
Action invoke_subflow_and_wait (FlowInterface< Buffer< T > > *target_flow, Callback c, Args &&... args)
 Calls a helper flow to perform some actions.
 
Action read_repeated (StateFlowSelectHelper *helper, int fd, void *buf, size_t size, Callback c, unsigned priority=Selectable::MAX_PRIO)
 Blocks until size bytes are read and then invokes the next state.
 
Action read_single (StateFlowSelectHelper *helper, int fd, void *buf, size_t size, Callback c, unsigned priority=Selectable::MAX_PRIO)
 Attempts to read at most size_t bytes, and blocks the caller until at least one byte is read.
 
Action read_nonblocking (StateFlowSelectHelper *helper, int fd, void *buf, size_t size, Callback c, unsigned priority=Selectable::MAX_PRIO)
 Attempts to read at most size bytes, and then invokes the next state, even if only zero bytes are available right now.
 
Action read_repeated_with_timeout (StateFlowTimedSelectHelper *helper, long long timeout_nsec, int fd, void *buf, size_t size, Callback c, unsigned priority=Selectable::MAX_PRIO)
 Blocks until size bytes are read, or a timeout expires.
 
Action internal_try_read ()
 Implementation state that gets repeatedly called upon every wakeup and tries to make progress on reading.
 
Action write_repeated (StateFlowSelectHelper *helper, int fd, const void *buf, size_t size, Callback c, unsigned priority=Selectable::MAX_PRIO)
 Writes some data into a file descriptor, repeating the operation as necessary until all bytes are written.
 
Action internal_try_write ()
 Implementation state that gets repeatedly called upon every wakeup and tries to make progress on writing.
 
- Protected Member Functions inherited from QMember
 QMember ()
 Constructor.
 
 ~QMember ()
 Destructor.
 
- Protected Attributes inherited from QMember
QMembernext
 pointer to the next member in the queue
 

Detailed Description

StateFlow that is responsible for startup and maintenance of the WiFi stack.

Definition at line 622 of file Esp32WiFiManager.hxx.

Constructor & Destructor Documentation

◆ WiFiStackFlow()

openmrn_arduino::Esp32WiFiManager::WiFiStackFlow::WiFiStackFlow ( Esp32WiFiManager parent)

Constructor.

Parameters
parentEsp32WiFiManager instance that this flow should maintain.

Member Data Documentation

◆ parent_

Esp32WiFiManager* openmrn_arduino::Esp32WiFiManager::WiFiStackFlow::parent_
private

Esp32WiFiManager instance that is being maintained.

Definition at line 636 of file Esp32WiFiManager.hxx.

◆ timer_

StateFlowTimer openmrn_arduino::Esp32WiFiManager::WiFiStackFlow::timer_ {this}
private

StateFlowTimer used for periodic wakeup of wait_for_connect.

Definition at line 633 of file Esp32WiFiManager.hxx.

◆ wifiConnectAttempts_

uint8_t openmrn_arduino::Esp32WiFiManager::WiFiStackFlow::wifiConnectAttempts_ {0}
private

Number of attempts to connect to the SSID before timing out.

Only applicable for the station interface via wait_for_connect.

Definition at line 640 of file Esp32WiFiManager.hxx.

◆ wifiConnectBitMask_

uint32_t openmrn_arduino::Esp32WiFiManager::WiFiStackFlow::wifiConnectBitMask_
private

Bit mask used for checking WiFi connection process events in wait_for_connect.

Definition at line 644 of file Esp32WiFiManager.hxx.


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