Texas Instruments SimpleLink Wi-Fi CC3120 Programmer's Manual

Texas Instruments SimpleLink Wi-Fi CC3120 Programmer's Manual

Internet of things network processor
Hide thumbs Also See for SimpleLink Wi-Fi CC3120:
Table of Contents

Advertisement

Quick Links

®
CC3120, CC3220 SimpleLink™ Wi-Fi
and
Internet of Things Network Processor
Programmer's Guide
Literature Number: SWRU455A
February 2017 – Revised March 2017

Advertisement

Table of Contents
loading

Summary of Contents for Texas Instruments SimpleLink Wi-Fi CC3120

  • Page 1 ® CC3120, CC3220 SimpleLink™ Wi-Fi Internet of Things Network Processor Programmer's Guide Literature Number: SWRU455A February 2017 – Revised March 2017...
  • Page 2: Table Of Contents

    ......................3.10 Domain Name ....................... 3.11 Device Status ....................3.12 Persistent Configuration ........................3.13 Errors ..........................WLAN ........................Introduction ........................ Key Features Contents SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 3 Socket ........................Introduction ........................ Key Features ....................... Socket Types ........................BSD API ...................... Socket Working Flow ......................... 6.5.1 ......................... 6.5.2 ........................ 6.5.3 SWRU455A – February 2017 – Revised March 2017 Contents Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 4 8.9.3 Commit a Bundle ....................8.9.4 Rollback a Bundle ................8.9.5 Retrieve the Bundle and Files State ..................8.9.6 CC3220 Bundle Aspects Contents SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 5 ..............9.6.3 PUT and DELETE Request Search Order ..................Host HTTP Requests Processing ................... 9.7.1 Metadata (TLVs) Description ....................9.7.2 GET Processing SWRU455A – February 2017 – Revised March 2017 Contents Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 6 ......................... 12.3 Limitations ........................Transceiver ........................ 13.1 Introduction ......................13.2 Key Features ....................13.3 Configurations and Setting ..................13.3.1 Open Transceiver Socket Contents SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 7 15.10 Common Events and Errors ..................15.10.1 Provisioning Status Event ................15.10.2 Provisioning Profile-Added Event ..................15.10.3 Reset Request Event ......................15.10.4 Errors SWRU455A – February 2017 – Revised March 2017 Contents Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 8 17.7.2 Locking Objects ..................17.8 Implement Timestamp Services ................17.9 Set Asynchronous Event Handler Routines ......................... Host APIs ........................Persistency ........................Revision History Contents SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 9 15-9. Successful SmartConfig Provisioning While External Configuration Enabled ....................16-1. Secure Content Delivery ......................... 16-2. File Format ......................17-1. User.h Location SWRU455A – February 2017 – Revised March 2017 List of Figures Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 10 ....................9-2. Configuration Options ....................... 9-3. Ping Options ......................9-4. IP Configurations ...................... 9-5. URN Configurations ......................9-6. WLAN Profiles List of Tables SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 11 16-1. Key Features ......................16-2. Common Errors ....................17-1. : Selecting Capabilities ........................A-1. Host APIs ...................... B-1. Persistency Settings SWRU455A – February 2017 – Revised March 2017 List of Tables Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 12: Overview

    100 percent code reuse when your design requirements change. For more information, visit www.ti.com/simplelink. The SimpleLink Wi-Fi Internet-on-a chip™ family of devices from Texas Instruments™ provides a suite of integrated protocols for Wi-Fi and Internet connectivity, to dramatically simplify the implementation of Internet-enabled devices and applications.
  • Page 13: Simplelink Wi-Fi Solution Block Diagram

    NOTE: The target application can choose to use the preferred networks option (profiles), instead of using the sl_WlanConnect command. This option allows the host application to completely offload the entire management of the WLAN connection. SWRU455A – February 2017 – Revised March 2017 Overview Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 14: Networking Subsystem Block Diagram

    Transceiver / NS Bypass IPv4 IPv6 IPv6 ICMP IGMP ICMP/NDP Rx Filter Provisioning WLAN Crypto Util Figure 1-2. Networking Subsystem Block Diagram Overview SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 15: Acronyms And Terminologies

    Network applications and Ping utilities HTTP/HTTPS web server (including dynamic user call backs and RESTful API support) mDNS DNS-SD DHCP server Host interface UART/SPI SWRU455A – February 2017 – Revised March 2017 Overview Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 16: Host Driver Overview

    More information on the adaptation layer is in the host interface section, see Chapter 3 Chapter Overview SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 17: Os Versus Non-Os

    1.4.3 Quick Reference Figure 1-3 shows a quick reference to the entire set of APIs provided by the host driver. SWRU455A – February 2017 – Revised March 2017 Overview Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 18: Quick Host Apis Reference

    - Application Event Handler sl_FsDel sl_FsCtl sl_FsProgram sl_FsGetFileList NetCfgEventHandler NetUtilEventHandler Figure 1-3. Quick Host APIs Reference For more information on these APIs, refer Appendix Overview SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 19: Porting To Different Platforms

    Figure 1-4. Host Driver Adaptation Modules (Platform-Dependent) For more information about porting the driver to new platforms, see Chapter SWRU455A – February 2017 – Revised March 2017 Overview Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 20: Networking Application

    2.1.5 Power Consumption ..................... 2.1.6 Provisioning ....................Basic Examples ..................2.2.1 Wi-Fi Doorbell ..................2.2.2 Power Socket ....................2.2.3 Wi-Fi Tag Networking Application SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 21: Introduction

    Wi-Fi connectivity can be used in a wide range of products with different use cases and requirements. Figure 2-1 shows some of the available connectivity options and their considerations. SWRU455A – February 2017 – Revised March 2017 Networking Application Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 22: Traffic Types

    From a power consumption perspective, connection-oriented protocols may consume more power due to the connection- establishing overhead and connection maintenance. Networking Application SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 23: Security

    Regular socket operation or trigger mode (lets the host enter a deep sleep and is awakened by the SimpleLink Wi-Fi device when data arrives) More details are in Chapter SWRU455A – February 2017 – Revised March 2017 Networking Application Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 24: Provisioning

    The power socket must be available for smartphone apps at any time with no delay, and are occasionally connected to the server for software updates. 2.2.2.2 Design Constraints Table 2-2 lists the design constraints for power socket applications. Networking Application SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 25: Wi-Fi Tag

    IP: Decrease the number of DNS requests, resolve once and keep the address, only as a result of TCP connection failure, resolve again User experience None None Provisioning None None SWRU455A – February 2017 – Revised March 2017 Networking Application Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 26: Device

    Time and Date ..................... MAC Address ...................... Device Name ....................3.10 Domain Name ..................... 3.11 Device Status ..................3.12 Persistent Configuration ....................... 3.13 Errors Device SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 27: Introduction

    This time-out value determines the maximum time the device waits. The function returns when all the activities are performed even before the time-out expires. SWRU455A – February 2017 – Revised March 2017 Device Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 28: Hibernate And Shutdown

    3.3.5 Initialization Sequence During the INIT sequence, the host driver runs the following key steps: Device SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 29: Host Interface

    The SimpleLink Wi-Fi host driver is written in strict ANSI C89 for full compatibility with most embedded platforms and development environments. The following information is relevant for the SimpleLink Wi-Fi CC3120 wireless network processor, which must implement a communication interface with a selected MCU.
  • Page 30: Uart Interface

    CC3120 MISO H.IRQ nHib Copyright © 2017, Texas Instruments Incorporated Figure 3-1. Typical CC3120 Setup (SPI) 3.4.2 UART Interface The SimpleLink Wi-Fi device supports a standard UART interface with a hardware flow control (RTS/CTS). The default baud rate is 115,200 bps and can be increased to 3 Mbps.
  • Page 31: Typical Cc3120 Setup (Uart)

    CC3120 GPIO nHib Copyright © 2017, Texas Instruments Incorporated Figure 3-2. Typical CC3120 Setup (UART) Working with the UART interface requires the use of hardware flow control to avoid data loss. UART hardware flow control works in a way that an entity that is ready to accept data, keeps its RTS line asserted.
  • Page 32: Version

    The SimpleLink Wi-Fi device gives users the option to set, and get time and date configuration from the RTC on the device. The RTC is a continuous counter which is active even during hibernation and resets only after shutdown. Device SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 33: Mac Address

    The maximum length of the device name is 32 characters, and the following characters are allowed: • a through z • A through Z • 0 through 9 • – SWRU455A – February 2017 – Revised March 2017 Device Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 34: Domain Name

    /* RX filer event dropped */ The full list of possible values for possible device status or asynchronous events can be found in the host driver. Device SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 35: Persistent Configuration

    (call sl_Stop followed by sl_Start). SL_DEVICE_EVENT_FATAL_CMD_TIMEOUT slcb_DeviceFatalErrorEvtHdlr Notifies fatal error. The command time-out has expired. User must perform device restart (call sl_Stop followed by sl_Start). SWRU455A – February 2017 – Revised March 2017 Device Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 36: Common Error Codes

    Error during programming. Program new image should be invoked (see sl_FsProgram). SL_ERROR_DEVICE_LOCKED_SECURITY_ALLERT –28674 Number of security alerts exceeded or system file integrity error; device is locked. Device SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 37: Wlan

    Enterprise Security ...................... 4.6.3 ......................... Scan ..................4.7.1 General Description ................4.7.2 Configuration (AP/STA) ....................4.7.3 Usage ................... 4.7.4 Miscellaneous ....................... Calibrations SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 38: Introduction

    There are several configurations for each specific use. Some of the configurations are persistent according to the system-persistent configuration, some are persistent and nonpersistent as specified in each configuration specification (more information is in Appendix WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 39: Default Parameters In Station Mode

    TX power. The value represents steps from 0 to 15 which reflect as dBm offsets from maximum power (0 means maximum power) according to Figure 4-1. SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 40: Tx Output Power Vs Tx Power Settings

    – JP, EU: Channels 1–13 Example: _i16 Status; Str[] = "US"; Status = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE, 2, Str); if( Status ) /* error */ WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 41: Connection

    An example of an Auto and Fast and Auto provisioning connection policy follows: _i16 Status; Status = sl_WlanPolicySet(SL_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(1,1,0,1),NULL,0); if( Status ) /* error */ SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 42 An example for getting the information on a profile at index 2 follows: _i16 index, Status; signed char Name[32]; _i16 NameLength; unsigned char MacAddr[6]; SlWlanSecParams_t SecParams; SlWlanGetSecParamsExt_t SecExtParams; _u32 Priority; WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 43 The host application should wait for the connection asynchronous events as in all other connection methods. SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 44: Events And Errors

    –2061 SL_ERROR_WLAN_PREFERRED_NETWORK_LIST_FULL –2062 No free profile SL_ERROR_WLAN_INVALID_POLICY_TYPE –2066 Invalid policy type. Value is not supported. SL_ERROR_WLAN_WIFI_ALREADY_DISCONNECTED –2071 Applying disconnect command when disconnected WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 45: Access Point

    API should be called. _i16 Role; _i16 Status; Status = sl_WlanSetMode(ROLE_AP); if( Status ) /* error */ sl_Stop(0); Role = sl_Start(NULL,NULL,NULL); SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 46 The default channel in AP mode is 6. Example: _i16 Status; channel = 1; Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_CHANNEL, 1, (_u8 *)& channel); WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 47 The default value is 60 seconds. Example: _i16 Status; _u16 max_ap_sta_aging = 50; Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_MAX_STA_AGING, sizeof(max_ap_sta_aging), (_u8 *)&max_ap_sta_aging); SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 48 AP mode configuration can be retrieved by host commands. Each set parameter (discussed in the previous section) can be retrieved with the following API, and the same configuration ID and configuration option. Example: WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 49 = { 0x00, 0x22, 0x33, 0x44, 0x55, 0x66 }; Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_DEL_MAC, sizeof(sta_mac), (_u8 *) &sta_mac); if( Status ) /* error */ SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 50: Set Network Configuration

    • IP – IPv4 static address • Subnet mask – IPv4 network mask address • Default gateway – IPv4 default gateway address WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 51: Station Management

    = sl_NetCfgGet(SL_NETCFG_AP_STATIONS_INFO_LIST, &start_sta_index, &sta_info_len, (_u8 *)ApStaList); if( Status ) /* error */ /* extract actual stations in the response */ actual_num_sta = sta_info_len / sizeof(SlNetCfgStaInfo_t); SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 52: Events And Errors

    A maximum of four stations can connect to the SimpleLink Wi-Fi device in AP mode. • Only 802.11bg is supported. • No power save support in AP mode. WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 53: Wi-Fi Direct

    Static with the following parameters: IP 10.123.45.1, Subnet mask: 255.255.255.0 Default gateway: 10.123.45.1, DNS: 10.123.45.1 Device name mysimplelink_XX (xx = Random 2 characters) SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 54 /* error */ • Set Device Name The device name must be unique because the Wi-Fi Direct connection is device-name based. The WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 55 SL_WLAN_P2P_POLICY. Three defines can be used when setting the intent: 1. SL_WLAN_P2P_ROLE_CLIENT (intent 0): Indicates that the device is forced to be CLIENT. SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 56 If the device was CLIENT in its last connection (before reset or remote disconnect) then following the reset, users must send the p2p_invite to the previously WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 57: Connection

    By receiving the network list, the user can immediately find any remote Wi-Fi Direct device and issue a manual connection or add profile command. Example: SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 58 This command performs immediate Wi-Fi Direct discovery, and once the remote device is found, the negotiation phase is started according to the negotiation initiator policy, method, and intent selected. WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 59 /* Set P2P as active mode */ Status = sl_WlanSetMode(ROLE_P2P); /* Set Wi-Fi Direct client dhcp enable (assuming remote GO running DHCP server) */ SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 60: Events And Errors

    Indicates that Wi-Fi Direct disconnect is successfully completed. The device is Wi-Fi Direct CLIENT and contains the remote device parameters: – SSID WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 61: Common Errors

    Wi-Fi Direct mode is not configured yet, and should be CL or GO to NOT_CONFIGURED execute the command. SL_ERROR_WLAN_INVALID_ROLE -2050 Action applied does not match the current mode. SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 62: Limitations

    13 or 26 characters in ASCII format SL_WLAN_SEC_TYPE_WEP_SHARED WEP shared security 5 or 10 characters in HEX format 13 or 26 characters in ASCII format WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 63: Enterprise Security

    • Client Authentication If the server requires client authentication, the following files are required: SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 64 The SimpleLink Wi-Fi supports only one enterprise profile and requires using the above-specified file names. An example of manual connection to an enterprise network: SlWlanSecParams_t SecParams; SlWlanSecParamsExt_t SecExtParams; _i16 Status; SecParams.Type = SL_WLAN_SEC_TYPE_WPA_ENT; WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 65: Wps

    SlWlanSecParams_t SecParams; SecParams.Type = SL_WLAN_SEC_TYPE_WPS_PIN; SecParams.KeyLen = strlen("11361435"); SecParams.Key = "11361435": Status = sl_WlanConnect("WPS_AP",strlen("WPS_AP"),NULL, &SecParams ,NULL); if( Status ) /* error */ SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 66: Scan

    /* error */ • Getting Scan Results Scan results can be retrieved after setting the scan policy. Each scan cycle updates the results (added, WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 67: Usage

    Triggered mode does not issue calibrations unless absolutely necessary, or manually triggered. SWRU455A – February 2017 – Revised March 2017 WLAN Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 68: Calibration Modes

    INIT to INIT failure (lock the Image Creator tool. failure (lock state) state) but no re- but no re- calibration. calibration. WLAN SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 69: Network Addresses

    5.5.1 Enable and Disable the DHCP Server ............... 5.5.2 Set DHCP Server Parameters ......................DNS Server ............... Errors and Asynchronous Events SWRU455A – February 2017 – Revised March 2017 Network Addresses Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 70: Introduction

    Up to two IP addresses: • Local (mandatory): Stateless – Link-Local Address (FE80::/64) Statefull (DHCPv6) Static • Global (optionally): Stateless Statefull (DHCPv6) Static Network Addresses SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 71: Ipv4 Addresses

    // _u32 Default gateway address ipV4.IpDnsServer = (_u32)SL_IPV4_VAL(8,8,8,8); // _u32 DNS server address Status = sl_NetCfgSet(SL_NETCFG_IPV4_STA_ADDR_MODE,SL_NETCFG_ADDR_STATIC,sizeof(ipV4),(_u8*)&ipV4); if( Status ) // error SWRU455A – February 2017 – Revised March 2017 Network Addresses Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 72: Ipv6 Addresses

    0, sizeof(ipV6)); ipV6.Ip[0] = 0xfe800000; ipV6.Ip[1] = 0x00000000; ipV6.Ip[2] = 0x00004040; ipV6.Ip[3] = 0x0000ce65; Status = sl_NetCfgSet(SL_NETCFG_IPV6_ADDR_LOCAL,SL_NETCFG_ADDR_STATIC,sizeof(ipV6),(_u8*)&ipV6); if( Status ) // error Network Addresses SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 73: Dns Addresses

    IP address is acquired by a full DHCP process. This mode allows the host to communicate with devices faster than other DHCP modes. Example: _i16 Status; SWRU455A – February 2017 – Revised March 2017 Network Addresses Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 74: Address Release

    DHCP server. The SimpleLink device enables a special mode that releases the IP address on requested WiFi disconnect commands from the host application. This mode is not enabled by default. Network Addresses SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 75: Dhcpv4 Server

    The range of the DHCP server addresses must be in the subnet of the AP IP address. This configuration is persistent. The configuration should be performed when the DHCP server is down. SWRU455A – February 2017 – Revised March 2017 Network Addresses Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 76: Dns Server

    DNS server address. configuration or DHCPv4 opportunistic renew configuration. • Delay between the connection and the event: DHCPv4, DHCPv4, fast renew or LLA. Network Addresses SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 77: Major Asynchronous Events In Netcfg Silo

    SL_ERROR_IPV6_LOCAL_AD The local IPv6 address must be Supported IPv6 is not supported DR_SHOULD_BE_SET_FIRST enabled when the global IPv6 address is enabled. SWRU455A – February 2017 – Revised March 2017 Network Addresses Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 78 SL_NETAPP_EVENT_IPV4_ACQUIRED events, if the new IP is different from the previous IP, TI highly recommends closing the relevant sockets, and opening new sockets before any transmit and receive occurs. Network Addresses SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 79: Socket

    6.5.1 ...................... 6.5.2 ...................... 6.5.3 ..........................................Operation Modes ..................6.7.1 Nonblocking Mode .................... 6.7.2 Trigger Mode ....................IP Fragmentation ....................... Errors SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 80: Introduction

    – Layer 1: Physical (available only if the device is not connected to a wireless network). – Layer 2: Data Link (MAC) – Layer 3: Network – Layer 4: Transport Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 81: Bsd Api

    /* Send using BSD API and checking errno value */ (send(sock , pBuff, sizeof(pBuff), 0) == -1) errsv = errno; printf("send() failed\n"); (errsv == ...) { ... } SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 82: Socket Working Flow

    Figure 6-1 describes the general flow of TCP between a server and a client. Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 83: Tcp Socket Flow

    By default: the sl_Close API returns immediately, while the close process is done internally. The socket is closed only after all queued packets successfully transmit. If the device failed to transmit SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 84 6. Close the data socket. To close a connection with a specific client, the close operation should be called Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 85 Status = sl_Listen(Sd, 1); if( Status ) // error ClientSd = sl_Accept( Sd, ( SlSockAddr_t *)&Addr, &AddrSize); if(0 > ClientSd) // error SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 86: Udp Socket Flow

    IPv4 socket, by mapping the source address to IPv6 format (for example, ::00:ffff:ipv4). • Connection-Oriented – Connect – Calling the API sl_Connect for UDP sockets defines the destination address. By Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 87 Users can support up to eight IPv4 multicast groups and up to eight IPv6 multicast groups. Two UDP sockets which join the same group decrease the available multicast group only by one. SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 88: Multicast

    RAW sockets provide access to the underlying communication protocols with socket abstractions. The working flow is very similar to a connectionless socket (UDP). Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 89 // error The SimpleLink transceiver mode lets the host transmit Wi-Fi frames in disconnected mode only. For more detailed information, see Chapter SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 90: Dns

    // error An example of resolving the IPv6 address: _i16 Status; _u32 Ipv6Addr[4] = {0}; Status = sl_NetAppDnsGetHostByName("www.facebook.com",strlen("www.facebook.com"),Ipv6Addr,SL_AF_INET6); if( Status ) // error Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 91: Tcp Udp Raw

    _i16 Status; SlSockNonblocking_t BlockingOption; BlockingOption.NonBlockingEnabled = 1; // Enable or disable non-blocking mode Status = sl_SetSockOpt(Sd,SL_SOL_SOCKET,SL_SO_NONBLOCKING,(_u8*)&BlockingOption,sizeof(BlockingOption)); if( Status ) if( Status ) SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 92: Trigger Mode

    To define the host application in trigger mode follow these steps: • Define host IRQ as the host wake up source. • Ensure slcb_SocketTriggerEventHandler is registered under user.h and handle the trigger Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 93: Trigger Mode Flow

    1. Open the TCP Server Socket and call sl_Select on the following socket. _i16 Status,Sd,LocalSd; _u16 nfds; SlSockAddrIn_t LocalAddr,Addr; SlTimeval_t timeVal; SlFdSet_t rxSet; SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 94 SlTimeval_t timeVal; SlFdSet_t rxSet; RecvBuf[1460]; timeVal.tv_sec = 0; timeVal.tv_usec = 0; //Open TCP client socket Sd = sl_Socket(SL_AF_INET,SL_SOCK_STREAM, 0); if( Status ) Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 95: Ip Fragmentation

    (full possible error list is under the file error.h in the host driver). Table 6-5 lists errors indicated by asynchronous events. SWRU455A – February 2017 – Revised March 2017 Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 96: Asynchronous Error Events

    SL_ERROR_BSD_ENETUNREACH –101 Network is unreachable SL_ERROR_BSD_ETIMEDOUT –110 Connection timed out SL_ERROR_BSD_ECONNREFUSED –111 Connection refused SL_ERROR_BSD_EALREADY –114 Nonblocking connect in progress, try again Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 97: Secure Socket

    Supported Cryptographic Algorithms ............Common Errors and Asynchronous Events ............7.7.1 Using Socket Asynchronous Events in SSL ..................7.7.2 Common Errors SWRU455A – February 2017 – Revised March 2017 Secure Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 98: Introduction

    After the socket has been created, it is possible to use the standard *BSD commands (sl_Close, sl_Listen, sl_Accept, sl_Bind, sl_SetSockOpt, and so forth). Secure Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 99: Trusted Root-Certificate Catalog

    Set specific SSL versions for the socket. This should be called before sl_Connect or sl_Listen. • SL_SO_SEC_METHOD_SSLV3 • SL_SO_SEC_METHOD_TLSV1 • SL_SO_SEC_METHOD_TLSV1_1 • SL_SO_SEC_METHOD_TLSV1_2 SWRU455A – February 2017 – Revised March 2017 Secure Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 100: Set Cipher Suites

    DH files are Diffie Hellman parameters files. These parameter files contain parameters for generating a DH key when using DHE cipher suites in server mode. Secure Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 101: Disable The Use Of The Trusted Root-Certificate Catalog

    This is done by using this sl_SetSockOpt, before the sl_Connect or sl_Listen commands. Example: _u32 dummyVal; _i16 status; status = sl_SetSockOpt(SockID,SL_SOL_SOCKET, SL_SO_SECURE_DISABLE_CERTIFICATE_STORE, SWRU455A – February 2017 – Revised March 2017 Secure Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 102: Set Alpn List

    Example: void slcbSockEvtHdlr(SlSockEvent_t* pSlSockEvent) Secure Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 103 = sl_Connect(sd, ( SlSockAddr_t *)&Addr, AddrSize); if(status < 0) /* error... */ /* unsecured transaction */ len = sl_Recv(sd,buf,100,0); if(len < 0) SWRU455A – February 2017 – Revised March 2017 Secure Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 104: Get Connection Parameters

    SlSockSSLConnectionParams_t conPa; _i16 status; SlSocklen_t len = sizeof(SlSockSSLConnectionParams_t); status = sl_GetSockOpt(SockID,SL_SOL_SOCKET,SL_SO_SSL_CONNECTION_PARAMS,&conPa,&len); Supported Cryptographic Algorithms Table 7-3 lists the supported cryptographic algorithms. Secure Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 105: Common Errors And Asynchronous Events

    CommonName of the CA root expected to verify the certificate. Example: void slcbSockEvtHdlr(SlSockEvent_t* pSlSockEvent) char *CAname; if(SL_SOCKET_ASYNC_EVENT == pSlSockEvent->Event) /* debug print "an event received on socket %d\n",pSlSockEvent- >SocketAsyncEvent.SockAsyncData.Sd */ SWRU455A – February 2017 – Revised March 2017 Secure Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 106: Common Errors

    Connected but the root CA used to verify the peer is unknown to TI. That means it does not appear in the trusted root- certificate catalog. Secure Socket SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 107: File System

    Chapter 8 SWRU455A – February 2017 – Revised March 2017 File System SWRU455A – February 2017 – Revised March 2017 Secure Socket Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 108 File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 109 ..............8.15.2 Software Design Consideration ............8.15.3 Retrieving Info Regarding SFLASH Usage ..................8.15.4 SFLASH Size ................ 8.15.5 Storage Usage Information SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 110: Introduction

    Return to the programmed image Security alerts Development/production format Option to create a development image which can run on specific MAC. File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 111: File System Characteristics

    1. Open the file for create or write, function sl_FsOpen(). 2. Write the file, function sl_FsWrite (); can be called several times. SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 112: Create A File Versus Open For Write

    SL_FS_OVERWRITE | SL_FS_CREATE_SECURE | SL_FS_CREATE_NOSIGNATURE | SL_FS_CREATE_MAX_SIZE( MaxSize ), &MasterToken); if(FileHdl < 0 ) /* error */ /* abort */ sl_FsClose(FileHdl,0,'A',1); File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 113: Create A File

    SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 114: Creation Flags

    //CC3220R/CC3220S /sys/mcuflashimg.bin //CC3220SF /sys/cert/private.key Secure Secure, blocked for The files contain the key and certificate for /sys/cert/client.der read SSL connection. /sys/cert/ca.der File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 115: Open A File For Write

    The file system sets the actual file size as the higher offset that was written; the actual file size can be retrieved by the sl_FsGetInfo() function. SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 116: Close An Opened (For Write) File

    SL_ERROR_FS_WRONG_CERTIFICATE_FILE_NAME: For a secure signed file, if one of the certificates in the chain of trust is missing, it does not trigger security alerts. Close nonsigned file example: _i32 FileHdl; File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 117: Close An Opened (For Write) Secure-Signed File

    For a list of supported CAs, see the security application document. Example for secure-signed files close function: _i32 FileHdl; _i16 Status; const CeritificateFileName[180]; const Signature[256]; const _u32 SignatureLen; SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 118: Read A File

    (sockets) for the operation; in this case, the host can repeat the read operation after a while (or reduce the traffic overload while reading a file). File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 119: Close An Opened (For Read) File

    Deleting of a file removes its storage from the file system and updates the files allocation table. Deleting is done by the host function sl_FsDel(). SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 120: Rename A File

    (SL_FS_INFO_NOT_VALID_EXISTS). Example: _i16 Status; DeviceFileName[180]; File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 121: Get Storage Information

    Table 8-4 shows a common work flow of using the bundle. SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 122: Bundle File States

    (the bundle states are described in the following section). File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 123: Bundle States

    (SL_FS_CTL_ROLLBACK...), after calling the command reboot is required. • The sl_Start() function is called; automatic rollback is triggered by the device. SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 124: Commit A Bundle

    0xAE42DB15 typedef struct sBootInfo ucActiveImg; _u32 ulImgStatus; _u32 ulStartWdtKey; _u32 ulStartWdtTime; }sBootInfo_t; _sBootInfo_t sBootInfo; _u32 MasterToken = 1234; FileHdl; _i32 Status; File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 125: File Commit Feature

    Committing a file approves the new content of the file; at the end of the process, the file state is changed to standard file. SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 126: File Rollback Process

    The image can be programmed to the device using one of the following methods: • Image Creator tool (by UART lines) File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 127 Important: The entire SFLASH should be erased before programming the image. The extraction process considers that the SFLASH is erased, except to the programming image storage. 2. Assemble the SFLASH to the device. SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 128: Restore To Factory

    Extraction depends on the vendor programming image size and the SFLASH type. If the device was reset during the extraction, the extracting process continues when the device is powered up. File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 129: Restore To Factory By The Host

    NULL, 0 , NULL ); ((_i32)Status < 0) /*error*/ //Status is composed from Signed error number & extended status Status = (_i16)Status>> 16; SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 130: Restore To Factory By Using The Sop

    CC3220: If the user sets the SOP to 010 in Step 2, the scenario described in Step 5 will not work. File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 131: Security Alerts

    Writing to the system with SFLASH requires consideration in the software design to maximize the SFLASH capabilities and expand the SFLASH life-time. The following is a list of design recommendations: SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 132: Retrieving Info Regarding Sflash Usage

    66 blocks, service pack • Host size blocks, for the CC3220 device: storage for the host program. • Blocks for the vendor files File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 133: Storage Usage Information

    Figure 8-1 is an example of the Image Creator log, which is displayed during the image generation. Figure 8-1. Image Creator Log SWRU455A – February 2017 – Revised March 2017 File System Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 134: Http Server

    Chapter 9 SWRU455A – February 2017 – Revised March 2017 HTTP Server File System SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 135 SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 136 .................. 9.7.5 DELETE Processing ......................Security ..................9.8.1 Authentication ................... 9.8.2 Secure Connection ....................... Other ..............9.9.1 Processing of Parallel Requests HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 137: Introduction

    Settings are changed through HTTP POST requests to hard coded resource names. This is handled by the device and transparent to the host, as shown in Figure 9-2. SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 138: Custom Static

    These resources are static, as their content remains constant. Serving these resources is handled completely by the HTTP server and is transparent to the host as seen in Figure 9-4. HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 139: Static

    This can be seen in Figure 9-6. SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 140: Host Application Interface

    Table 9-1. Key Features Feature Description HTTP Support version 1.0, single client, GET&POST requests HTTPS SSL connections to the server are supported. HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 141: Configurations And Settings

    FILENAME exchange when secure socket is enabled SL_NETAPP_HTTP_CA_CERTIFICATE_FILE Certificate file name which will be _NAME used for client authentication (if present). SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 142: Restful Api Processing

    Address of primary DNS server in station (__SL_P_N.H=8.8.8.8) (__SL_P_N.H) mode Address of primary AP DNS server Address of primary DNS server in AP (__SL_P_N.U=8.8.8.8) (__SL_P_N.U) mode HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 143: Urn Configuration

    Security key or PIN code. Must not __SL_P_P.C=MySecurePassword exceed 64 characters. Priority (__SL_P_P.D) Priority of the profile. Must be from 0 to __SL_P_P.D=1 SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 144: Wlan Scan

    For example, the following request triggers 3 scan cycles with 10-second intervals between them: POST /api/1/wlan/en_ap_scan HTTP/1.1 Host: mysimplelink.net Content-Type: application/x-www-form-urlencoded HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 145: Provisioning Confirmation

    When the device is in AP mode, posts to /api/1/wlan/en_ap_scan/ap_aclist can be made to control the black list, which indicates stations are not allowed to connect to the device. Table 9-12 lists these parameters. SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 146: Date And Time

    The token name has a rigid convention of “__SL_G_” followed by three characters of the parameter ID (for example, __SL_G_T.A). HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 147: Retrieving Tokens Through Get Request

    __SL_G_S.K Safe Mode Status If device is in safe mode – return Safe Mode, if not return empty string. SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 148: Version Information

    __SL_G_LSO STA IPv6 Local Address Mode Returns Disabled / Static / Stateless / Statefull according to the configured local address mode HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 149 “ - “ is __SL_G_CI2 index. returned if no station is connected. __SL_G_CI3 __SL_G_CI4 SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 150: Ping Results

    Auto Smart Config If auto smart config is enabled, returns Checked, else returns Not_Checked. Used in the Auto Smart Config checkbox. HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 151: Provisioning

    Return profile 5 Priority __SL_G_PP6 Return profile 6 Priority __SL_G_PP7 Return profile 7 Priority 9.5.10 P2P Information Table 9-21 lists the P2P information tokens. SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 152: P2P Information Tokens

    Neg Initiator Rand Backoff If negotiation initiator policy is Random Backoff, returns Checked, else returns Not_Checked. Used for negotiation initiator policy radio button. HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 153: Host Tokens

    Any request other than GET is not associated with these resources, and is transferred directly to the host. Additionally, to use the built-in configuration page, do not override any of the built-in pages, because this breaks functionality. SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 154: Post Request Search Order

    The application must then generate and send a response from its own context. HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 155: Metadata (Tlvs) Description

    SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_VERSION Version field of the HTTP request SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_REQUEST_URI URI string of the HTTP request SL_NETAPP_REQUEST_METADATA_TYPE_HTTP_QUERY_STRING Query string of the HTTP request SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 156: Metadata Breakout Examples

    /* NetApp request handler*/ void NetAppRequestHandler( SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse) _u32 HttpContentLength; (pNetAppRequest->requestData.MetadataLen > 0) HttpContentLength = ExtractLengthFromMetaData( pNetAppRequest->requestData.pMetadata, pNetAppRequest->requestData.MetadataLen); HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 157: Get Processing

    GET request without (1) and with (2) fragmentation. Figure 9-11. GET Request With and Without Fragmentation SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 158 The user must extract any relevant information from the request and save it as the data buffers are freed when the handler returns. void NetAppRequestHandler( SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse) switch(pNetAppRequest->Type) case SL_NETAPP_REQUEST_HTTP_GET: HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 159 (note the METADATA flag). Continuation flag indicates there are more fragments to follow. gHandle is assumed to be populated by the handler. Flags |= SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION; SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 160: Post Processing Flow

    SL_NETAPP_REQUEST_HTTP_POST: pNetAppResponse->Status = SL_NETAPP_HTTP_RESPONSE_200_OK; pNetAppResponse->ResponseData.pMetadata = NULL; pNetAppResponse->ResponseData.MetadataLen = 0; pNetAppResponse->ResponseData.pPayload = NULL; pNetAppResponse->ResponseData.PayloadLen = 0; pNetAppResponse->ResponseData.Flags = 0; HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 161 (if present) and actually send the response. Figure 9- demonstrates the data flow with delayed response. SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 162: Delayed Response

    SimpleLink device, but transferred as is, and must be validated by the user. void NetAppRequestHandler( SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse) extern _u16 gHandle; switch(pNetAppRequest->Type) case SL_NETAPP_REQUEST_HTTP_POST: _u32 RequestFlags; _u32 ContentLength; HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 163 ((RetVal < 0) | (Flags & SL_NETAPP_REQUEST_RESPONSE_FLAGS_ERROR)) // API error, abort. Error code can be extracted as follows: // ErrorCode = SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 164: Put Processing

    PEM or DER format, and their names must be configured in the HTTP server. The following example shows how to enable the secure socket and use the secondary socket for redirection. unsigned char ServerCertificateFileName[] = "server-cert.der"; HTTP Server SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 165: Other

    TCP connections to the server simultaneously, and each request is handled in order. SWRU455A – February 2017 – Revised March 2017 HTTP Server Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 166 Get Service List ....................10.6 Advertisement ................ 10.6.1 Registering mDNS Services ..............10.6.2 Unregistering mDNS Services ................10.6.3 Advertisement Settings ....................... 10.7 Limitations mDNS SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 167: Key Features

    This configuration is persistent according to system- persistent configuration. Example: _i16 Status; /* Start mDNS */ Status = sl_NetAppStart(SL_NET_APP_MDNS_ID); if( Status ) /* Error */ SWRU455A – February 2017 – Revised March 2017 mDNS Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 168 (not stored in the cache), the adapt bit can be set in the event mask related to according to the following list: mDNS SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 169 SlNetAppGetShortServiceIpv4List_t listMdns[6]; /* Get a list of discovered services */ Status = sl_NetAppGetServiceList(0, 6, /* Maximum number of services to receive */ SWRU455A – February 2017 – Revised March 2017 mDNS Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 170 If the service was originally created as nonpersistent, unregister should apply with the nonpersistent flag accordingly, otherwise an error returns. Example: _i16 Status; _u32 Options; mDNS SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 171 If the service was originally created as nonpersistent, updating the text should apply with the nonpersistent flag accordingly, otherwise an error returns. Example: _i16 Status; SWRU455A – February 2017 – Revised March 2017 mDNS Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 172 The size of the discovered services text length should be smaller than 120 bytes. • This discovered service list is limited to eight services. mDNS SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 173 11.5.2 Get Filter Status ..................11.5.3 Removing a Filter ..............11.5.4 Storing Filters into the SFLASH ................11.5.5 Update Filter Arguments SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 174 Store filters; the function stores all the filters on the FS Figure 11-1 describes the processing of the Rx filters in high level. Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 175: Rx Filters

    Trigger is the precondition which should be fulfilled before the rule is checked, such as the system state. For example, the rule can be defined to be active only on promiscuous mode. SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 176: Rx Filter Match Flow

    AP (Access Point / Wi-Fi Direct GO) Promiscuous Wi-Fi Connection State Connected Disconnected Counter Value Numeric value Table 11-2 lists the possible rules of a filter. Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 177: Possible Rules

    • In any case, packets that were not dropped during the matching process continue with the other (regular) network stack processing. SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 178 If a unicast UDP frame is received from MAC address AA.BB.CC.DD.EE.FF or CC.HH.II.JJ.KK.LL, pass only packets from port 5001. The following filters should be created: Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 179 The filter flag dictates the filter behavior, by a bit field, and the following flags are supported: • SL_WLAN_RX_FILTER_BINARY – For creating a basic filter, usually the binary flag is set; a nonbinary SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 180 • SL_WLAN_RX_FILTER_HFIELD_BSSID • SL_WLAN_RX_FILTER_HFIELD_MAC_SRC_ ADDR • SL_WLAN_RX_FILTER_HFIELD_MAC_DST_ADDR • SL_WLAN_RX_FILTER_HFIELD_FRAME_LENGTH • SL_WLAN_RX_FILTER_HFIELD_ETHER_TYPE • SL_WLAN_RX_FILTER_HFIELD_IP_VERSION • SL_WLAN_RX_FILTER_HFIELD_IP_PROTOCOL • SL_WLAN_RX_FILTER_HFIELD_IPV4_SRC_ADDR • SL_WLAN_RX_FILTER_HFIELD_IPV4_DST_ADDR • SL_WLAN_RX_FILTER_HFIELD_IPV6_SRC_ADRR Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 181: Possible Compare Functions

    11-5, whenever byte stream parameters are used, the host code must set the filter flags as follows: FilterFlags |= RX_FILTER_BINARY Table 11-5 describes the rules types and their possible values. SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 182: Rule Types

    0xE8 QOS CF POLL 0xF8 QOS CF ACK POLL SL_WLAN_RX_FILTER_HFIELD_BSS Rule.Args.Value.Bssid SL_WLAN_RX_FILTER_HFIELD_MA Rule.Args.Value.Mac C_SRC_ ADDR SL_WLAN_RX_FILTER_HFIELD_MA Rule.Args.Value.Mac C_DST_ADDR SL_WLAN_RX_FILTER_HFIELD_FRA Rule.Args.Value.FrameLength ME_LENGTH Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 183 Length, or how many bytes: can be 1 to 16 • Pattern to compare with: can be up to 16 bytes • Masking: bit masking on the pattern SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 184 FALSE. A list of parameters that define a trigger follows: Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 185: Rule Types Layers

    Unicast destination IP (V4 and V6) IP PROTOCOL field (UDP, TCP, ICMP, IGMP, and so forth) Source port (UDP/TCP) Destination port (UDP/TCP) L4_PAYLOAD SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 186 /* Connection state and role, role is STA */ Trigger.Role = SL_WLAN_RX_FILTER_ROLE_STA; /* Work on any connection state */ Trigger.ConnectionState = SL_WLAN_RX_FILTER_STATE_STA_CONNECTED | SL_WLAN_RX_FILTER_STATE_STA_NOT_ CONNECTED | SL_WLAN_RX_FILTER_STATE_STA_HAS_IP | SL_WLAN_RX_FILTER_STATE_STA_HAS_NO_IP; Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 187 A received frame passes both filters. This results in two host events: event with bit X set and event with bit Y set. SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 188 %d, event type = %d \n",g_RxFilterEventsCounter,pEventData- >Type); for(i = 0;i < 64;i++) if(SL_WLAN_ISBITSET8(pEventData- >UserActionIdBitmap,i)) printf("User action %d filter event arrived\n",i); break; Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 189 To get the enable status of filters, call the sl_WlanGet API with the following arguments: • ConfigId: SL_WLAN_RX_FILTERS_ID • ConfigOpt: SL_WLAN_RX_FILTER_STATE Example: SWRU455A – February 2017 – Revised March 2017 Rx Filters Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 190 6); memcpy(updateFilterBuff.Args.Mask, MacMAsk, 6); updateFilterBuff.FilterId = FilterId; updateFilterBuff.BinaryOrAscii = 1; retVal = sl_WlanSet(SL_WLAN_RX_FILTERS_ID, SL_WLAN_RX_FILTER_UPDATE_ARGS, sizeof(SlWlanRxFilterUpdateArgsCommandBuff_t), (unsigned char *) &updateFilterBuff); Rx Filters SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 191 SWRU455A – February 2017 – Revised March 2017 Ping ........................... Topic Page ..................12.1 General Description ................... 12.2 Start and Stop Ping ....................... 12.3 Limitations SWRU455A – February 2017 – Revised March 2017 Ping Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 192 /* number of ping requests */ pingCommand.Flags = 0; /* report only when finished */ Status = sl_NetAppPing( &pingCommand, SL_AF_INET, &report, NULL ); (Status) /* error */ Ping SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 193 Status = sl_NetAppPing( &pingCommand, SL_AF_INET6, &report, NULL ) ; (Status) /* error */ 12.3 Limitations An infinite number of ping requests can be implemented only with a callback. SWRU455A – February 2017 – Revised March 2017 Ping Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 194 13.6.5 Change 802.11b Preamble .................. 13.6.6 Set CCA Threshold ................13.6.7 Set Tx Frames Time-out ..............13.6.8 Enable or Disable Sending ACKs ....................... 13.7 Limitations Transceiver SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 195: Key Features

    – SL_SOCK_RAW – Indicates an L1 mode raw socket (no respect for 802.11 medium access policy - CCA) – SL_SOCK_DGRAM – Indicates an L2 mode raw socket (respecting 802.11 medium access policies) SWRU455A – February 2017 – Revised March 2017 Transceiver Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 196 TRANSMITTER_ADDR 0x08, 0x00, 0x28, 0x5a, 0x78, 0x1e #define BSSID_ADDR 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF #define FRAME_NUMBER 0x00, 0x00 #define QOS_CTRL 0x00, 0x00 _i32 NumOfBytes =0; _i32 sock=0; Transceiver SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 197 Example of transmitting multiple data packets: void sendPacket(char * data) /* Base frame: */ #define FRAME_TYPE 0x88 #define FRAME_CONTROL 0x00 #define DURATION 0xc0,0x00 SWRU455A – February 2017 – Revised March 2017 Transceiver Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 198 Change the transceiver operational channel if changing the channel during packet transmission results in changing the channel, only after all packet transmission completes. Example: _i16 Status; _i16 channel = 9; Transceiver SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 199 NOTE: The PHY data rate parameter has no default value, and therefore must be through the sl_Send operation or through sl_SetSockOpt, as specified in this section. SWRU455A – February 2017 – Revised March 2017 Transceiver Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 200 The following values can be set: • SL_TX_INHIBIT_THRESHOLD_MIN (–88 dBm) • SL_TX_INHIBIT_THRESHOLD_LOW (–78 dBm) • SL_TX_INHIBIT_THRESHOLD_DEFAULT (–68 dBm) • SL_TX_INHIBIT_THRESHOLD_MED (–58 dBm) Transceiver SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 201 Transceiver mode is not available in connected mode. Auto-connection mode is also considered as connected mode, even if not connected. • sl_SendTo and sl_RecvFrom are not available in transceiver mode. SWRU455A – February 2017 – Revised March 2017 Transceiver Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 202 14.4.1 mDNS ..................14.4.2 HTTP Server .................... 14.5 Design Guidelines ................14.5.1 LSI and Packet Loss ................14.5.2 PHY Calibration Mode Power Managment SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 203: Power And Latency

    Use of the power-save feature of the 802.11 standard allows the device to consume very little power while maintaining a connection to an access point. SWRU455A – February 2017 – Revised March 2017 Power Managment Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 204: Power Policy

    The device HTTP server is automatically turned off if LSI is set to 2000 ms. This occurs because the chances of the server to successfully accept a client connection in these conditions are extremely low. Power Managment SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 205 (this also prevents changing the Tx power). For more information, see Section 4.8. SWRU455A – February 2017 – Revised March 2017 Power Managment Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 206 15.11.5 Successful AP Provisioning With Cloud Confirmation ............ 15.11.6 Using External Configuration Method: WAC ....15.11.7 Successful SmartConfig Provisioning While External Configuration Enabled Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 207: Key Features

    IoT devices are equipped with conventional input peripherals such as keyboards or touchscreens. The SimpleLink Wi-Fi CC3120, CC3220 Internet-on-a chip solution offers smart and fast built-in Wi-Fi provisioning capabilities, which lets end-users configure their IoT devices wirelessly using a smartphone or a tablet running a dedicated provisioning app.
  • Page 208: The Provisioning Environment

    Once the process is started, no further actions are needed. Figure 15-2 depicts the host application during a provisioning process. Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 209: The Provisioning Process

    If no profile was configured by the user for some time (inactivity time-out), the provisioning process automatically stops, and the provisioning-stopped event is sent to the host. SWRU455A – February 2017 – Revised March 2017 Provisioning Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 210 The host requested to stop the provisioning process by issuing a provisioning stop command. • There was no user activity for some time (defined by the inactivity time-out parameter). Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 211 If the smartphone app was able to connect the SimpleLink AP, it sends the device internal HTTP server a GET request for the confirmation result. If the profile confirmation failed because SWRU455A – February 2017 – Revised March 2017 Provisioning Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 212 (close all opened sockets, and so forth), restart the SimpleLink Wi-Fi device (by sending sl_stop and sl_start commands), and wait for the internal provisioning process to end. Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 213: Provisioning Status

    SL_WLAN_PROVISIONING_EXTERNAL_CONFI The host application may start running an external provisioning GURATION_READY method (relevant only when APSC + External Configuration mode is used). SWRU455A – February 2017 – Revised March 2017 Provisioning Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 214: Errors

    (such as NETAPP_IPACQUIRED) are blocked, and will not reach the host application (except for dedicated provisioning events, such as the provisioning status event). Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 215 They are blocked only after user activity was detected (such as when a profile is being configured). SWRU455A – February 2017 – Revised March 2017 Provisioning Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 216: Successful Smartconfig Provisioning

    The APIs between the host driver and the networking subsystem (commands and events) are blocked during the entire provisioning process. The host is allowed to send commands only after the provisioning_stopped event arrives. Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 217: Unsuccessful Smartconfig Provisioning

    After the smartphone app fails to find the device and collect the confirmation result on the local wireless network, it tries to get it by connecting directly to the SimpleLink device AP. SWRU455A – February 2017 – Revised March 2017 Provisioning Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 218: Successful Smartconfig Provisioning With Ap Fallback

    After the smartphone app fails to find the device and collect the confirmation result on the local wireless network, it tries to get it by connecting directly to the SimpleLink device AP. Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 219: Successful Ap Provisioning

    Get confirmation result (HTTP) Confirmation result Success (HTTP) Confirmation status success event Provisioning ended APIs allowed Provisioning stopped event Figure 15-6. Successful AP Provisioning SWRU455A – February 2017 – Revised March 2017 Provisioning Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 220: Successful Ap Provisioning With Cloud Confirmation

    – STA), in case confirmation is successful. For the same reason, the host must order the networking subsystem to stop the profile confirmation attempt (by sending the ABORT_EXTERNAL_CONFIRMATION command) in case confirmation failed. Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 221: External Configuration Method: Wac

    When the internal provisioning process is stopped, the host can continue with its external provisioning process. SWRU455A – February 2017 – Revised March 2017 Provisioning Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 222: Successful Smartconfig Provisioning While External Configuration Enabled

    Once the device is restarted, it starts the profile confirmation, and the internal provisioning process continues as usual. Provisioning SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 223 16.1.2 Limitations and Constraints ....................16.1.3 Errors .................. 16.2 Secured Content Delivery ..................16.2.1 Process Flow ................16.2.2 Encrypted File Format SWRU455A – February 2017 – Revised March 2017 Crypto Utilities Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 224: Key Features

    API. The key installation is persistent without consideration of system-persistent configuration, and is not erased over the power cycle. If the wanted index is already occupied by a key-pair, the install operation fails. Crypto Utilities SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 225 _i16 Status; _u16 resultLen; keyAttrib.ObjId = 1; /* key index is 1 */ keyAttrib.SubCmd = SL_NETUTIL_CRYPTO_TEMP_KEYS_CREATE; Status = sl_NetUtilCmd(SL_NETUTIL_CRYPTO_CMD_TEMP_KEYS, (_u8 *)&keyAttrib, sizeof(SlNetUtilCryptoCmdKeyMgnt_t), SWRU455A – February 2017 – Revised March 2017 Crypto Utilities Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 226 = 3; signAttrib.SigType = SL_NETUTIL_CRYPTO_SIG_SHAwECDSA; /* this is the only type supported */ configLen = 255; Status = sl_NetUtilCmd(SL_NETUTIL_CRYPTO_CMD_SIGN_MSG, (_u8 *)&signAttrib, sizeof(SlNetUtilCryptoCmdSignAttrib_t), Crypto Utilities SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 227: Common Errors

    SL_ERROR_NETUTIL_CRYPTO_BUFFER_TOO_SMALL -12295 The buffer provided by the host- application is not large enough to contain the returned output. SWRU455A – February 2017 – Revised March 2017 Crypto Utilities Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 228 At the end of this process, the file is saved on the SFLASH, and encrypted as a normal secured file with a different key and method than the file used for the reception process. Crypto Utilities SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 229: Secure Content Delivery

    Secured Content Delivery www.ti.com Figure 16-1 depicts this process. Figure 16-1. Secure Content Delivery SWRU455A – February 2017 – Revised March 2017 Crypto Utilities Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 230: File Format

    ECC X9.63 Public Key 65 Bytes (SECP256R1) SHA256 on RAW data 32 Bytes RAW data (AES256) n Bytes Figure 16-2. File Format Crypto Utilities SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 231 17.7.1 Sync Objects ..................17.7.2 Locking Objects ................17.8 Implement Timestamp Services ............17.9 Set Asynchronous Event Handler Routines SWRU455A – February 2017 – Revised March 2017 Porting the Host Driver Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 232 7. Implement timestamp services. 8. Bind asynchronous event handlers routines. The remainder of this chapter describes these steps in more detail. Porting the Host Driver SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 233: User.h Location

    The levels of the APIs are divided into two categories: normal and extended. Table 17-1 describes the available groups and their relative macros. SWRU455A – February 2017 – Revised March 2017 Porting the Host Driver Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 234: Selecting Capabilities

    SL_INC_NET_APP_PKG sl_NetAppStart sl_NetAppSend sl_NetAppStop sl_NetAppDnsGetHostByService sl_NetAppMDNSRegisterService sl_NetAppMDNSUnRegisterService sl_NetAppGetServiceList sl_NetAppPing Porting the Host Driver SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 235 17.5 Implement the Interface Communication Abstract Layer The SimpleLink Wi-Fi CC3120 device supports two standard communication interfaces: SPI and UART. SWRU455A – February 2017 – Revised March 2017 Porting the Host Driver Submit Documentation Feedback Copyright ©...
  • Page 236 The host driver provides a method to implement such schema. To allow this functionality, the user can define and implement the following macros: • sl_IfMaskIntHdlr • sl_IfUnMaskIntHdlr Porting the Host Driver SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 237 – Waits for a synchronization signal of a specific sync object. The calling thread is blocked on this function until the signal is generated or time-out value elapsed. If the function is called SWRU455A – February 2017 – Revised March 2017 Porting the Host Driver Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 238 – Handles events and errors of the WLAN silo • slcb_SockEvtHdlr – Handles events and errors of the Socket silo. Porting the Host Driver SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 239 – Frees a buffer used in a NetApp request. Allows the use of a dynamic memory buffer in these requests. SWRU455A – February 2017 – Revised March 2017 Porting the Host Driver Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 240: Host Apis

    Creates an endpoint for communication sl_Listen Socket Listens for connections on a socket sl_Accept Socket Accepts a connection on a socket Host APIs SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 241 Enables to format and configure the device with preprepared configuration sl_FsGetFileList Retrieves the list of stored files and their basic attributes SWRU455A – February 2017 – Revised March 2017 Host APIs Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 242: Persistency Settings

    System-persistent Register mDNS service sl_NetAppMDNSRegisterServic Optionally persistent Unregister mDNS service sl_NetAppMDNSUnRegisterSe Optionally persistent rvice Set http temporary mDNS sl_NetAppSet Nonpersistent service name Persistency SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 243 UDP socket; join IPv4 multicast sl_SetSockOpt Nonpersistent group UDP socket; leave IPv4 sl_SetSockOpt Nonpersistent multicast group RAW socket; remove IP sl_SetSockOpt Nonpersistent header from received data SWRU455A – February 2017 – Revised March 2017 Persistency Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 244 Enable or disable filter in a sl_WlanRxFilterSet Optionally Persistent filter list Remove filter from memory sl_WlanRxFilterSet Optionally Persistent Save the filters for persistent sl_WlanRxFilterSet Persistent Persistency SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 245 Persistent address Remove station from black list sl_WlanSet Persistent by mac address Remove station from black list sl_WlanSet Persistent by index SWRU455A – February 2017 – Revised March 2017 Persistency Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 246 Changes from Original (Februrary 2017) to A Revision ....................Page ......................• Updated Related Files table......................• Deleted "(SHA-1 is used)" Revision History SWRU455A – February 2017 – Revised March 2017 Submit Documentation Feedback Copyright © 2017, Texas Instruments Incorporated...
  • Page 247 IMPORTANT NOTICE FOR TI DESIGN INFORMATION AND RESOURCES Texas Instruments Incorporated (‘TI”) technical, application or other design advice, services or information, including, but not limited to, reference designs and materials relating to evaluation modules, (collectively, “TI Resources”) are intended to assist designers who are developing applications that incorporate TI products;...

This manual is also suitable for:

Simplelink wi-fi cc3220Simplelink cc3120Simplelink cc3220

Table of Contents