本文整理汇总了Java中org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector类的典型用法代码示例。如果您正苦于以下问题:Java RFXComSerialConnector类的具体用法?Java RFXComSerialConnector怎么用?Java RFXComSerialConnector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RFXComSerialConnector类属于org.openhab.binding.rfxcom.internal.connector包,在下文中一共展示了RFXComSerialConnector类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector; //导入依赖的package包/类
public void activate() {
logger.debug("Activate");
RFXComSerialConnector connector = RFXComConnection.getCommunicator();
if (connector != null) {
connector.addEventListener(eventLister);
}
}
示例2: deactivate
import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector; //导入依赖的package包/类
public void deactivate() {
logger.debug("Deactivate");
RFXComSerialConnector connector = RFXComConnection.getCommunicator();
if (connector != null) {
connector.removeEventListener(eventLister);
}
}
示例3: executeCommand
import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector; //导入依赖的package包/类
/**
*
* @return true if the command was successfully sent, false otherwise
*/
private boolean executeCommand(String itemName, Type command) {
final RFXComBindingProvider provider = findFirstMatchingBindingProvider(itemName);
if (provider == null) {
logger.warn(
"Cannot execute command because no binding provider was found for itemname '{}'",
itemName);
return false;
}
if (!provider.isInBinding(itemName)) {
logger.debug(
"Received command (item='{}', state='{}', class='{}')",
new Object[] { itemName, command.toString(),
command.getClass().toString() });
RFXComSerialConnector connector = RFXComConnection
.getCommunicator();
if (connector == null) {
logger.warn("RFXCom controller is not initialized!");
return false;
}
if(!connector.isConnected()) {
logger.warn("RFXCom controller is not connected");
return false;
}
return executeCommand0(itemName, command, provider, connector);
}
else {
logger.warn(
"Provider is not in binding '{}'",
provider.toString());
return false;
}
}
示例4: activate
import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector; //导入依赖的package包/类
@Override
public void activate() {
logger.debug("Activate");
RFXComSerialConnector connector = RFXComConnection.getCommunicator();
if (connector != null) {
connector.addEventListener(eventLister);
}
}
示例5: deactivate
import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector; //导入依赖的package包/类
@Override
public void deactivate() {
logger.debug("Deactivate");
RFXComSerialConnector connector = RFXComConnection.getCommunicator();
if (connector != null) {
connector.removeEventListener(eventLister);
}
}
示例6: executeCommand
import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector; //导入依赖的package包/类
/**
*
* @return true if the command was successfully sent, false otherwise
*/
private boolean executeCommand(String itemName, Type command) {
final RFXComBindingProvider provider = findFirstMatchingBindingProvider(itemName);
if (provider == null) {
logger.warn("Cannot execute command because no binding provider was found for itemname '{}'", itemName);
return false;
}
if (!provider.isInBinding(itemName)) {
logger.debug("Received command (item='{}', state='{}', class='{}')",
new Object[] { itemName, command.toString(), command.getClass().toString() });
RFXComSerialConnector connector = RFXComConnection.getCommunicator();
if (connector == null) {
logger.warn("RFXCom controller is not initialized!");
return false;
}
if (!connector.isConnected()) {
logger.warn("RFXCom controller is not connected");
return false;
}
return executeCommand0(itemName, command, provider, connector);
} else {
logger.warn("Provider is not in binding '{}'", provider.toString());
return false;
}
}
示例7: getCommunicator
import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector; //导入依赖的package包/类
/**
* Returns the RFXCOM client for communicating to the controller. The link
* can be null, if it has not (yet) been established successfully.
*
* @return instance to current RFXCOM client.
*/
public static synchronized RFXComSerialConnector getCommunicator() {
return connector;
}
示例8: getCommunicator
import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector; //导入依赖的package包/类
/**
* Returns the RFXCOM client for communicating to the controller. The link
* can be null, if it has not (yet) been established successfully.
*
* @return instance to current RFXCOM client.
*/
public static synchronized RFXComSerialConnector getCommunicator() {
return connector;
}