> Alternatively, we could somehow mark these networks
> they're done via the ConnectHiddenNetwork() path.
I was also thinking about this possibility. Do you think that the hidden network shall
be removed if an error occurs during connection, for example in station_connect_cb?
Actually, that is a good point. We do not hide the hidden network in this case.
It sort of depends on what we want to do about this. Some possible strategies
When ConnectHiddenNetwork is invoked (in the scan results callback), mark the
network as 'provisioning-hidden'.
1. On a passphrase failure, or connect failure wipe it from the scan result
cache, per your proposal.
2. Leave the network in the cache on failure, allow the scan-results to be
re-used for subsequent ConnectHiddenNetwork calls. Disallow Network.Connect()
call if the 'provisioning-hidden' flag is set on the network.
3. Similar to 2, but allow Network.Connect() to proceed normally and simply set
the NET_HIDDEN value based on the 'provisioning-hidden' flag.
Approach 2 & 3 avoids unnecessary scanning in case the user enters the wrong
password. On the other hand, approach 1 ensures there's no temporary network
left around on failure and that seems a bit cleaner.
Do note that in all cases we still end up creating a temporary Network object
while the connection is in progress. And in theory Network.Connect could be
invoked on that object, but it would bounce with an InProgress error.