@PACKAGE@ - Version @VERSION@ Packages The various source and binary packages are available at http://www.five-ten-sg.com/@PACKAGE@/packages/. The most recent documentation is available at http://www.five-ten-sg.com/@PACKAGE@/. A Mercurial source code repository for this project is available at http://hg.five-ten-sg.com/@PACKAGE@/. 2014-06-22 Carl Byington 510 Software Group @PACKAGE@ 1 @PACKAGE@ @VERSION@ @PACKAGE@ a monitoring package for the android terminal emulator Build method This is an android project with no native code, so "android update project -p . -t android-16; ant debug" should build cleanly. Introduction This is a stub monitoring application for the related 510 Connectbot android terminal emulator package. Terminal Monitor For every terminal session (local, telnet, ssh or tn5250), the terminal emulator also makes a connection to a terminal monitor process, which can see cursor movement and screen contents, and can inject characters to send to the host. The terminal monitor is invoked by calling an android Intent named "com.five_ten_sg.connectbot.monitor.MonitorService". That ensures that the monitor process is running, and should then be listening on TCP port 6000 for incoming connections. The terminal emulator then connects to the terminal monitor on port 6000. The native android Intent and Service communication mechanisms are not used. The messages exchanged between the terminal emulator and the terminal monitor are arrays of uint16 values in network byte order. Each message starts with a uint16 message byte length, followed by that many bytes of data. Note that the message length will always be even. The next uint16 contains the message command value, and the remaining uint16 values are the arguments if any for that command. Any arguments that are keystrokes or characters are represented as 16 bit unicode. Note that the first 256 such characters are identical to the ISO-8859-1 latin character set. INIT = 0 (TE -> Monitor). The argument is a string of uint16 characters. The meaning of these characters is defined by the monitor. It might be a fully qualified path name, or some other data used by the monitor to drive the monitoring of this connection. ACTIVATE = 1 (TE -> Monitor). The first argument is the number of lines. The second argument is the number of columns. That is followed by lines*columns uint16 character codes. This connection is now the active connection. It is the topmost (or only) window visible to the user - typed keystrokes will be sent to the host on the other end of this connection. KEYSTATE = 2 (TE -> Monitor). The argument is a single uint16 value, 1 for key down, 0 for key up. The TE tracks a single special key for the monitor, and reports key up/down state when it changes. The actual key is configurable. CURSORMOVE = 3 (TE -> Monitor). The first argument is the line number (0..23) and the second argument is the column number (0..79). SCREENCHANGE = 4 (TE -> Monitor). The first argument is the number of lines. The second argument is the number of columns. That is followed by lines*columns uint16 character codes. FIELDVALUE = 5 (TE -> Monitor). SETFIELD = 5 (Monitor -> TE). The first argument is the line number (0..23) and the second argument is the column number (0..79). That is followed by the field value, a sequence of uint16 character codes from the screen buffer. The field covers N columns, where N = (message length - 4) / 2. When sent from the monitor to the emulator, this causes the emulator to send the field codes to the host. This is also used as the reply message from the emulator to the monitor for a previous GETFIELD from the monitor. GETFIELD = 6 (Monitor -> TE). The first argument is the line number (0..23) and the second argument is the starting column number (0..79), and the third argument is the field length in columns. This command causes the emulator to send a FIELDVALUE message back to the monitor. SCREENWATCH = 7 (Monitor -> TE). The first argument is the line number (0..23) and the second argument is the starting column number (0..79), and the third argument is the field length in columns. This command causes the emulator to watch the specified part of the screen for changes. When that part of the screen changes, the emulator will send a SCREENCHANGE message back to the monitor. DEPRESS = 8 (Monitor -> TE). The argument is a single uint16 value containing a Windows VK key code. See http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731 for the values. The following values are implemented in the emulator - vk_back vk_tab vk_return vk_escape vk_prior vk_next vk_end vk_home vk_left vk_up vk_right vk_down vk_insert vk_delete vk_f1 vk_f2 vk_f3 vk_f4 vk_f5 vk_f6 vk_f7 vk_f8 vk_f9 vk_f10 vk_f11 vk_f12. TODO Nothing. Copyright Copyright (C) 2014 by 510 Software Group <carl@five-ten-sg.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, please write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. Version @VERSION@