本文整理了Java中com.zsmartsystems.zigbee.transaction.ZigBeeTransactionManager.sendTransaction()
方法的一些代码示例,展示了ZigBeeTransactionManager.sendTransaction()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeTransactionManager.sendTransaction()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.transaction.ZigBeeTransactionManager
类名称:ZigBeeTransactionManager
方法名:sendTransaction
[英]Sends a command without waiting for a response
[中]在不等待响应的情况下发送命令
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Sends a command without waiting for a response
*
* @param command the {@link ZigBeeCommand} to send
*/
public void sendTransaction(ZigBeeCommand command) {
sendTransaction(command, null);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void sendTransaction(ZigBeeCommand command) {
transactionManager.sendTransaction(command);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public Future<CommandResult> sendTransaction(ZigBeeCommand command, ZigBeeTransactionMatcher responseMatcher) {
return transactionManager.sendTransaction(command, responseMatcher);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void sendTransaction() {
ZigBeeNetworkManager networkManager = Mockito.mock(ZigBeeNetworkManager.class);
ZigBeeCommand command = Mockito.mock(ZigBeeCommand.class);
Mockito.when(command.getDestinationAddress()).thenReturn(new ZigBeeEndpointAddress(123));
ZigBeeTransactionMatcher responseMatcher = Mockito.mock(ZigBeeTransactionMatcher.class);
ZigBeeNode node = Mockito.mock(ZigBeeNode.class);
Mockito.when(node.getIeeeAddress()).thenReturn(new IeeeAddress("1234567890ABCDEF"));
Mockito.when(networkManager.getNode(123)).thenReturn(node);
ZigBeeTransactionManager transactionManager = new ZigBeeTransactionManager(networkManager);
transactionManager.sendTransaction(command);
Future<CommandResult> cmdResult = transactionManager.sendTransaction(command, responseMatcher);
assertNotNull(cmdResult);
ZigBeeCommand unknownCommand = Mockito.mock(ZigBeeCommand.class);
Mockito.when(unknownCommand.getDestinationAddress()).thenReturn(new ZigBeeEndpointAddress(456));
cmdResult = transactionManager.sendTransaction(unknownCommand, responseMatcher);
// assertNull(cmdResult);
}
内容来源于网络,如有侵权,请联系作者删除!