Merge pull request #987 from DiUS/enduser_enhanced

Enhancements to enduser_setup module
This commit is contained in:
Johny Mattsson 2016-02-02 00:39:47 +11:00
commit fcb14a33b3
5 changed files with 570 additions and 216 deletions

View File

@ -1094,12 +1094,14 @@ exponent(char *p, int exp, int fmtch)
#endif /* FLOATINGPT */
void c_sprintf(char *s, char *fmt, ...)
int c_sprintf(char *s, const char *fmt, ...)
{
int n;
va_list arg;
va_start(arg, fmt);
vsprintf(s, fmt, arg);
n = vsprintf(s, fmt, arg);
va_end(arg);
return n;
}
#endif

View File

@ -60,7 +60,7 @@ extern void output_redirect(const char *str);
#define c_sprintf os_sprintf
#else
#include "c_stdarg.h"
void c_sprintf(char* s,char *fmt, ...);
int c_sprintf(char* s,const char *fmt, ...);
#endif
// #define c_vsprintf ets_vsprintf

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,23 @@ This module provides a simple way of configuring ESP8266 chips without using a s
After running [`enduser_setup.start()`](#enduser_setupstart) a portal like the above can be accessed through a wireless network called SetupGadget_XXXXXX. The portal is used to submit the credentials for the WiFi of the enduser.
After an IP address has been successfully obtained this module will stop as if [`enduser_setup.stop()`](#enduser_setupstop) had been called.
## enduser_setup.manual()
Controls whether manual AP configuration is used.
By default the `enduser_setup` module automatically configures an open access point when starting, and stops it when the device has been successfully joined to a WiFi network. If manual mode has been enabled, neither of this is done. The device must be manually configured for `wifi.SOFTAP` mode prior to calling `enduser_setup.start()`. Additionally, the portal is not stopped after the device has successfully joined to a WiFi network.
Most importantly, *the `onConfigured()` callback is not supported in manual mode*. This limitation may disappear in the future.
#### Syntax
`enduser_setup.manual([on_off])`
#### Parameters
- `on_off` a boolean value indicating whether to use manual mode; if not given, the function only returns the current setting.
#### Returns
The current setting, true if manual mode is enabled, false if it is not.
## enduser_setup.start()
Starts the captive portal.
@ -44,4 +61,4 @@ Stops the captive portal.
none
#### Returns
`nil`
`nil`

View File

@ -89,31 +89,9 @@ SECTIONS
KEEP(*(.lua_rotable))
LONG(0) LONG(0) /* Null-terminate the array */
/* These are *only* pulled in by Lua, and therefore safe to put in flash */
*/libc.a:lib_a-isalnum.o(.text* .literal*)
*/libc.a:lib_a-isalpha.o(.text* .literal*)
*/libc.a:lib_a-iscntrl.o(.text* .literal*)
*/libc.a:lib_a-isspace.o(.text* .literal*)
*/libc.a:lib_a-islower.o(.text* .literal*)
*/libc.a:lib_a-isupper.o(.text* .literal*)
*/libc.a:lib_a-ispunct.o(.text* .literal*)
*/libc.a:lib_a-isxdigit.o(.text* .literal*)
*/libc.a:lib_a-locale.o(.text* .literal*)
*/libc.a:lib_a-tolower.o(.text* .literal*)
*/libc.a:lib_a-toupper.o(.text* .literal*)
*/libc.a:lib_a-strcasecmp.o(.text* .literal*)
*/libc.a:lib_a-strcoll.o(.text* .literal*)
*/libc.a:lib_a-strchr.o(.text* .literal*)
*/libc.a:lib_a-strrchr.o(.text* .literal*)
*/libc.a:lib_a-strcat.o(.text* .literal*)
*/libc.a:lib_a-strncat.o(.text* .literal*)
*/libc.a:lib_a-strcspn.o(.text* .literal*)
*/libc.a:lib_a-strtol.o(.text* .literal*)
*/libc.a:lib_a-strtoul.o(.text* .literal*)
*/libc.a:lib_a-strpbrk.o(.text* .literal*)
*/libc.a:lib_a-memchr.o(.text* .literal*)
*/libc.a:lib_a-setjmp.o(.text* .literal*)
/* end Lua C lib functions */
/* SDK doesn't use libc functions, and are therefore safe to put in flash */
*/libc.a(.text* .literal*)
/* end libc functions */
_irom0_text_end = ABSOLUTE(.);
_flash_used_end = ABSOLUTE(.);