本文整理了Java中com.zsmartsystems.zigbee.ZigBeeApsFrame.getDestinationAddress()
方法的一些代码示例,展示了ZigBeeApsFrame.getDestinationAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeApsFrame.getDestinationAddress()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeApsFrame
类名称:ZigBeeApsFrame
方法名:getDestinationAddress
暂无
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
new ZigBeeEndpointAddress(apsFrame.getDestinationAddress(), apsFrame.getDestinationEndpoint()));
command.setApsSecurity(apsFrame.getSecurityEnabled());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testNodeNetworkAddressUpdate() {
mockedTransport = Mockito.mock(ZigBeeTransportTransmit.class);
mockedApsFrameListener = ArgumentCaptor.forClass(ZigBeeApsFrame.class);
ZigBeeNetworkManager networkManager = new ZigBeeNetworkManager(mockedTransport);
ZigBeeNode node = new ZigBeeNode(networkManager, new IeeeAddress("12345678990ABCDEF"));
node.setNetworkAddress(12345);
ZigBeeEndpoint endpoint = new ZigBeeEndpoint(node, 1);
ZclOnOffCluster cluster = new ZclOnOffCluster(endpoint);
networkManager.setSerializer(DefaultSerializer.class, DefaultDeserializer.class);
Mockito.doNothing().when(mockedTransport).sendCommand(mockedApsFrameListener.capture());
cluster.onCommand();
assertEquals(12345, mockedApsFrameListener.getValue().getDestinationAddress());
node.setNetworkAddress(54321);
cluster.offCommand();
assertEquals(54321, mockedApsFrameListener.getValue().getDestinationAddress());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void sendCommand(final ZigBeeApsFrame apsFrame) {
synchronized (networkManager) {
final short sender;
if (apsFrame.getProfile() == 0) {
sender = 0;
} else {
sender = (short) getSendingEndpoint(apsFrame.getProfile());
}
// TODO: How to differentiate group and device addressing?????
boolean groupCommand = false;
if (!groupCommand) {
networkManager.sendCommand(new AF_DATA_REQUEST(apsFrame.getDestinationAddress(),
(short) apsFrame.getDestinationEndpoint(), sender, apsFrame.getCluster(),
apsFrame.getApsCounter(), (byte) 0x30, (byte) apsFrame.getRadius(), apsFrame.getPayload()));
} else {
networkManager.sendCommand(new AF_DATA_REQUEST_EXT(apsFrame.getDestinationAddress(), sender,
apsFrame.getCluster(), apsFrame.getApsCounter(), (byte) (0), (byte) 0, apsFrame.getPayload()));
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void sendCommand(final ZigBeeApsFrame apsFrame) {
ConBeeEnqueueSendDataRequest request = new ConBeeEnqueueSendDataRequest();
request.setRequestId(apsFrame.getApsCounter());
request.setClusterId(apsFrame.getCluster());
switch (apsFrame.getAddressMode()) {
case DEVICE:
request.setDestinationAddress(
new ZigBeeEndpointAddress(apsFrame.getDestinationAddress(), apsFrame.getDestinationEndpoint()));
request.setDestinationAddressMode(ConBeeAddressMode.NWK);
if (apsFrame.getDestinationAddress() > 0xfff8) {
//
request.setTxOptions(0);
}
break;
case GROUP:
request.setDestinationAddress(new ZigBeeGroupAddress(apsFrame.getDestinationAddress()));
request.setDestinationAddressMode(ConBeeAddressMode.GROUP);
break;
default:
break;
}
request.setProfileId(apsFrame.getProfile());
request.setRadius(apsFrame.getRadius());
request.setSourceEndpoint(apsFrame.getSourceEndpoint());
// request.setTxOptions(txOptions);
request.setAdsuData(apsFrame.getPayload());
conbeeHandler.queueFrame(request);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testSendCommandZCL() {
ZigBeeNetworkManager networkManager = mockZigBeeNetworkManager();
networkManager.setSerializer(DefaultSerializer.class, DefaultDeserializer.class);
ZigBeeEndpointAddress deviceAddress = new ZigBeeEndpointAddress(1234, 56);
OnCommand cmd = new OnCommand();
cmd.setClusterId(6);
cmd.setDestinationAddress(deviceAddress);
boolean error = false;
networkManager.sendCommand(cmd);
assertFalse(error);
assertEquals(1, mockedApsFrameListener.getAllValues().size());
ZigBeeApsFrame apsFrame = mockedApsFrameListener.getValue();
assertEquals(ZigBeeNwkAddressMode.DEVICE, apsFrame.getAddressMode());
assertEquals(1234, apsFrame.getDestinationAddress());
assertEquals(0, apsFrame.getSourceAddress());
assertEquals(0x104, apsFrame.getProfile());
assertEquals(6, apsFrame.getCluster());
assertEquals(56, apsFrame.getDestinationEndpoint());
}
内容来源于网络,如有侵权,请联系作者删除!