From f06981107da5b96ef6d99d36af838126b99d4b88 Mon Sep 17 00:00:00 2001 From: SammyIAm Date: Fri, 11 May 2018 22:45:54 -0700 Subject: [PATCH] Fixing some minor pong-handling issues. --- Arduino/Moppy/src/MoppyNetworks/MoppySerial.cpp | 2 +- .../java/com/moppy/control/gui/netpanel/NetworkPanel.java | 2 ++ .../main/java/com/moppy/core/comms/bridge/BridgeSerial.java | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Arduino/Moppy/src/MoppyNetworks/MoppySerial.cpp b/Arduino/Moppy/src/MoppyNetworks/MoppySerial.cpp index 2eb65b7..9da40b2 100644 --- a/Arduino/Moppy/src/MoppyNetworks/MoppySerial.cpp +++ b/Arduino/Moppy/src/MoppyNetworks/MoppySerial.cpp @@ -91,6 +91,6 @@ void MoppySerial::readMessages() { } void MoppySerial::sendPong() { - Serial.write(pongBytes, 7); + Serial.write(pongBytes, sizeof(pongBytes)); } diff --git a/Java/MoppyControlGUI/src/main/java/com/moppy/control/gui/netpanel/NetworkPanel.java b/Java/MoppyControlGUI/src/main/java/com/moppy/control/gui/netpanel/NetworkPanel.java index 43d2e07..7f1538e 100644 --- a/Java/MoppyControlGUI/src/main/java/com/moppy/control/gui/netpanel/NetworkPanel.java +++ b/Java/MoppyControlGUI/src/main/java/com/moppy/control/gui/netpanel/NetworkPanel.java @@ -40,6 +40,7 @@ private void updateBridgesList() { }); netBridgesPanel.revalidate(); + netBridgesPanel.repaint(); } private void updateDevicesList() { @@ -53,6 +54,7 @@ private void updateDevicesList() { }); netDevicesPanel.revalidate(); + netDevicesPanel.repaint(); } @Override diff --git a/Java/MoppyLib/src/main/java/com/moppy/core/comms/bridge/BridgeSerial.java b/Java/MoppyLib/src/main/java/com/moppy/core/comms/bridge/BridgeSerial.java index 1fdecda..a7b718f 100644 --- a/Java/MoppyLib/src/main/java/com/moppy/core/comms/bridge/BridgeSerial.java +++ b/Java/MoppyLib/src/main/java/com/moppy/core/comms/bridge/BridgeSerial.java @@ -113,8 +113,8 @@ public void run() { messageConsumer.acceptNetworkMessage(MoppyMessageFactory.networkReceivedFromBytes( Arrays.copyOf(buffer, totalMessageLength), BridgeSerial.class.getName(), - serialPort.getDescriptivePortName(), - null)); + serialPort.getSystemPortName(), + "Serial Device")); // Serial ports don't really have a remote address } } } catch (IOException ex) {