You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by ld...@apache.org on 2020/11/03 23:10:19 UTC

[plc4x] branch feature/socketcan updated (a504312 -> 2d78aea)

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

ldywicki pushed a change to branch feature/socketcan
in repository https://gitbox.apache.org/repos/asf/plc4x.git.


 discard a504312  Update to latest release of JavaCAN.
     new 2d78aea  Update to latest release of JavaCAN.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (a504312)
            \
             N -- N -- N   refs/heads/feature/socketcan (2d78aea)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../plc4x/java/transport/socketcan/netty/SocketCANChannel.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


[plc4x] 01/01: Update to latest release of JavaCAN.

Posted by ld...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ldywicki pushed a commit to branch feature/socketcan
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 2d78aeab5bbebdf988771b96bd1307e8d2859e8b
Author: Ɓukasz Dywicki <lu...@code-house.org>
AuthorDate: Tue Nov 3 23:10:45 2020 +0100

    Update to latest release of JavaCAN.
---
 plc4j/transports/socketcan/pom.xml                               | 2 +-
 .../plc4x/java/transport/socketcan/netty/SocketCANChannel.java   | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/plc4j/transports/socketcan/pom.xml b/plc4j/transports/socketcan/pom.xml
index 0e28c7b..818f009 100644
--- a/plc4j/transports/socketcan/pom.xml
+++ b/plc4j/transports/socketcan/pom.xml
@@ -40,7 +40,7 @@
     <dependency>
       <groupId>tel.schich</groupId>
       <artifactId>javacan</artifactId>
-      <version>2.1.0</version>
+      <version>2.3.0</version>
     </dependency>
 
     <dependency>
diff --git a/plc4j/transports/socketcan/src/main/java/org/apache/plc4x/java/transport/socketcan/netty/SocketCANChannel.java b/plc4j/transports/socketcan/src/main/java/org/apache/plc4x/java/transport/socketcan/netty/SocketCANChannel.java
index b302a7d..f141e9e 100644
--- a/plc4j/transports/socketcan/src/main/java/org/apache/plc4x/java/transport/socketcan/netty/SocketCANChannel.java
+++ b/plc4j/transports/socketcan/src/main/java/org/apache/plc4x/java/transport/socketcan/netty/SocketCANChannel.java
@@ -113,12 +113,12 @@ public class SocketCANChannel extends OioByteStreamChannel {
         loopThread = new Thread(() -> {
             try {
                 while (!isInputShutdown()) {
-                    CanFrame frame = handle.read();
-//                    ByteBuf frameBytes = ByteBufAllocator.DEFAULT.buffer();
+                    ByteBuffer byteBuffer = ByteBuffer.allocateDirect(16);
+                    handle.readUnsafe(byteBuffer);
 //                    frameBytes.writeBytes(frame.getBuffer());
 //                    String dump = ByteBufUtil.prettyHexDump(frameBytes);
 //                    System.out.println(frame + "\n" + dump);
-                    buffer.writeBytes(frame.getBuffer());
+                    buffer.writeBytes(byteBuffer);
                 }
             } catch (IOException e) {
                 logger.warn("Could not read data", e);
@@ -246,8 +246,7 @@ public class SocketCANChannel extends OioByteStreamChannel {
             ByteBuffer buffer = ByteBuffer.allocateDirect(len - off);
             buffer.put(b, off, len);
             buffer.flip();
-            CanFrame frame = CanFrame.create(buffer);
-            rawCanChannel.write(frame);
+            rawCanChannel.writeUnsafe(buffer);
         }
     }