Auto-tools/Projects/SUTAgent: Difference between revisions

Jump to navigation Jump to search
Line 19: Line 19:
= Design and Approach =
= Design and Approach =


The SUTAgent starts up when the device boots so that it is already running. If configured appropriately, it immediately connects to an agent server and sends a short description of the phone and agent. If it is restarting after a SUTAgent-initiated reboot (see below), it connects to a callback server to indicate that it is back up.
== Configuration ==


The SUTAgent maintains two open ports: a command port and a monitor port. The command port receives line-based commands and, depending on the command, returns data. The monitor port sends a periodic heartbeat and log messages. At a minimum, all command lines should be logged.
The SUTAgent can be configured by providing it with a file called SUTAgent.ini. This optional file can be used to configure the network connection and the registration server (see below).
 
== Start up ==
 
The device must start the SUTAgent automatically when it boots. Upon starting, the SUTAgent connects to a registration server, if configured. If it is restarting after a SUTAgent-initiated reboot (see below), it then connects to a callback server to indicate that it is back up.
 
== Interface ==
 
The SUTAgent maintains two open ports: a command port (default 20701) and a monitor port (default 20700). The command port receives line-based commands and, depending on the command, prints a response. The monitor port (sometimes referred to as the data port) sends a periodic heartbeat and log messages. At a minimum, all command lines should be logged.


Logs are also kept in a file on the device and rotated periodically to ensure they don't take up too much disk space.
Logs are also kept in a file on the device and rotated periodically to ensure they don't take up too much disk space.
Line 27: Line 35:
Note that, regardless of the device's platform, paths are always in POSIX format (using forward slashes). The SUTAgent is responsible for translating these to and from the native format (e.g. c:\dir\ might be translated as /c/dir/).
Note that, regardless of the device's platform, paths are always in POSIX format (using forward slashes). The SUTAgent is responsible for translating these to and from the native format (e.g. c:\dir\ might be translated as /c/dir/).


The SUTAgent shall also remember the current working directory for the duration of a command-socket connection. The default cwd is implementation-specific.
The SUTAgent shall also remember the current working directory for the duration of a command-socket connection. The default cwd is device-specific.


When errors are printed in response to commands, they should be of the form "##AGENT-WARNING## <detailed error message>".
When errors are printed in response to commands, they should be of the form "##AGENT-WARNING## <detailed error message>".


See the [[Auto-tools/Projects/SUTAgent/CommandReference|command reference]] for supported commands.
See the [[Auto-tools/Projects/SUTAgent/CommandReference|command reference]] for supported commands.
== Registration Server ==
A [Registration Server] section can be included in SUTAgent.ini to cause the agent to register itself upon start-up. The section should contain the following variables:
* IPAddr: Address of the registration server.
* PORT: Port of the registration server.
* HARDWARE: Short description of the device.
* POOL: Free-form string that can be used for categorizing the device or other administration tasks.
When the agent starts, it connects to the registration server as described in SUTAgent.ini and sends a short description of the phone and agent. The description is in the form of a URL-encoded query string with the following parameters:
* NAME: MAC address
* IPADDR: IP address
* CMDPORT: Port number of the command socket
* DATAPORT: Port number of the monitor socket
* OS: OS string
* SCRNWIDTH: Screen width in pixels
* SCRNHEIGHT: Screen height in pixels
* BPP: Screen colour depth
* MEMORY: Amount of available memory in bytes
* HARDWARE: Description of hardware as specified in the SUTAgent.ini file
* POOL: Value of the POOL option in the SUTAgent.ini
Example registration string:
NAME=14%3A7d%3Ac5%3Aaf%3Ac8%3Ae3&IPADDR=192.168.1.146&CMDPORT=20701&DATAPORT=20700&OS=Android-GINGERBREAD.XXKI4&SCRNWIDTH=480&SCRNHEIGHT=800&BPP=8&MEMORY=603811840&HARDWARE=samsung_gs2&POOL=304D19C38653ED7E


= Implementation =
= Implementation =


See [[Auto-tools/Projects/SUTAgentImplementation|SUTAgentImplementation]].
See [[Auto-tools/Projects/SUTAgentImplementation|SUTAgentImplementation]].
Confirmed users
1,927

edits

Navigation menu