ESP32_RTOS_SDK V1.1.0

- Main Page
- Modules
- Data Structures
- Files

- File List

smartconfig.h
1 /*
2 * ESPRSSIF MIT License
3 *
4 * Copyright (c) 2015 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
5 *
6 * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP32 only, in which case,
7 * it is free of charge, to any person obtaining a copy of this software and associated
8 * documentation files (the "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
11 * to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all copies or
14 * substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 *
23 */
24
25 #ifndef __SMARTCONFIG_H__
26 #define __SMARTCONFIG_H__
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
52 typedef enum {
53 SC_STATUS_WAIT = 0,
54 SC_STATUS_FIND_CHANNEL,
55 SC_STATUS_GETTING_SSID_PSWD,
56 SC_STATUS_LINK,
57 SC_STATUS_LINK_OVER,
58 } sc_status;
59
60 typedef enum {
61 SC_TYPE_ESPTOUCH = 0,
62 SC_TYPE_AIRKISS,
63 SC_TYPE_ESPTOUCH_AIRKISS,
64 } sc_type;
65
81 typedef void (*sc_callback_t)(sc_status status, void *pdata);
82
90 const char *smartconfig_get_version(void);
91
112 bool smartconfig_start(sc_callback_t cb, ...);
113
125 bool smartconfig_stop(void);
126
138 bool esptouch_set_timeout(uint8 time_s);
139
151 bool smartconfig_set_type(sc_type type);
152
161 #ifdef __cplusplus
162 }
163 #endif
164
165 #endif
SC_STATUS_LINK_OVER
Definition: smartconfig.h:57
smartconfig_stop
bool smartconfig_stop(void)
Stop SmartConfig, free the buffer taken by smartconfig_start.
SC_TYPE_ESPTOUCH_AIRKISS
Definition: smartconfig.h:63
sc_callback_t
void(* sc_callback_t)(sc_status status, void *pdata)
The callback of SmartConfig, executed when smart-config status changed.
Definition: smartconfig.h:81
SC_TYPE_ESPTOUCH
Definition: smartconfig.h:61
smartconfig_get_version
const char * smartconfig_get_version(void)
Get the version of SmartConfig.
SC_STATUS_WAIT
Definition: smartconfig.h:53
smartconfig_set_type
bool smartconfig_set_type(sc_type type)
Set protocol type of SmartConfig.
sc_type
sc_type
Definition: smartconfig.h:60
esptouch_set_timeout
bool esptouch_set_timeout(uint8 time_s)
Set timeout of SmartConfig.
SC_TYPE_AIRKISS
Definition: smartconfig.h:62
SC_STATUS_LINK
Definition: smartconfig.h:56
SC_STATUS_GETTING_SSID_PSWD
Definition: smartconfig.h:55
smartconfig_start
bool smartconfig_start(sc_callback_t cb,...)
Start SmartConfig mode.
sc_status
sc_status
Definition: smartconfig.h:52
SC_STATUS_FIND_CHANNEL
Definition: smartconfig.h:54