dheeps
dheeps

Reputation: 173

NetworkInterface is a Wifi Interface?

How to find wifi network interface from the returned result of

NetworkInterface.getNetworkInterfaces();

Upvotes: 0

Views: 648

Answers (2)

Thomas Grosser
Thomas Grosser

Reputation: 1

Solution for windows 10 (and probably other platforms):
NetworkInterface.getName() returns a name of pattern <interface type>[<index>], where interface type is one of "lo", "wlan", "eth", "ppp", "net". So your interface's name needs to match the regular expression "wlan\d+".
For searching a wifi adapter among the enumeration NetworkInterface.getNetworkInterfaces() you may also filter by NetworkInterface.isUp(), NetworkInterface.isLoopback() .

Upvotes: 0

Evan Mulawski
Evan Mulawski

Reputation: 55334

That information cannot be obtained using Java. You can only retrieve the interface's name and address(es).

Upvotes: 1

Related Questions