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


Java BinRpcClient类代码示例

本文整理汇总了Java中org.openhab.binding.homematic.internal.communicator.client.BinRpcClient的典型用法代码示例。如果您正苦于以下问题:Java BinRpcClient类的具体用法?Java BinRpcClient怎么用?Java BinRpcClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: start

import org.openhab.binding.homematic.internal.communicator.client.BinRpcClient; //导入依赖的package包/类
/**
 * Starts the communicator and initializes everything.
 */
public void start() {
	if (homematicCallbackServer == null) {
		logger.info("Starting Homematic communicator");
		try {
			homematicCallbackServer = new BinRpcCallbackServer(this);

			itemDisabler = new ItemDisabler();
			itemDisabler.start();
			newDevicesCounter = 0;

			RpcClient rpcClient = new BinRpcClient();
			context.setServerId(rpcClient.getServerId(HmInterface.RF));
			logger.info("Homematic {}", context.getServerId());

			homematicClient = context.getServerId().isHomegear() ? new HomegearClient(rpcClient) : new CcuClient(
					rpcClient);

			context.setHomematicClient(homematicClient);
			homematicClient.start();

			context.getStateHolder().init();
			context.getStateHolder().loadDatapoints();
			context.getStateHolder().loadVariables();

			homematicCallbackServer.start();
			homematicClient.registerCallback();

			scheduleFirstRefresh();

			lastReconnectTime = System.currentTimeMillis();
		} catch (Exception e) {
			logger.error("Could not start Homematic communicator: " + e.getMessage(), e);
			stop();
		}
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:40,代码来源:HomematicCommunicator.java

示例2: startClients

import org.openhab.binding.homematic.internal.communicator.client.BinRpcClient; //导入依赖的package包/类
/**
 * Starts the Homematic gateway client.
 */
protected void startClients() throws IOException {
    for (TransferMode mode : availableInterfaces.values()) {
        if (!rpcClients.containsKey(mode)) {
            rpcClients.put(mode,
                    mode == TransferMode.XML_RPC ? new XmlRpcClient(config) : new BinRpcClient(config));
        }
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:12,代码来源:AbstractHomematicGateway.java

示例3: start

import org.openhab.binding.homematic.internal.communicator.client.BinRpcClient; //导入依赖的package包/类
/**
 * Starts the communicator and initializes everything.
 */
public void start() {
    if (homematicCallbackServer == null) {
        logger.info("Starting Homematic communicator");
        try {
            homematicCallbackServer = new BinRpcCallbackServer(this);

            itemDisabler = new ItemDisabler();
            itemDisabler.start();
            newDevicesCounter = 0;

            RpcClient rpcClient = new BinRpcClient();
            context.setServerId(rpcClient.getServerId(HmInterface.RF));
            logger.info("Homematic {}", context.getServerId());

            homematicClient = context.getServerId().isHomegear() ? new HomegearClient(rpcClient)
                    : new CcuClient(rpcClient);

            context.setHomematicClient(homematicClient);
            homematicClient.start();

            context.getStateHolder().init();
            context.getStateHolder().loadDatapoints();
            context.getStateHolder().loadVariables();

            homematicCallbackServer.start();
            homematicClient.registerCallback();

            scheduleFirstRefresh();

            lastReconnectTime = System.currentTimeMillis();
        } catch (Exception e) {
            logger.error("Could not start Homematic communicator: " + e.getMessage(), e);
            stop();
        }
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:40,代码来源:HomematicCommunicator.java


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