correct Radio.connect() and .start_ap() signatures; clean up some code #7249
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.
In the course of testing #6897 (could not reproduce), I found that the signatures for
wifi.Radio.connect()
andwifi.Radio.start_ap()
did not correspond exactly to what these functions took, and that arg validation could use some improvement.wifi.Radio.connect()
andwifi.Radio.start_ap()
.b""
andNone
where appropriate in those methods, rather thanMP_OBJ_NULL
, which doesn't have a direct analog.uint32_t
instead ofuint8_t
for passing around combinations ofAuthMode
, in case there are more than 8 bits in the future. It may be less code anyway.Right now you give multiple AuthModes by putting them in a tuple. But they could be or'd (
|
) together instead now that they are or'able flags. Maybe in the future that should be the preferred way. We could also add combo AuthModes for the combinations Espressif supports, and what CYW43 supports.I used
b""
as the default empty string value. Internally it ismp_const_empty_bytes
. Surprisingly there is nomp_const_empty_str
.I tested
connect()
with a local open access point. I testedstart_ap()
as an open and a password-protected AP. I was able to connect and ping it from a laptop in both cases.