本文整理汇总了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();
}
}
}
示例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));
}
}
}
示例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();
}
}
}