use of tuwien.auto.calimero.IndividualAddress in project openhab1-addons by openhab.
the class KNXConnection method connectByIp.
private static KNXNetworkLink connectByIp(int ipConnectionType, String localIp, String ip, int port) throws KNXException, UnknownHostException, InterruptedException {
InetSocketAddress localEndPoint = null;
if (StringUtils.isNotBlank(localIp)) {
localEndPoint = new InetSocketAddress(localIp, 0);
} else {
try {
InetAddress localHost = InetAddress.getLocalHost();
localEndPoint = new InetSocketAddress(localHost, 0);
} catch (UnknownHostException uhe) {
sLogger.warn("Couldn't find an IP address for this host. Please check the .hosts configuration or use the 'localIp' parameter to configure a valid IP address.");
}
}
return new KNXNetworkLinkIP(ipConnectionType, localEndPoint, new InetSocketAddress(ip, port), sUseNAT, new TPSettings(new IndividualAddress(sLocalSourceAddr), true));
}
Aggregations