private void doSendWait(final byte[] nsdu) throws KNXLinkClosedException, KNXTimeoutException { nll.con = null; lnk.sendRequestWait(new GroupAddress(0, 0, 1), Priority.LOW, nsdu); // even in router mode, we still get tunnel ind., so always wait try { Thread.sleep(200); } catch (final InterruptedException e) { } assertNotNull(nll.con); }
/** * Test method for {@link KNXNetworkLinkFT12#sendRequest(KNXAddress, * tuwien.auto.calimero.Priority, byte[])}. * * @throws KNXLinkClosedException * @throws KNXTimeoutException * @throws InterruptedException on interrupted thread */ @Test public final void testSendRequest() throws KNXTimeoutException, KNXLinkClosedException, InterruptedException { doSend(new byte[] {0, (byte) (0x80 | 1)}); doSend(new byte[] {0, (byte) (0x80 | 0)}); doSend(new byte[] {0, (byte) (0x80 | 1)}); doSend(new byte[] {0, (byte) (0x80 | 0)}); // send an extended PL frame try { lnk.sendRequestWait( new GroupAddress(0, 0, 1), Priority.LOW, new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte) (0x80 | 0)}); } catch (final KNXIllegalArgumentException e) { } }