gpt4 book ai didi

com.zsmartsystems.zigbee.ZigBeeEndpoint.sendTransaction()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 07:43:31 25 4
gpt4 key购买 nike

本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpoint.sendTransaction()方法的一些代码示例,展示了ZigBeeEndpoint.sendTransaction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeEndpoint.sendTransaction()方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeEndpoint
类名称:ZigBeeEndpoint
方法名:sendTransaction

ZigBeeEndpoint.sendTransaction介绍

[英]Sends ZigBee command without waiting for response.
[中]在不等待响应的情况下发送ZigBee命令。

代码示例

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

private void createEndpoint() {
  endpoint = Mockito.mock(ZigBeeEndpoint.class);
  Mockito.when(endpoint.getEndpointId()).thenReturn(5);
  Mockito.when(endpoint.getEndpointAddress()).thenReturn(new ZigBeeEndpointAddress(1234, 5));
  commandCapture = ArgumentCaptor.forClass(ZigBeeCommand.class);
  matcherCapture = ArgumentCaptor.forClass(ZigBeeTransactionMatcher.class);
  Mockito.when(endpoint.sendTransaction(commandCapture.capture(), matcherCapture.capture())).thenReturn(null);
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

protected Future<CommandResult> send(ZclCommand command) {
  if (isClient()) {
    command.setCommandDirection(ZclCommandDirection.SERVER_TO_CLIENT);
  }
  command.setApsSecurity(apsSecurityRequired);
  return zigbeeEndpoint.sendTransaction(command, new ZclTransactionMatcher());
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

/**
 * Sends a default response to the client
 *
 * @param transactionId the transaction ID to use in the response
 * @param commandIdentifier the command identifier to which this is a response
 * @param status the {@link ZclStatus} to send in the response
 */
public void sendDefaultResponse(Integer transactionId, Integer commandIdentifier, ZclStatus status) {
  DefaultResponse defaultResponse = new DefaultResponse();
  defaultResponse.setTransactionId(transactionId);
  defaultResponse.setCommandIdentifier(commandIdentifier);
  defaultResponse.setDestinationAddress(zigbeeEndpoint.getEndpointAddress());
  defaultResponse.setClusterId(clusterId);
  defaultResponse.setStatusCode(status);
  zigbeeEndpoint.sendTransaction(defaultResponse);
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

/**
 * Adds a binding from the cluster to the destination {@link ZigBeeEndpoint}.
 *
 * @param address the destination {@link IeeeAddress}
 * @param endpointId the destination endpoint ID
 * @return Command future
 */
public Future<CommandResult> bind(IeeeAddress address, int endpointId) {
  final BindRequest command = new BindRequest();
  command.setDestinationAddress(new ZigBeeEndpointAddress(zigbeeEndpoint.getEndpointAddress().getAddress()));
  command.setSrcAddress(zigbeeEndpoint.getIeeeAddress());
  command.setSrcEndpoint(zigbeeEndpoint.getEndpointId());
  command.setBindCluster(clusterId);
  command.setDstAddrMode(3); // 64 bit addressing
  command.setDstAddress(address);
  command.setDstEndpoint(endpointId);
  return zigbeeEndpoint.sendTransaction(command, new BindRequest());
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

/**
 * Removes a binding from the cluster to the destination {@link ZigBeeEndpoint}.
 *
 * @param address the destination {@link IeeeAddress}
 * @param endpointId the destination endpoint ID
 * @return Command future
 */
public Future<CommandResult> unbind(IeeeAddress address, int endpointId) {
  final UnbindRequest command = new UnbindRequest();
  command.setDestinationAddress(new ZigBeeEndpointAddress(zigbeeEndpoint.getEndpointAddress().getAddress()));
  command.setSrcAddress(zigbeeEndpoint.getIeeeAddress());
  command.setSrcEndpoint(zigbeeEndpoint.getEndpointId());
  command.setBindCluster(clusterId);
  command.setDstAddrMode(3); // 64 bit addressing
  command.setDstAddress(address);
  command.setDstEndpoint(endpointId);
  return zigbeeEndpoint.sendTransaction(command, new UnbindRequest());
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com