当前位置: 首页>>代码示例>>Java>>正文


Java KNXNetworkLinkIP.TUNNEL属性代码示例

本文整理汇总了Java中tuwien.auto.calimero.link.KNXNetworkLinkIP.TUNNEL属性的典型用法代码示例。如果您正苦于以下问题:Java KNXNetworkLinkIP.TUNNEL属性的具体用法?Java KNXNetworkLinkIP.TUNNEL怎么用?Java KNXNetworkLinkIP.TUNNEL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在tuwien.auto.calimero.link.KNXNetworkLinkIP的用法示例。


在下文中一共展示了KNXNetworkLinkIP.TUNNEL属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createLink

/**
 * Creates the KNX network link to access the network specified in
 * <code>options</code>.
 * <p>
 *
 * @return the KNX network link
 * @throws KNXException on problems on link creation
 */
private KNXNetworkLink createLink() throws KNXException
{
	final KNXMediumSettings medium = (KNXMediumSettings) options.get("medium");
	if (options.containsKey("serial")) {
		// create FT1.2 network link
		final String p = (String) options.get("serial");
		try {
			return new KNXNetworkLinkFT12(Integer.parseInt(p), medium);
		}
		catch (final NumberFormatException e) {
			return new KNXNetworkLinkFT12(p, medium);
		}
	}
	// create local and remote socket address for network link
	final InetSocketAddress local = createLocalSocket((InetAddress)
		options.get("localhost"), (Integer) options.get("localport"));
	final InetSocketAddress host = new InetSocketAddress((InetAddress)
		options.get("host"), ((Integer) options.get("port")).intValue());
	final int mode = options.containsKey("routing") ? KNXNetworkLinkIP.ROUTER
		: KNXNetworkLinkIP.TUNNEL;
	return new KNXNetworkLinkIP(mode, local, host, options.containsKey("nat"),
		medium);
}
 
开发者ID:gskbyte,项目名称:kora,代码行数:31,代码来源:ProcComm.java

示例2: createLink

private KNXNetworkLink createLink(String localhostIface,String gatewayIface) throws KNXException {
    try {
        InetAddress localhost = InetAddress.getByName(localhostIface);
        InetAddress gatewayHost = InetAddress.getByName(gatewayIface);
        final InetSocketAddress local = createLocalSocket(localhost, null);
        final InetSocketAddress host = new InetSocketAddress(gatewayHost,
                KNXnetIPConnection.IP_PORT);
        final int mode = KNXNetworkLinkIP.TUNNEL;

        LOG.info("Mode {} local {} host {}",new Object[]{mode,local,host});

        return new KNXNetworkLinkIP(mode, local, host, false,
                TPSettings.TP1);

    } catch (UnknownHostException e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:19,代码来源:KNXLinkManager.java

示例3: openConnection

private void openConnection() throws SocketException, KNXException {
	m_link = new KNXNetworkLinkIP(KNXNetworkLinkIP.TUNNEL,
			new InetSocketAddress(getIPAddr(), 6378),
			new InetSocketAddress(m_GatewayIP, 3671), false, m_settings);
	m_comm = new ProcessCommunicatorImpl(m_link);
	m_comm.addProcessListener(this);
}
 
开发者ID:heia-fr,项目名称:wot_gateways,代码行数:7,代码来源:KNXComm.java


注:本文中的tuwien.auto.calimero.link.KNXNetworkLinkIP.TUNNEL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。