
Application Note
Embedded Applications
Using the on board TCP/IP stack

First edition (September 2004)
Sony Ericsson Mobile Communications. publishes this manual without
making any warranty as to the content contained herein. Further Sony
Ericsson Mobile Communications. reserves the right to make modifications,
additions and deletions to this manual due to typographical errors, inaccurate
information, or improvements to programs and/or equipment at any time and
without notice. Such changes will, nevertheless be incorporated into new
editions of this manual.
All rights reserved.
© Sony Ericsson Mobile Communications., 2004

EMBEDDED APPLICATIONS FCT
Contents
Contents.....................................................................................................3
1 Introduction ........................................................................................4
2 Using the Embedded Application TCP/IP Functions for Data
Exchange....................................................................................................5
2.1 Overview of Embedded Applications TCP/IP ............................................5
2.2 Basic Usage of TCP/IP Features...............................................................6
2.2.1 Protocols........................................................................................6
2.2.2 GPRS Transport for IP...................................................................6
2.2.3 Flow of TCP/IP Operations in a Script ...........................................6
2.2.4 TCP Connect Operations...............................................................7
2.2.5 Testing Communications over TCP/IP...........................................8
2.3 General Restrictions ..................................................................................8
2.4 Resource Restrictions ...............................................................................8
2.4.1 Packet Buffers ...............................................................................8
2.4.2 IP Fragmentation ...........................................................................9
2.4.3 Performance ..................................................................................9
2.5 UDP Example Script {UDP_transfer.sc} ..................................................10
2.6 TCP Example Script {TCP_transfer.sc} ...................................................12
2.7 TCP Send Function Script {TCP_send.sc} ..............................................14
2.8 Host Name Resolution.............................................................................15
2.9 IP Status Flags and Bytes .......................................................................15
2.10 Advanced Technical Details ....................................................................16
2.10.1 Time-to-Live (TTL) .......................................................................16
2.10.2 DNS Name Caching Period .........................................................16
LZT 123 8019 R1A 3

EMBEDDED APPLICATIONS FCT
1 Introduction
This application note describes the use of the TCP/IP sack
that is resident on the module within the embedded
applications environment.
LZT 123 8019 R1A 4

EMBEDDED APPLICATIONS FCT
2 Using the Embedded Application TCP/IP
Functions for Data Exchange
2.1 Overview of Embedded Applications TCP/IP
The TCP/IP features provided by the embedded
application functions of the radio device are intended to
provide a subset of the features normally available at the
socket level when using a conventional TCP/IP stack, with
some simplification and customization based on the
specific features of the radio device.
The features allow the application-writer to create and
destroy UDP and TCP sockets, to control underlying
GPRS PDP contexts, to transfer data to and from the radio
device, and to interrogate IP status information about the
active link.
The socket interface is provided by a series of functions
outlined below:
pdpa() Activate and deactivate a PDP context for TCP/IP over GPRS
ipo() Open a UDP or TCP socket for data transfer
ipc() Close a previously opened UDP or TCP socket
tcpc() Connect to a TCP server specifying IP address and port
tcps() Send data over a previously connected TCP socket
tcpr() Receive data over a previously connected TCP socket
udps() Send data over a UDP socket
udpr() Receive data over a UDP socket
ipi() Obtain IP-related information associated with the GPRS link
iprh() Perform a text-to-IP-address hostname resolution
For full details of these functions, their parameters and
possible return values, refer to the syntax data in the
M2mpower IDE Help files.
The majority of the functions, with the exception of the
tcpc() function, will only return once the requested
operation is complete. More detail regarding tcpc() is
provided in later sections of this application note.
LZT 123 8019 R1A 5