ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
user_config.h File Reference

Controls the user config webserver. More...

#include <cstdint>

Go to the source code of this file.

Enumerations

enum  UserConfigState { USERCONFIG_STATE_OFF , USERCONFIG_STATE_ON , USERCONFIG_STATE_STOPPING }
 

Functions

void UserConfigStart (uint32_t retry_ms)
 Starts the user config webserver.
 
void UserConfigStop (uint32_t retry_ms)
 Stops the user config webserver.
 
int UserConfigCurrentStatus (void)
 Get the current user config state.
 
void UserConfigUpdateFromServer (void)
 

Detailed Description

Controls the user config webserver.

Author
John Madden
Date
2025-10-01

This files interfaces with the user config webserver. It allows starting and stopping of the webserver. There is an optional timeout to stop the server after a period of inactivity (no clients connected).

Definition in file user_config.h.

Enumeration Type Documentation

◆ UserConfigState

Enumerator
USERCONFIG_STATE_OFF 
USERCONFIG_STATE_ON 
USERCONFIG_STATE_STOPPING 

Definition at line 16 of file user_config.h.

Function Documentation

◆ UserConfigCurrentStatus()

int UserConfigCurrentStatus ( void  )

Get the current user config state.

See also
UserConfigStates
Returns
Current state.

Definition at line 156 of file user_config.cc.

References state.

◆ UserConfigStart()

void UserConfigStart ( uint32_t  retry_ms)

Starts the user config webserver.

If retry_ms is 0, then autostop is disabled. Use UserConfigStop() to initiate a stop.

Parameters
retry_msTime between webserver stop attempts.

Definition at line 22 of file user_config.cc.

References ControllerUserConfigSend(), ControllerUserConfigStart(), ControllerWiFiHost(), ControllerWiFiHostInfo(), pass, ssid, state, USERCONFIG_OK, USERCONFIG_STATE_ON, UserConfigLoad(), UserConfigPrint(), and UserConfigStop().

Referenced by main().

◆ UserConfigStop()

void UserConfigStop ( uint32_t  retry_ms)

Stops the user config webserver.

Schedule the webserver to be stopped. The webesrver can be prevented from stopping if there is still a client connected. The argument retry_ms specifies how long to go between stop attempts.

Parameters
retry_msTime between webserver stop attempts.

Definition at line 117 of file user_config.cc.

References state, USERCONFIG_STATE_STOPPING, and UserConfigStopCallback().

Referenced by UserConfigStart(), and UserConfigStopCallback().

◆ UserConfigUpdateFromServer()

void UserConfigUpdateFromServer ( void  )

Definition at line 91 of file user_config.cc.

References ControllerUserConfigRequest(), USERCONFIG_OK, UserConfigLoad(), and UserConfigPrint().

Referenced by main().