I think you may have a WiFi card in monitor mode, scanning each channel for beacons. On Linux, aircrack-ng is the toolbox you are looking for. airodump-ng is a tool that shows you a list of devices located around your location. It is designed to display the first hot spots with potential customers, but also shows all devices that are connected to an access point or trying to determine an access point.
However, you cannot scan devices with a disconnected WiFi connection. I'm not sure about non-AP devices, I guess you can detect them if they send beacons anyway (for example, to detect Wi-Fi hotspots).
If you need it in Java, you can write a shell in airodump-ng or run airodump-ng as a service that outputs a file and read the file from a Java application.
There is no specific answer. I'm afraid, but I hope this helps you find a way to solve your problem.
source share