-
Notifications
You must be signed in to change notification settings - Fork 5
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
WIFI_COUNTRY configuration key for country-specific Wi-Fi #83
WIFI_COUNTRY configuration key for country-specific Wi-Fi #83
Conversation
1f108a0
to
cff8632
Compare
e046586
to
c3eec9f
Compare
…ion using the ISO 3166-1 alpha-2 country code
c3eec9f
to
5ec9dce
Compare
char *country_entry = find_entry("WIFI_COUNTRY")->value; | ||
if (strlen(country_entry) == 2) { | ||
country = CYW43_COUNTRY(country_entry[0], country_entry[1], 0); | ||
} |
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.
This is good. To ensure consistency, it's important to incorporate a few additional considerations:
-
Default Value Handling: If the entry is NULL or empty, it must default to 'XX', which serves as the alias for COUNTRY_WORLDWIDE. This step is crucial to ensure seamless upgrades from previous versions without causing disruptions.
-
Compliance with Standards: The value must adhere to the ISO-3166-alpha-2 standard and be compatible with the CYW43 library, requiring two uppercase letters. Should the value not meet this criterion, it must revert to 'XX'.
-
Country List Limitation: The list of countries is a subset of the full ISO-3166-alpha-2 list. Prior validation is necessary to handle cases where the library might not recognize a country code. If the library defaults to the 'XX' country code (worldwide) upon encountering an unrecognized country, we should proactively filter the input against the allowed country list in the library, defaulting to 'XX' for any unmatched entries.
While these are the primary validations I've identified, additional checks for any other parameter values are encouraged. The guiding principle here is to design these validations as though the user interface might not perform them— a likely scenario, most users will enjoy a good experience with the default XX
country worldwide value.
9d0676f
to
ebc8415
Compare
WIFI_COUNTRY configuration key for country-specific Wi-Fi initialisation using the ISO 3166-1 alpha-2 country code
Supported list is defined here
configurator PR