Are these devices on the same local network as the computer running the B4J program? If so, check out the jNetwork library, with which you can create Sockets and ServerSockets:
https://www.b4x.com/b4j/help/jnetwork.html .
Accessing low-level WiFi stuff (like getting SSIDs) doesn't appear to possible in pure Java; you'll have to use some native access to do that:
http://stackoverflow.com/questions/5378103/finding-ssid-of-a-wireless-network-with-java . The last answer at the SO link has a Java program just calling a command line utility in Windows and reading the output to get the SSIDs.