Sony Ericsson Embedded Applications Application Note
Sony Ericsson Embedded Applications Application Note

Sony Ericsson Embedded Applications Application Note

Using the on board tcp/ip stack

Advertisement

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

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Embedded Applications and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Sony Ericsson Embedded Applications

  • Page 1 Application Note Embedded Applications Using the on board TCP/IP stack...
  • Page 2 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.
  • Page 3: Table Of Contents

    EMBEDDED APPLICATIONS FCT Contents Contents ..................... 3 Introduction ..................4 Using the Embedded Application TCP/IP Functions for Data Exchange....................5 Overview of Embedded Applications TCP/IP ..........5 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...
  • Page 4: Introduction

    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...
  • Page 5: Using The Embedded Application Tcp/Ip Functions For Data Exchange

    EMBEDDED APPLICATIONS FCT 2 Using the Embedded Application TCP/IP Functions for Data Exchange 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...
  • Page 6: Basic Usage Of Tcp/Ip Features

    PDP context must be activated first, to provide the underlying IP transport. This should be done using the pdpa() function, not by using direct AT dial commands. The embedded applications TCP/IP cannot properly make use of a PDP context that has been created using the ATD command.
  • Page 7: Tcp Connect Operations

    EMBEDDED APPLICATIONS FCT Define an appropriate PDP context according to Service Provider data Activate the required PDP context Create a socket For TCP only, perform a Connect to a remote host Send data or status information over the socket to a...
  • Page 8: General Restrictions

    EMBEDDED APPLICATIONS FCT TCP_STATUS_BYTE = 14, TCP_CONNECTED = 2), 2 Check the result code from a send or receive operation and if the code indicates CONNECTING (1) then retry the operation, with appropriate timeouts applied. Testing Communications over TCP/IP 2.2.5...
  • Page 9: Ip Fragmentation

    EMBEDDED APPLICATIONS FCT IP Fragmentation 2.4.2 The radio device stack supports IP fragmentation and will successfully reconstruct fragmented packets provided: No individual fragment exceeds the maximum packet size of 3100 bytes The total reconstructed size of the fragmented packet does not exceed 3100 bytes The internal packet buffers are not exhausted during the period that the fragments are being received.
  • Page 10: Udp Example Script {Udp_Transfer.sc

    EMBEDDED APPLICATIONS FCT UDP Example Script {UDP_transfer.sc} A simple example of a UDP data transfer script is listed below. The script creates a UDP socket, sends some start data and then sits in a receive loop until a ‘$’ character is received, after which it closes the socket and exits.
  • Page 11 EMBEDDED APPLICATIONS FCT else prtf( “\nReceived %d bytes of data.\n”, len ); if ( RxTxBuf[0] == ‘$’ ) prtf( “\n Breaking out of receive loop!\n” ); Complete = TRUE; /* Log status monitoring */ if( gtf( APPS_IP_ERROR_TRIGGER ) ) prtf( "\n IP ERROR = %d\n", gtb( APPS_IP_ERROR_STATUSBYTE ) );...
  • Page 12: Tcp Example Script {Tcp_Transfer.sc

    EMBEDDED APPLICATIONS FCT TCP Example Script {TCP_transfer.sc} A simple example of a TCP data transfer script is listed below. The script creates a TCP socket, connects to a remote site and then sits in a receive loop until a ‘$’...
  • Page 13 EMBEDDED APPLICATIONS FCT len = RXTX_SIZE; Err = tcpr( SckNum, RxTxBuf, &len); if( Err != 0 ) prtf( "\n *** Error in TCP Receive (%d). ***\n\n", Err ); else if( gtb( APPS_IP_TCPSTATUS_BYTE ) == TCP_CONNECTING ) prtf( "\n Delaying while TCP Connect occurs...\n\n" );...
  • Page 14: Tcp Send Function Script {Tcp_Send.sc

    EMBEDDED APPLICATIONS FCT TCP Send Function Script {TCP_send.sc} It is important to note that when using tcps(), the intrinsic TCP send function, the application-writer must check the number of bytes sent on successful return from the function, because a successful return is possible with the number of bytes actually sent being less than the number requested.
  • Page 15: Host Name Resolution

    EMBEDDED APPLICATIONS FCT back-off delay and transmission retries can be adjusted to suit the application. 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.
  • Page 16: Advanced Technical Details

    EMBEDDED APPLICATIONS FCT 2.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.

Table of Contents