diff src/com/five_ten_sg/connectbot/transport/TN5250.java @ 69:294435151b0c tn5250

use 5250 encryption config entry
author Carl Byington <carl@five-ten-sg.com>
date Fri, 13 Jun 2014 19:06:01 -0700
parents cc7e3588a0f3
children 7ae9b0c382ec
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/transport/TN5250.java	Fri Jun 13 16:24:59 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java	Fri Jun 13 19:06:01 2014 -0700
@@ -130,24 +130,39 @@
             Log.d(TAG, s);
         }
 
-        // terminal key listener sending to the host
+        // monitor injecting a field
+        @Override
+        public void setField(int l, int c, char [] d) {
+            screen52.setField(l, c, d);
+        }
+
+        // terminal key listener sending to local screen
         @Override
         public void write(byte[] b) {
+            if (bridge.monitor != null) bridge.monitor.hostData(b);
             screen52.sendKeys(new String(b));
         }
         @Override
         public void write(int b) {
+            if (bridge.monitor != null) bridge.monitor.hostData(b);
             screen52.sendKeys(new String(new byte[] {(byte)b}));
         }
         @Override
         public void keyPressed(int keyCode, char keyChar, int modifiers) {
-            String s;
             if (mnemonics.containsKey(keyCode)) {
-                s = mnemonics.get(keyCode);
-                if (s != "") screen52.sendKeys(s);
+                String s = mnemonics.get(keyCode);
+                if (s != "") {
+                    if (bridge.monitor != null) bridge.monitor.hostData(s);
+                    screen52.sendKeys(s);
+                }
             }
         }
         // 5250 writing to the screen
+        // test for changed screen contents
+        @Override
+        public void testChanged() {
+            if (bridge.monitor != null) bridge.monitor.testChanged();
+        }
         @Override
         public void putChar(int c, int l, char ch, int attributes) {
             if (bridge.monitor != null) bridge.monitor.screenChanged(l, c);
@@ -230,7 +245,7 @@
         handler.setSSLType(encryption);
         screen52.setVT(handler);
         screen52.setBuffer(buffer);
-        connected = handler.connect(host.getHostname(), host.getPort());
+        connected = handler.connect(host.getHostname(), host.getPort(), buffer);
         if (connected) bridge.onConnected();
     }