You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/02/02 09:09:59 UTC

[incubator-plc4x] branch feature/Beckhoff_ADS_protocol updated: added method using short

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch feature/Beckhoff_ADS_protocol
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git


The following commit(s) were added to refs/heads/feature/Beckhoff_ADS_protocol by this push:
     new 5bf610c  added method using short
5bf610c is described below

commit 5bf610ce2f52a2fbe162ceaaa26f26e6d3e5976c
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Feb 2 10:09:55 2018 +0100

    added method using short
---
 .../java/org/apache/plc4x/java/ads/api/generic/types/AMSPort.java     | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/types/AMSPort.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/types/AMSPort.java
index ab8a1c1..767ae7a 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/types/AMSPort.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/types/AMSPort.java
@@ -38,6 +38,10 @@ public class AMSPort extends ByteValue {
         return new AMSPort(values);
     }
 
+    public static AMSPort of(short port) {
+        return new AMSPort(ByteBuffer.allocate(NUM_BYTES).putShort(port).array());
+    }
+
     public static AMSPort of(int port) {
         return new AMSPort(ByteBuffer.allocate(NUM_BYTES).put((byte) (port & 0xff)).array());
     }

-- 
To stop receiving notification emails like this one, please contact
sruehl@apache.org.