Hi, folks.
I'm trying to find out where a end host is connected to. To do this, I'm getting the src ConnectPoint and after that I get the deviceID and the hostId.
But the problem is: when I try to print the deviceID on Log, the deviceID is not shown (just whitespaces are printed where the deviceID should be. I attached a screenshot for better visualization). When I try to get the MAC address, I get the following exception: "java.lang.IllegalStateException: Connection point not associated with an end-station host"
Maybe a piece of code help you to understand where I'm stuck:
for (Link link : links) {
ConnectPoint src = link.src();
String deviceId = ((src.deviceId()).toString());
String macAddr = ((src.hostId().mac()).toString());
log.info("deviceId = ", deviceId);
log.info("macAddr = ", macAddr);
}
Is this the right way to obtain the device's ID and the end host's MAC address?
Thank you in advance.