2

I am using Jacob to find out the MAC addresses of all access points that are detected by my wireless NIC.

According to WMI documentation Ndis80211BSSIList is: "The list of in-range BSSIDs and their properties". As far as I can understand it returns an array of objects of the Class MSNdis_80211_WLanBssId, that each of them has some properties.

My question is how I can access these properties of each of these instances (each instance is a different BSSID with properties such as MAC Address or SSID). Any help would be valuable.

    public class testWMIJacob {

        public static void main(String[] args) {
                String host = "localhost";  

                String connectStr = String.format("winmgmts:\\\\%s\\root\\wmi", host); 


                String query = "SELECT * FROM MSNdis_80211_BSSIList ";

                ActiveXComponent axWMI = new ActiveXComponent(connectStr);                
                Variant vCollection = axWMI.invoke("ExecQuery", new Variant(query));               

                EnumVariant enumVariant = new EnumVariant(vCollection.toDispatch());
                Dispatch item = null;                
                while (enumVariant.hasMoreElements()) {                    
                        item = enumVariant.nextElement().toDispatch();                          

                        String req = Dispatch.call(item,"Ndis80211BSSIList").toString();    
                }
        }

}
SomeWittyUsername
  • 18,025
  • 3
  • 42
  • 85
user1304490
  • 181
  • 2
  • 2
  • 11

0 Answers0