This repository has been archived by the owner on Jul 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStation.h
60 lines (52 loc) · 2.26 KB
/
Station.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* Station
* @author Curt Henrichs
* @date 1-23-2018
*
* Station module is responsable for initializing and maintaing a WiFi
* connection. Additionally, this module will maintain all network services
* for this device.
*
* For Wifi connection and management the WiFiManager library was selected.
* https://github.com/tzapu/WiFiManager
* This library preserves last configured wifi connection and hosts a captive
* web service when not connected to a wifi in station mode.
*
* MDNS is an optional service for this device if configured in the network
* configuration file. The following is pulled from the example documentation,
* - Install host software:
* - For Linux, install Avahi (http://avahi.org/).
* - For Windows, install Bonjour (http://www.apple.com/support/bonjour/).
* - For Mac OSX and iOS support is built in through Bonjour already.
*
* The LED service REST API can be found in the appropriate project module.
*/
#ifndef STATION_H
#define STATION_H
//==============================================================================
// Libraries
//==============================================================================
#include "NetworkConfig.h"
//==============================================================================
// Constant and Macro Definitions
//==============================================================================
#if ST_USE_MDNS
#define ST_MDNS_NAME ("window-leds") //! (purposefully excluding .local)
#endif
//==============================================================================
// Public Function Prototypes
//==============================================================================
/**
* Initialize Station which will connect to last configured Wifi router. If
* no such router then block as an access point until user defines a router.
* When connected to a router, start all services.
*/
void st_init(void);
/**
* Update Station which will check current WiFi connection. If lost connection
* then stop all services and attempt to reconnect. (Blocking until new
* connection is established). Then restart all previously stopped services.
* Else update the services normally.
*/
void st_update(void);
#endif