Download M2mpower Application Guide - conrad

Transcript
M2M Power Application guide
This function assumes that the caller has already checked that the TCP
socket is connected, or if not, that the connection will become active within
the timeout/retry period.
12.8 Host Name Resolution
Host name resolution in a script is performed using the iprh() function. The
application-writer should be aware that the name lookup is effectively a
blocking function. The script interpreter process will be blocked until the
lookup is completed. This can lead to long script processing delays if
something with the name resolution fails.
The name servers used by the lower-level stack are usually obtained
dynamically when a PDP context is activated. The active settings can be
interrogated using the ipi() function. A DNS lookup has a minimum timeout of
approximately 124 seconds. Hence if all DNS servers are inaccessible (up to
3 are supported), or if the domain name does not resolve, there can be an
overall delay of between 125 and 140 seconds before the iprh() function
returns. During this delay script operation will stall, therefore the use of
unreliable DNS servers could cause long pauses in operation.
12.9
IP Status Flags and Bytes
There are two status bytes and one status flag associated with the TCP/IP
features. These are interrogated using the gtb() and gtf() script functions
respectively.
The IP status flag APPS_IP_ERROR_TRIGGER (36) is set whenever an
error occurs in the lower level IP system. The flag remains set until it is read,
and is reset upon reading. The error that gave rise to the flag is obtained by
reading the status byte APPS_IP_ERROR_STATUSBYTE (13). If several IP
errors occur before the status flag is set the last error will be reported in the
status byte.
The TCP system has a separate status byte called
APPS_IP_TCPSTATUS_BYTE (14) which reports the current status of the
TCP connection. This status can indicate that TCP is not-connected,
connecting, or connected.
12.10
Advanced Technical Details
This section lists a number of advanced technical points for users who wish
to understand more of the fine details of the TCP/IP stack in the radio device.
For most readers this information will not be relevant.
12.10.1
Time-to-Live (TTL)
The radio device IP stack uses a Time-to-Live (TTL) setting of 64. This figure
is fixed as far as the application-writer is concerned; there is no high-level
method for changing it. Many modern systems use a TTL of 128, but apart
from the most complex of routing arrangements, a figure of 64 will be
perfectly adequate.
LZT 123 7588 R2B
69