use of com.neuronrobotics.sdk.common.MACAddress in project java-bowler by NeuronRobotics.
the class UDPBowlerConnection method getAllAddresses.
/**
* @return
*/
public ArrayList<InetAddress> getAllAddresses() {
if (addrs == null) {
addrs = new ArrayList<InetAddress>();
try {
// Generate a ping command
BowlerDatagram ping = BowlerDatagramFactory.build(new MACAddress(), new PingCommand());
ping.setUpstream(false);
Log.info("Sending synchronization ping: \n" + ping);
// send it to the UDP socket
write(ping.getBytes());
// wait for all devices to report back
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return addrs;
}
Aggregations