ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
user_config.cc File Reference
#include "user_config.h"
#include <libents/controller/modules/power.h>
#include <libents/controller/modules/wifi.h>
#include <libents/controller/modules/wifi_userconfig.h>
#include <libents/user_config.h>
#include <libtock/net/eui64.h>
#include <libtock/services/alarm.h>
#include <ulog.h>

Go to the source code of this file.

Functions

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

Variables

UserConfigState state = USERCONFIG_STATE_OFF
 

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().

◆ UserConfigStopCallback()

void UserConfigStopCallback ( uint32_t  ,
uint32_t  ,
void *  ptr 
)

Stops the user config webserver.

See also
libtock_alarm_callback

Definition at line 123 of file user_config.cc.

References ControllerPowerSleep(), ControllerWiFiHostInfo(), ControllerWiFiStopHost(), state, USERCONFIG_STATE_OFF, UserConfigGet(), and UserConfigStop().

Referenced by UserConfigStop().

◆ UserConfigUpdateFromServer()

void UserConfigUpdateFromServer ( void  )

Definition at line 91 of file user_config.cc.

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

Referenced by main().

Variable Documentation

◆ state