本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpoint.sendTransaction()
方法的一些代码示例,展示了ZigBeeEndpoint.sendTransaction()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeEndpoint.sendTransaction()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeEndpoint
类名称: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());
}
内容来源于网络,如有侵权,请联系作者删除!