-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve wificfg #732
Open
zub2
wants to merge
4
commits into
SuperHouse:master
Choose a base branch
from
zub2:improve-wificfg
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Improve wificfg #732
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
58b9932
extras/wificfg: make sure wificfg.h #includes all necessary files
zub2 5f6ccbd
extras/wificfg: use #if when checking for configUSE_TRACE_FACILITY
zub2 77b2b23
extras/wificfg: make the default wifi options overridable
zub2 a4defa3
extras/wificfg: fix a typo in comment
zub2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,11 +54,11 @@ | |
#endif | ||
|
||
|
||
const char *wificfg_default_ssid = "EOR_%02X%02X%02X"; | ||
const char *wificfg_default_password = "esp-open-rtos"; | ||
const char *wificfg_default_hostname = "eor-%02x%02x%02x"; | ||
const char *wificfg_default_ssid __attribute__ ((weak)) = "EOR_%02X%02X%02X"; | ||
const char *wificfg_default_password __attribute__ ((weak)) = "esp-open-rtos"; | ||
const char *wificfg_default_hostname __attribute__ ((weak)) = "eor-%02x%02x%02x"; | ||
|
||
/* The http task stack allocates a single buffer to do much of it's work. */ | ||
/* The http task stack allocates a single buffer to do much of its work. */ | ||
#define HTTP_BUFFER_SIZE 54 | ||
|
||
/* | ||
|
@@ -1540,7 +1540,7 @@ static int handle_wificfg_challenge_post(int s, wificfg_method method, | |
return wificfg_write_string(s, http_redirect_header); | ||
} | ||
|
||
#ifdef configUSE_TRACE_FACILITY | ||
#if configUSE_TRACE_FACILITY | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that looks right, thanks. |
||
static const char *http_tasks_content[] = { | ||
#include "content/tasks.html" | ||
}; | ||
|
@@ -1638,7 +1638,7 @@ static const wificfg_dispatch wificfg_dispatch_list[] = { | |
{"/challenge.html", HTTP_METHOD_POST, handle_wificfg_challenge_post, false}, | ||
{"/wificfg/restart.html", HTTP_METHOD_POST, handle_restart_post, true}, | ||
{"/wificfg/erase.html", HTTP_METHOD_POST, handle_erase_post, true}, | ||
#ifdef configUSE_TRACE_FACILITY | ||
#if configUSE_TRACE_FACILITY | ||
{"/tasks", HTTP_METHOD_GET, handle_tasks, false}, | ||
{"/tasks.html", HTTP_METHOD_GET, handle_tasks, false}, | ||
#endif /* configUSE_TRACE_FACILITY */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't need to be 'weak', they are variables that can be trivially modified, just set them in your app initialization code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I didn't realize it's a
const char*
, not aconst char[]
.I was motivated by several things:
Because the type is
const char*
, even the second point was not fulfilled. If the type is changed toconst char[]
, then it seems to do what I wanted.What do you think about keeping these weak and making them
const char[]
? Or are the last two points from the list above not interesting to you?