-
Notifications
You must be signed in to change notification settings - Fork 39
API to get network and WiFi interfaces w/o connecting #61
Conversation
These might be useful, if you want to for example scan the WiFi for access points BEFORE connecting. Any device with UI/keyboard or some external input method would likely use that, rather than have some hard-coded value.
This would enable then |
Yes, makes sense. If mbed OS had something equivalent, it would be a "get default interface" call, not "connect default interface". Having "get specific type" is a good idea - makes sense. It would be useful for the default interface returned from the generic call to be preconfigured with I wonder now, should we have a "get_type" call on NetworkInterface? RTTI is disabled in the compilers, so there's no other way to check if the default interface is actually wifi, as opposed to asking specifically for a wifi interface. Maybe a bit late... |
By printing error messages, instead of just returning NULL, you are forcing inclusion of whole C stdio libraries. |
Yes, please use |
Well, it's behind the boolean flag - if those are |
I said:
I am actually going to add this - turns out I'm going to need it. It will allow code like this:
|
@kjbracey-arm - I was too fast? Anyways, feel free to make another PR and for sure we'll merge it in. |
No, your stuff is fine. What I'm working on was for the future EMAC work, over at ARMmbed/mbed-os#5558 - commit ARMmbed/mbed-os@d32c56d . But we could maybe accelerate that specific "check type" change if it's useful to you - the API could be added now on its own for 5.8. The call works like I think that's probably sufficient and you could live without a "type-id" enum. Only significant draw-back is that you wouldn't be able to neatly switch on the type-id, you'd have to have a chain of "if (wifi), if (cellular)". |
These might be useful, if you want to for example scan the WiFi
for access points BEFORE connecting.
Any device with UI/keyboard or some external input method would
likely use that, rather than have some hard-coded value.