- /**
- * getAddressListArp() method gets list of IP addresses from arp command
- * <p>
- * This method sends an inquiry to the router to look for
- * the list of DHCP leased addresses and their mapping to MAC
- * addresses
- *
- * @param strRouterAddress String that contains address of router
- */
- public void getAddressListArp(String strRouterAddress) {
-
- //HashMap<String,String> hmMACToIPAdd = new HashMap<String,String>();
- try {
- // We replace with "cat /usr/sbin/arp"
- String cmd = "ssh " + STR_SSH_USERNAME_RASPBERRYPI + "@" + strRouterAddress +
- " /usr/sbin/arp -n";
- Runtime runtime = Runtime.getRuntime();
- Process process = runtime.exec(cmd);
-
- InputStream inStream = process.getInputStream();
- InputStreamReader isReader = new InputStreamReader(inStream);
- BufferedReader bReader = new BufferedReader(isReader);
- String strRead = null;
- while((strRead = bReader.readLine()) != null){
- String[] str = strRead.split("\\s+");
- // Skip if "(incomplete)" is seen!
- if (str[1].equals(STR_INCOMPLETE))
- continue;
- mapMACtoIPAdd.put(str[2], str[0]);
- }
- } catch (IOException ex) {
- System.out.println("RouterConfig: IOException: " + ex.getMessage());
- ex.printStackTrace();
- }
+ /**
+ * getAddressListArp() method gets list of IP addresses from arp command
+ * <p>
+ * This method sends an inquiry to the router to look for
+ * the list of DHCP leased addresses and their mapping to MAC
+ * addresses
+ *
+ * @param strRouterAddress String that contains address of router
+ */
+ public void getAddressListArp(String strRouterAddress) {
+
+ try {
+ // We replace with "cat /usr/sbin/arp"
+ String cmd = "ssh " + STR_SSH_USERNAME_RASPBERRYPI + "@" + strRouterAddress +
+ " /usr/sbin/arp -n";
+ Runtime runtime = Runtime.getRuntime();
+ Process process = runtime.exec(cmd);
+
+ InputStream inStream = process.getInputStream();
+ InputStreamReader isReader = new InputStreamReader(inStream);
+ BufferedReader bReader = new BufferedReader(isReader);
+ String strRead = null;
+ while((strRead = bReader.readLine()) != null) {
+ String[] str = strRead.split("\\s+");
+ // Skip if "(incomplete)" is seen!
+ if (str[1].equals(STR_INCOMPLETE))
+ continue;
+ mapMACtoIPAdd.put(str[2], str[0]);
+ }
+ } catch (IOException ex) {
+ System.out.println("RouterConfig: IOException: " + ex.getMessage());
+ ex.printStackTrace();