From 93641e78bc0602e112d5fa0aef248b188c90ec5b Mon Sep 17 00:00:00 2001 From: Jose Damico Date: Fri, 8 Dec 2023 15:55:44 -0300 Subject: [PATCH] first igate impl --- .classpath | 13 ------------- .../org/jdamico/javax25/PacketHandlerImpl.java | 14 ++++++++++++-- .../jdamico/javax25/ax25/Afsk1200Demodulator.java | 9 +++------ .../org/jdamico/javax25/soundcard/Soundcard.java | 3 ++- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.classpath b/.classpath index 6d619b3..5e8a55f 100644 --- a/.classpath +++ b/.classpath @@ -23,18 +23,5 @@ - - - - - - - - - - - - - diff --git a/src/main/java/org/jdamico/javax25/PacketHandlerImpl.java b/src/main/java/org/jdamico/javax25/PacketHandlerImpl.java index 1a9ce5e..c411836 100644 --- a/src/main/java/org/jdamico/javax25/PacketHandlerImpl.java +++ b/src/main/java/org/jdamico/javax25/PacketHandlerImpl.java @@ -20,6 +20,8 @@ */ package org.jdamico.javax25; +import java.util.Date; + import org.jdamico.javax25.ax25.Packet; import org.jdamico.javax25.ax25.PacketHandler; import org.jdamico.javax25.soundcard.Soundcard; @@ -28,15 +30,23 @@ public class PacketHandlerImpl implements PacketHandler { public void handlePacket(byte[] bytes) { + String data = Packet.format(bytes); if(Soundcard.jTextArea == null) { - System.out.println("Packet ====>>>>" +Packet.format(bytes)); + System.out.println("Packet ====>>>>" +data); + + }else { String lines = Soundcard.jTextArea.getText(); if(lines.length() > 80000) lines = "Cleaning log...\n"; - Soundcard.jTextArea.setText(lines+Packet.format(bytes)+"\n"); + Soundcard.jTextArea.setText(lines+data+"\n"); + } + + if(Soundcard.receivedPackedMap != null) { + Date now = new Date(); + Soundcard.receivedPackedMap.put(now.getTime(), data); } return; diff --git a/src/main/java/org/jdamico/javax25/ax25/Afsk1200Demodulator.java b/src/main/java/org/jdamico/javax25/ax25/Afsk1200Demodulator.java index f1ef3f5..e5a496d 100644 --- a/src/main/java/org/jdamico/javax25/ax25/Afsk1200Demodulator.java +++ b/src/main/java/org/jdamico/javax25/ax25/Afsk1200Demodulator.java @@ -19,17 +19,14 @@ */ package org.jdamico.javax25.ax25; -import java.util.Arrays; - -import javax.swing.JTextArea; - -import org.jdamico.javax25.soundcard.Soundcard; +import java.util.Map; public class Afsk1200Demodulator extends PacketDemodulator //implements HalfduplexSoundcardClient { - private float[] td_filter; + +private float[] td_filter; private float[] cd_filter; private int rate_index; diff --git a/src/main/java/org/jdamico/javax25/soundcard/Soundcard.java b/src/main/java/org/jdamico/javax25/soundcard/Soundcard.java index ae280ee..55bd455 100644 --- a/src/main/java/org/jdamico/javax25/soundcard/Soundcard.java +++ b/src/main/java/org/jdamico/javax25/soundcard/Soundcard.java @@ -29,6 +29,7 @@ //import java.util.Arrays; //import java.util.Properties; import java.util.List; +import java.util.Map; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; @@ -45,7 +46,7 @@ public class Soundcard { public static JTextArea jTextArea = null; public static JLabel audioLevelValue = null; - + public static Map receivedPackedMap; public static boolean running = true; private int rate;