Skip to content

Commit 6136008

Browse files
committed
Use mgmt client impl to query max apdu
1 parent 5a17da3 commit 6136008

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/tuwien/auto/calimero/mgmt/ManagementClientImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ protected byte[] sendWait(final Destination d, final Priority p, final byte[] ap
14191419
return waitForResponse(d.getAddress(), responseServiceType, minAsduLen, maxAsduLen, start, timeout);
14201420
}
14211421

1422-
private int maxApduLength(final Destination dst) throws KNXLinkClosedException, InterruptedException {
1422+
int maxApduLength(final Destination dst) throws KNXLinkClosedException, InterruptedException {
14231423
final Optional<Integer> max = dst.maxApduLength();
14241424
if (max.isPresent())
14251425
return max.get();

src/tuwien/auto/calimero/mgmt/ManagementProceduresImpl.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,7 @@ private void sendDD0Read(final Destination dst) throws KNXLinkClosedException {
918918
private int readMaxApduLength(final Destination d) throws InterruptedException
919919
{
920920
try {
921-
final byte[] data = mc.readProperty(d, DEVICE_OBJECT_INDEX, PropertyAccess.PID.MAX_APDULENGTH, 1, 1);
922-
return toUnsigned(data);
921+
return ((ManagementClientImpl) mc).maxApduLength(d);
923922
}
924923
catch (final KNXException e) {
925924
return defaultApduLength;
@@ -931,11 +930,6 @@ private static void waitFor(final int ms) throws InterruptedException
931930
Thread.sleep(ms);
932931
}
933932

934-
private static int toUnsigned(final byte[] data)
935-
{
936-
return ((data[0] & 0xff) << 8) | (data[1] & 0xff);
937-
}
938-
939933
private static boolean isOddParity(final int bite)
940934
{
941935
int parity = bite ^ (bite >> 4);

0 commit comments

Comments
 (0)