Essid support#22
Conversation
nikeflight
left a comment
There was a problem hiding this comment.
Needs unit tests as well.
| unescaped_chars = HEX_ESCAPE_RE.sub(lambda m: chr(int(m.group(1), 16)), essid) | ||
| return unescaped_chars.encode("latin-1") | ||
|
|
||
| def build_ssid_value(raw_essid_from_iwlist: str) -> str: |
There was a problem hiding this comment.
This variable name implies we should be getting the essid from iwlist.
But you're passing the ssid from the piaware-config.txt, does that make sense?
Are people going to be entering their essid as hex-escaped bytes?
There was a problem hiding this comment.
Could you change this method name to something more descriptive like hex_to_string or something similar.
There was a problem hiding this comment.
This variable name implies we should be getting the essid from iwlist. But you're passing the
ssidfrom the piaware-config.txt, does that make sense?Are people going to be entering their
essidas hex-escaped bytes?
Similar to the comment below. Please check how piaware-configurator works with piaware-support in the WIFI BLE setup.
This PR will not affect how SSID was processed when people enter their SSID in piaware-config.txt the old way.
| psk = config.get("wireless-password") | ||
| connect = "true" if config.get("wireless-network") else "false" | ||
|
|
||
| ssid = build_ssid_value(ssid) |
There was a problem hiding this comment.
If we're reading directly from piaware-config.txt, I think we should have some output to stderr for invalid hex-escaped bytes.
There was a problem hiding this comment.
This is to take care the BLE wifi setup process. The ESSID source is from iwlist. Please go check the JIRA ticket for context.
I plan to create another branch for unit tests. |
Why? Unless there's a good reason, you generally want to keep unit tests in the same PR they're testing. It also makes code review easier. This PR is still small so adding in unit tests isn't really an issue. |
Because I want to get it fixed first for the release. It will take me some time to understand the unit test script and write the test cases. |
Targeted support for ESSID generated by iwlist.
Specifically the case for wifi hotspots showing as "Erick\xE2\x80\x99s iPhone" in piaware-config.txt