comparison 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
comparison
equal deleted inserted replaced
68:cc7e3588a0f3 69:294435151b0c
128 @Override 128 @Override
129 public void debug(String s) { 129 public void debug(String s) {
130 Log.d(TAG, s); 130 Log.d(TAG, s);
131 } 131 }
132 132
133 // terminal key listener sending to the host 133 // monitor injecting a field
134 @Override
135 public void setField(int l, int c, char [] d) {
136 screen52.setField(l, c, d);
137 }
138
139 // terminal key listener sending to local screen
134 @Override 140 @Override
135 public void write(byte[] b) { 141 public void write(byte[] b) {
142 if (bridge.monitor != null) bridge.monitor.hostData(b);
136 screen52.sendKeys(new String(b)); 143 screen52.sendKeys(new String(b));
137 } 144 }
138 @Override 145 @Override
139 public void write(int b) { 146 public void write(int b) {
147 if (bridge.monitor != null) bridge.monitor.hostData(b);
140 screen52.sendKeys(new String(new byte[] {(byte)b})); 148 screen52.sendKeys(new String(new byte[] {(byte)b}));
141 } 149 }
142 @Override 150 @Override
143 public void keyPressed(int keyCode, char keyChar, int modifiers) { 151 public void keyPressed(int keyCode, char keyChar, int modifiers) {
144 String s;
145 if (mnemonics.containsKey(keyCode)) { 152 if (mnemonics.containsKey(keyCode)) {
146 s = mnemonics.get(keyCode); 153 String s = mnemonics.get(keyCode);
147 if (s != "") screen52.sendKeys(s); 154 if (s != "") {
155 if (bridge.monitor != null) bridge.monitor.hostData(s);
156 screen52.sendKeys(s);
157 }
148 } 158 }
149 } 159 }
150 // 5250 writing to the screen 160 // 5250 writing to the screen
161 // test for changed screen contents
162 @Override
163 public void testChanged() {
164 if (bridge.monitor != null) bridge.monitor.testChanged();
165 }
151 @Override 166 @Override
152 public void putChar(int c, int l, char ch, int attributes) { 167 public void putChar(int c, int l, char ch, int attributes) {
153 if (bridge.monitor != null) bridge.monitor.screenChanged(l, c); 168 if (bridge.monitor != null) bridge.monitor.screenChanged(l, c);
154 super.putChar(c, l, ch, attributes); 169 super.putChar(c, l, ch, attributes);
155 } 170 }
228 String encryption = host.getEncryption5250(); 243 String encryption = host.getEncryption5250();
229 if ((encryption == null) || (encryption.length() == 0)) encryption = "NONE"; 244 if ((encryption == null) || (encryption.length() == 0)) encryption = "NONE";
230 handler.setSSLType(encryption); 245 handler.setSSLType(encryption);
231 screen52.setVT(handler); 246 screen52.setVT(handler);
232 screen52.setBuffer(buffer); 247 screen52.setBuffer(buffer);
233 connected = handler.connect(host.getHostname(), host.getPort()); 248 connected = handler.connect(host.getHostname(), host.getPort(), buffer);
234 if (connected) bridge.onConnected(); 249 if (connected) bridge.onConnected();
235 } 250 }
236 251
237 252
238 /** 253 /**