Texas Instruments

Network Services User's Guide

Table of Contents

Overview

The Network Services product is a collection of application layer networking protocols, such as the HTTP Client and the SNTP Client which are specifically designed for TI embedded devices. These protocols are developed to work with various networking stacks such as TI SimpleLink WiFi, TI-RTOS NDK and Linux networking stacks. The following subsections describe the features and usage details for the protocols.

HTTP Client

The HyperText Transfer Protocol (HTTP), an ubiquitous application protocol that powers the web, has become the preferred communication protocol for device-to-device communication as well. To jumpstart the development of such connected embedded devices, TI provides a well defined set of APIs for client-side implementation of the IETF standard for HTTP/1.1 (RFC2616).

This implementation provides APIs to connect, perform HTTP operations (i.e. GET, POST, PUT, HEAD, OPTIONS, DELETE and PATCH) and APIs to process response and extract relevant information such as the response status code and data. It includes support for handling redirections (3xx status code) and chunked responses. At the IP level, both IPv4 and IPv6 transports are supported.

With security increasingly being a key concern, the standard security via SSL/TLS to make the session secure (HTTPS) and communication through proxies are included. This implementation supports TI SimpleLink TLS stack for Wireless devices and WolfSSL stack for EMAC devices. The detailed instructions for using WolfSSL with TI-RTOS is available in Using WolfSSL with TI-RTOS wiki.

API Reference Guide

The detailed description of the APIs can be found in the HTTP Client API Reference Guide.

Static Configuration

To use HTTP Client in a TI-RTOS application, add the following statement to the configuration file (i.e. .cfg file):

var HttpCli = xdc.useModule('ti.net.http.HttpCli');

And set the network stack with following statement. This statement will ensure the correct HTTP Client library gets linked to the application:

For SimpleLink networking stack, add:

HttpCli.networkStack = HttpCli.SimpleLink;

For TI-RTOS NDK networking stack, add:

HttpCli.networkStack = HttpCli.NDK;

To enable the SSL/TLS layer, add the following statement:

HttpCli.enableTLS = true;

HTTP Client uses BSD Socket APIs by including <ti/net/socket.h> which conditionally includes the BSD socket headers for various networking layers. It is necessary to ensure that the following define is passed to the compiler in the application build to include the correct network layer BSD headers:

For SimpleLink networking layer:

-DNET_SL

For NDK networking layer:

-DNET_NDK

Examples

Examples are provided as part of the TI-RTOS product. See TI-RTOS Getting Started Guide for your device family for a list of examples that use this service.

SNTP Client

The SNTP client uses the Network Time Protocol (NTP) to provide a continuous service of maintaining system time by periodically sychronizing with one or more NTP servers.

API Reference Guide

The detailed description of the APIs can be found in the SNTP Client API Reference Guide.

Static Configuration

To use SNTP Client in a TI-RTOS application, add the following statement to the configuration file (i.e. .cfg file):

var Sntp = xdc.useModule('ti.net.sntp.Sntp');

And set the network stack with following statement. This statement will ensure the correct SNTP Client library gets linked to the application:

For SimpleLink networking stack, add:

Sntp.networkStack = Sntp.SimpleLink;

For TI-RTOS NDK networking stack, add:

Sntp.networkStack = Sntp.NDK;

SNTP Client uses BSD Socket APIs by including <ti/net/socket.h> which conditionally includes the BSD socket headers for various networking layers. It is necessary to ensure that the following define is passed to the compiler in the application build to include the correct network layer BSD headers:

For SimpleLink networking layer:

-DNET_SL

For NDK networking layer:

-DNET_NDK

Examples

The example usage can be found in the SNTP API Reference Guide.