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


Java ProcessCommunicator类代码示例

本文整理汇总了Java中tuwien.auto.calimero.process.ProcessCommunicator的典型用法代码示例。如果您正苦于以下问题:Java ProcessCommunicator类的具体用法?Java ProcessCommunicator怎么用?Java ProcessCommunicator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: writeToKNX

import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
private void writeToKNX(String itemName, Type value) {
	Iterable<Datapoint> datapoints = getDatapoints(itemName, value.getClass());
	if (datapoints != null) {
		ProcessCommunicator pc = KNXConnection.getCommunicator();
		if (pc != null) {
			for (Datapoint datapoint : datapoints) {
				try {
					pc.write(datapoint, toDPTValue(value, datapoint.getDPT()));
					logger.debug("Wrote value '{}' to datapoint '{}'", value, datapoint);
				} catch (KNXException e) {
					logger.warn("Value '{}' could not be sent to the KNX bus using datapoint '{}' - retrying one time: {}",
							new Object[]{value, datapoint, e.getMessage()});
					try {
						// do a second try, maybe the reconnection was successful
						pc = KNXConnection.getCommunicator();
						pc.write(datapoint, toDPTValue(value, datapoint.getDPT()));
						logger.debug("Wrote value '{}' to datapoint '{}' on second try", value, datapoint);
					} catch (KNXException e1) {
						logger.error("Value '{}' could not be sent to the KNX bus using datapoint '{}' - giving up after second try: {}",
								new Object[]{value, datapoint, e1.getMessage()});
					}
				}
			}
		}
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:27,代码来源:KNXBinding.java

示例2: getCommunicator

import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
/**
 * Returns the KNXNetworkLink for talking to the KNX bus.
 * The link can be null, if it has not (yet) been established successfully.
 * 
 * @return the KNX network link
 */
public static synchronized ProcessCommunicator getCommunicator() {
	if(sLink!=null && !sLink.isOpen()) {
		connect();
	}
	return sPC;
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:13,代码来源:KNXConnection.java

示例3: getCommunicator

import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
/**
 * Returns the KNXNetworkLink for talking to the KNX bus.
 * The link can be null, if it has not (yet) been established successfully.
 * 
 * @return the KNX network link
 */
public static synchronized ProcessCommunicator getCommunicator() {
    if (sLink != null && !sLink.isOpen()) {
        connect();
    }
    return sPC;
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:13,代码来源:KNXConnection.java

示例4: writeToKNX

import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
private void writeToKNX(String itemName, Type value) {
    Iterable<Datapoint> datapoints = getDatapoints(itemName, value.getClass());
    if (datapoints != null) {
        ProcessCommunicator pc = KNXConnection.getCommunicator();
        if (pc != null) {
            for (Datapoint datapoint : datapoints) {
                try {
                    pc.write(datapoint, toDPTValue(value, datapoint.getDPT()));
                    logger.debug("Wrote value '{}' to datapoint '{}'", value, datapoint);
                } catch (KNXException e) {
                    logger.warn(
                            "Value '{}' could not be sent to the KNX bus using datapoint '{}' - retrying one time: {}",
                            new Object[] { value, datapoint, e.getMessage() });
                    try {
                        // do a second try, maybe the reconnection was successful
                        pc = KNXConnection.getCommunicator();
                        pc.write(datapoint, toDPTValue(value, datapoint.getDPT()));
                        logger.debug("Wrote value '{}' to datapoint '{}' on second try", value, datapoint);
                    } catch (KNXException e1) {
                        logger.error(
                                "Value '{}' could not be sent to the KNX bus using datapoint '{}' - giving up after second try: {}",
                                new Object[] { value, datapoint, e1.getMessage() });
                    }
                }
            }
        }
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:29,代码来源:KNXBinding.java

示例5: getProcessCommunicator

import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
public ProcessCommunicator getProcessCommunicator() {
    return pc;
}
 
开发者ID:jpinho,项目名称:soaba,代码行数:4,代码来源:KNXGatewayDriver.java

示例6: getPc

import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
public final ProcessCommunicator getPc() {
    return pc;
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:4,代码来源:KNXDeviceAbstract.java

示例7: setPc

import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
public void setPc(ProcessCommunicator pc) {
    this.pc = pc;
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:4,代码来源:KNXDeviceAbstract.java

示例8: getPc

import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
/**
 * ProcessCommunicator a network link that allows to send and receive message from/to the bus
 * @return
 */
public ProcessCommunicator getPc();
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:6,代码来源:KNXDevice.java


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