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


Java RFXComSerialConnector类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:8,代码来源:RFXComBinding.java

示例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);
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:8,代码来源:RFXComBinding.java

示例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;
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:42,代码来源:RFXComBinding.java

示例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);
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:9,代码来源:RFXComBinding.java

示例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);
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:9,代码来源:RFXComBinding.java

示例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;
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:34,代码来源:RFXComBinding.java

示例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;
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:10,代码来源:RFXComConnection.java

示例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;
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:10,代码来源:RFXComConnection.java


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