![]() |
![]() |
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:
Using the SlNet API enables you to create portable applications that support all of these environments.
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 |
Network Interface Function List
[inst.networkIfFxnList = 'SimpleLink WiFi' ]
|
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 ]
|
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 = '' ]
|
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().
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().
Interface Name
[inst.ifName = 'wlan0' ]
|
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().
Priority
[inst.priority = 5 ]
|
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 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.
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
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.
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.
The Connection Manager can manage and monitor connections at various levels of the network stack (i.e. MAC, IP, and Internet).
SlNetConn.generateEventThread = false; | // Create Thread To Process CM Events |
SlNetConn.eventThreadPriority = '1'; | // Event Thread Priority |
SlNetConn.eventThreadStackSize = 2048; | // Event Thread Stack Size |
Create Thread To Process CM Events
[SlNetConn.generateEventThread = false]
|
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().
Event Thread Priority
[SlNetConn.eventThreadPriority = '1']
|
The priority of the SlNetConn_process() pthread
Event Thread Stack Size
[SlNetConn.eventThreadStackSize = 2048]
|
The stack size of the SlNetConn_process() pthread.
The SNTP client provides APIs to synchronize the local time with a server that provides time synchronization services using the Network Time Protocol.
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 |
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().
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 |
Data Input Method
[inst.dataInputMethod = 'Reference to Secure Object Variable' ]
|
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 = '' ]
|
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 = '' ]
|
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 = '' ]
|
Paste the raw text of your secure object into this field.
This setting will generate the objBuff
and objBuffLen
arguments for
SlNetIf_loadSecObj().
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
|
Similarily,
inst.paramName = defaultValue
|
For example, the following is a snippet of a SysConfg script that configures the GPIO module and a GPIO instance.