Hostname and WRU Answer Back Preprocessing

Sub Header

The Hostname and WRU Answer Back fields allow preprocessing based on certain Android device parameters. The available parameters are:

  • devname: device name
  • devmac: device MAC address
  • devserial: device serial number

Hostname preprocessing is available in all connection types. WRU applies only to UNIX connections.

The examples below all use devname. The same format may be used with any of the parameters. Multiple parameters may also be combined in a string.




<devname>

<devname> takes two optional arguments, a start and stop index, and operates on the Android device name. In the examples below, the device name is DevABC123.




No Arguments

<devname> will return the full device name and insert it into the string. Thus for the hostname myhost<devname>.censoft.com, the host generated will be myhostDevABC123.censoft.com.




One Argument

<devname:1> will return the device name, starting from the index specified (in this case, 1) and including the remainder of the string. Keep in mind that these are true zero-based indexes. The hostname myhost<devname:3>.censoft.com will generate a hostname of myhostABC123.censoft.com.

In the event that a negative value is used, the start index is set to the character index calculated from the end of the string. The hostname myhost<devname:-3>.censoft.com will produce a hostname of myhost123.censoft.com.




Two Arguments

<devname:1,3> will return the device name starting from the index specified (in this case, 1) and continuing and including the character at the end index (in this case, 3). A hostname of myhost<devname:1,3>.censoft.com will produce a hostname of myhostevA.censoft.com. Like the One Argument version, these index values may be negative, in which case they begin from the end of the string. A hostname of myhost<devname:-3,-1>.censoft.com will product a hostname of myhost123.censoft.com.

In the two argument version, arguments can be omitted: <devname:1,> will set the end index to the length of the string minus one. <devname:,4> will set the start index to 0 and the end index to 4.




Error Conditions

If the end index is greater than the length of the string minus one, the end index will be set to the length of the string minus one.

If the start or end index is less than zero, such as when calculating using a negative value, the appropriate value is set to 0 for the start index, or the length of the string minus one for the end index.

In the event that the start index is greater than the end index, the start index is set to end index value This will return a single character.


Android User Guide Table of Contents