comparison src/com/five_ten_sg/connectbot/monitor/MonitorService.java @ 13:5bf6d84cc5b8 stable-1.0.1

add showurl command
author Carl Byington <carl@five-ten-sg.com>
date Tue, 24 Jun 2014 07:58:13 -0700
parents 992dca085fa2
children a481d8fb5571
comparison
equal deleted inserted replaced
12:9f1eff475559 13:5bf6d84cc5b8
40 public static final char MONITOR_CMD_FIELDVALUE = 5; 40 public static final char MONITOR_CMD_FIELDVALUE = 5;
41 public static final char MONITOR_CMD_SETFIELD = 5; 41 public static final char MONITOR_CMD_SETFIELD = 5;
42 public static final char MONITOR_CMD_GETFIELD = 6; 42 public static final char MONITOR_CMD_GETFIELD = 6;
43 public static final char MONITOR_CMD_SCREENWATCH = 7; 43 public static final char MONITOR_CMD_SCREENWATCH = 7;
44 public static final char MONITOR_CMD_DEPRESS = 8; 44 public static final char MONITOR_CMD_DEPRESS = 8;
45 public static final char MONITOR_CMD_SHOWURL = 9;
45 46
46 public static final int MONITORPORT = 6000; 47 public static final int MONITORPORT = 6000;
47 public static ConcurrentHashMap<Integer,CommunicationThread> clients = new ConcurrentHashMap<Integer,CommunicationThread>(); 48 public static ConcurrentHashMap<Integer,CommunicationThread> clients = new ConcurrentHashMap<Integer,CommunicationThread>();
48 public static int currentConnection = -1; 49 public static int currentConnection = -1;
49 50
425 char[] arg = new char[3]; 426 char[] arg = new char[3];
426 arg[2] = (char) (vk_key & 0x0000ffff); 427 arg[2] = (char) (vk_key & 0x0000ffff);
427 cm.clientWrite(MONITOR_CMD_DEPRESS, arg); 428 cm.clientWrite(MONITOR_CMD_DEPRESS, arg);
428 } 429 }
429 } 430 }
431
432 public static void teShowUrl(int connection, char [] url) {
433 int len = url.length;
434 CommunicationThread cm = clients.get(connection);
435 if (cm != null) {
436 char[] arg2 = new char[2 + len];
437 int base = 2;
438 System.arraycopy(url, 0, arg2, base, len);
439 cm.clientWrite(MONITOR_CMD_SHOWURL, arg2);
440 }
441 }
442
430 } 443 }