SlNet: Socket Layer IP Network System Configuration

The Socket Layer IP Network module (SlNet) allows you to manage instances of IP network stacks using a consistent, cross-platform API. Some example use cases include:

  • CC3XXX (WiFi) using its network processor-based stack
  • MSP432E4 (wired ethernet) using the NDK stack

Using the SlNet API enables you to create portable applications that support all of these environments.


SlNet Configuration Synopsis_Lines

inst.networkIfFxnList = 'SimpleLink WiFi';// Network Interface Function List
inst.importNIMU = false;// Import NDK Interface
inst.customFuncList = '';// Custom Network Interface Symbol
inst.id = 1;// ID
inst.ifName = 'wlan0';// Interface Name
inst.priority = 5;// Priority
inst.enableSecureSocks = true;// Enable Secure Sockets

SlNet Instance Configuration Options

Network Interface Function List [inst.networkIfFxnList = 'SimpleLink WiFi']
Choose the desired interface function list

Choose from a list of supported function lists on your device or use a custom one

This setting is used to determine the ifConf argument in SlNetIf_add().

Valid options include the following:

'SimpleLink WiFi'
'Custom'

Import NDK Interface [inst.importNIMU = false]
Select this if you want a NDK Interface to be brought in for you

Selecting this option will automatically pull in a NDK Interface for you. Other wise you will be responsible for adding a NDK Interface. Furthermore, if this option is not selected you will be limited to only one SlNet instance using the NDK as its Function List.

[documentation here]

Custom Network Interface Symbol [inst.customFuncList = '']
User symbol specifying a SlNetIf-compliant network interface

A SlNetIf-compliant network interface symbol for this interface instance.

This config param is only available if the "Network Interface Function List" is set to "Custom".

This setting is equivalent to setting the ifConf argument in SlNetIf_add().

SLNETIF_ID_? value

Specifies the interface ID for this interface instance.

The value of the interface identifier is defined with the prefix SLNETIF_ID_ which is defined in slnetif.h.

This setting is equivalent to setting the ifID argument in SlNetIf_add().

Specifies the name for this interface"

Specifies the name of the interface. Note: Can be set to NULL, but when set to NULL cannot be used with SlNetIf_getIDByName().

This setting is equivalent to setting the ifName argument in SlNetIf_add().

Specifies the priority of the interface.

Specifies the priority of the interface (In ascending order). Note: maximum priority is 15.

This setting is equivalent to setting the priority argument in SlNetIf_add().

Enable Secure Sockets [inst.enableSecureSocks = true]
Enable secure sockets

Enable secure sockets on this interface. You cannot add secure objects without this option being selected.

Selecting this option will display the Secure Object adder interface in the SysConfig GUI. If you are using the NDK it will also change the ifConf argument in SlNetIf_add(). to the NDK's secure function list.


HTTPClient: HTTP Client configuration

The HTTPClient module allows you to configure HTTP clients for communication with HTTP servers. Clients are capable of secure communication via TLS (certificates must be provided through the SlNet module). API documentation be found here.

The HTTP version supported is HTTP 1.1


HTTPServer: HTTP Server configuration

The HTTPServer module allows you to manage HTTP servers. As part of the configuration of an HTTP server, a user can define how requests to the server are handled. The Network Services HTTP Server accomplishes this through the use of URLHandlers. Servers are capable of secure communication via TLS (certificates must be provided through the SlNet module).

The HTTP version supported is HTTP 1.1.

A user guide can be viewed here. API documentation is available here.


MQTT: MQTT Client and Server configuration

The MQTT module allows management of MQTT clients and brokers. The MQTTClient module provides an easy-to-use API that allows interactions between cloud-based or local MQTT servers.

The library supports the MQTT 3.1 protocol.


SlNetConn: Connection Manager configuration

The Connection Manager can manage and monitor connections at various levels of the network stack (i.e. MAC, IP, and Internet).


SlNetConn Configuration Synopsis_Lines

SlNetConn.generateEventThread = false;// Create Thread To Process CM Events
SlNetConn.eventThreadPriority = '1';// Event Thread Priority
SlNetConn.eventThreadStackSize = 2048;// Event Thread Stack Size

SlNetConn Module Configuration Options

Create Thread To Process CM Events [SlNetConn.generateEventThread = false]
Select this to generate a pthread that will handle event responses.

Selecting this option will create a pthread that will call SlNetConn_process(). If not selected, the application code must provide a task/thread that calls SlNetConn_process().

The priority of the event thread.

The priority of the SlNetConn_process() pthread

The stack size of the event thread.

The stack size of the SlNetConn_process() pthread.


SNTP: SNTP configuration

The SNTP client provides APIs to synchronize the local time with a server that provides time synchronization services using the Network Time Protocol.


SecObj Configuration Synopsis_Lines

inst.$name = 'CONFIG_SECOBJ_{num}';// Name
inst.secObjType = 'SLNETIF_SEC_OBJ_TYPE_CERTIFICATE';// Type
inst.dataInputMethod = 'Reference to Secure Object Variable';// Data Input Method
inst.secObjVariable = '';// Secure Object Variable
inst.secObjVariableSize = '';// Secure Object Variable Size
inst.secObjText = '';// Secure Object Text

SecObj Instance Configuration Options

Secure Object Name

You will use this name whenever you need to refer to this secure object inside your application source code. For instance, the SlNetSock_secAttribSet() function takes this name as an argument.

This setting is equivalent to setting the objName argument in SlNetIf_loadSecObj().

Secure Object Type

Indicate the Secure Object type.

This setting is equivalent to setting the objType argument in SlNetIf_loadSecObj().

Valid options include the following:

'SLNETIF_SEC_OBJ_TYPE_RSA_PRIVATE_KEY'RSA Private Key - RSA Private Key
'SLNETIF_SEC_OBJ_TYPE_CERTIFICATE'Certificate - Certificate
'SLNETIF_SEC_OBJ_TYPE_DH_KEY'DH Key - Diffie-Hellman Key

Method of adding the secure object

Specify how to add the secure object in SysConfig.

Reference to Secure Object Variables - Create variables containing the Secure Object and the Secure Object size in a *.c file compiled with your project.

Secure Object Text - Provide the raw text describing the Secure Object

Valid options include the following:

'Reference to Secure Object Variable' - Secure Object variables in the application
'Secure Object Text' - Raw text string containing the Secure Object

Secure Object Variable [inst.secObjVariable = '']
Secure Object Variable

Name of the uint8_t array containing the Secure Object text

This setting is equivalent to setting the objBuff argument in SlNetIf_loadSecObj().

Secure Object Variable Size [inst.secObjVariableSize = '']
Secure Object Variable Size

Name of the int16_t variable containing the secure object size

This setting is equivalent to setting the objBuffLen argument in SlNetIf_loadSecObj().

Secure Object Text [inst.secObjText = '']
Secure Object Text

Paste the raw text of your secure object into this field.

This setting will generate the objBuff and objBuffLen arguments for SlNetIf_loadSecObj().


How to Read SysConfig Synopsis Lines

SysConfig configuration scripts consist of a sequence of assignments to configuration parameters defined by the modules used in an application. There are two types of assignments: assignments to module-level configuration parameters (that apply to all instances of the module) and assignments to instance-level configuration parameters (which are specific to the instance alone). All configuration parameters have a default value that's used in the event that it's not explicitly set in the configuration script.

Synopsis lines of the form
MOD.paramName = defaultValue
illustrate an assignment of a module configuration parameter's default value to the configuration parameter itself.

Similarily,
inst.paramName = defaultValue
illustrates an assignment of a instance configuration parameter's default value to the configuration parameter itself.

For example, the following is a snippet of a SysConfg script that configures the GPIO module and a GPIO instance.

// Add the GPIO module to this configuration
var GPIO = system.addModule('/ti/drivers/GPIO');
// Set a GPIO module configuration parameter
GPIO.optimizeCallbackTableSize = true;
// Add a new GPIO instance
var led = GPIO.addInstance();
// Set this instance's configuration parameters
led.$name = 'LED';
led.mode = 'Output';