本文整理汇总了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()});
}
}
}
}
}
}
示例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;
}
示例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;
}
示例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() });
}
}
}
}
}
}
示例5: getProcessCommunicator
import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
public ProcessCommunicator getProcessCommunicator() {
return pc;
}
示例6: getPc
import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
public final ProcessCommunicator getPc() {
return pc;
}
示例7: setPc
import tuwien.auto.calimero.process.ProcessCommunicator; //导入依赖的package包/类
public void setPc(ProcessCommunicator pc) {
this.pc = pc;
}
示例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();