Staging:CC3120 Data Traffic

= Overview = This sample application demonstrates certain capabilities/features of 'CC3120 SimpleLinkTM Wi-Fi Network Processor' device and can also be used to measure the UDP/TCP throughput. For maximum supported throughput refer to SDK release note @. Details of the features that are exercised in this application are listed in subsequent sections.

Application Details
This application is command line based and supports 9 commands which are divided in 5 groups as below:
 * Wlan
 * scan
 * Scan for available AP.
 * wlanconnect
 * Connect to an AP using either OPEN, WEP, WPA2 or WPS security
 * Configure static IP or acquiring IPv4 and IPv6 IP address using DHCP
 * Display network configuration
 * wlandisconnect
 * Disconnect from AP


 * Netapp
 * ping
 * Ping an IPv4/IPV6 host
 * Ping an external host


 * Socket
 * send
 * Create a IPv4/IPv6 TCP/UDP client for sending data
 * Create a IPv4/IPv6 TCP/UDP Server for sending data
 * recv
 * Create a IPv4/IPv6 TCP/UDP client for receiving data
 * Create a IPv4/IPv6 TCP/UDP Server for receiving data
 * Console
 * clear
 * exit
 * Others
 * help

Source files briefly explained
= Usage =
 * main.c - Initializes the device in default configuration and creates two task 'mainTask' and 'ThroughputTask'
 * data_traffic_common.c - Common functions used by different groups.
 * cmd_wlan.c - Implementation to exercise all Wlan commands
 * cmd_socket.c - Implementation to exercise all socket related command
 * cmd_netapp.c - Implementation to exercise all netapp related command
 * cmd_console.c - Implementation to exercise all console related command
 * str.c	- Defines all command option and message strings

Prerequisite
Note: This application is supported on other platforms as well - Check the release notes for the list of supported platforms
 * 1x CC3120BOOST
 * 1x MSP432P401R
 * 1x Access point
 * 2x Micro-USB cables
 * 1x Windows-PC/Smartphone running IPerf

General Guidelines
Note: Section:'Build and Execution Process' of 'CC3120 Programmers' Guide' has detailed build instructions
 * Mount CC3120BOOST on a compatible MCU LaunchPad from TI, and connect the board to a Windows-PC - Refer 'CC3120 Getting Started Guide' for detailed instructions
 * Connect a terminal-program running on Windows w/ the target - This is required for seeing the application logs. 'CC3120 Getting Started Guide' for detailed instructions for configuring the terminal-program
 * Open the application project @ '\platform\msp432p401r' in CCS. By default all 4 groups of commands are enabled - To disable, define below macros in the project's properties:
 * DISABLE_CMD_WLAN 	- To disable Wlan command group
 * DISABLE_CMD_NETAPP 	- To disable Netapp command group
 * DISABLE_CMD_SOCKET 	- To disable Socket command group
 * DISABLE_CMD_CONSOLE 	- To disable Console command group
 * Build and run the project
 * A prompt will appear on the terminal where commands can be entered as described below:

Commands
1. help usage: help

Description: To know more about &lt;command name&gt;

Example: help scan 2. scan Usage: scan [-help] [-n ]

Description: To scan available APs.

Options: -help	: To display help for scan command [Optional] -n	: Maximum number of available AP to scan [Optional]

Limitaion: Show at max 30 APs.

Example: scan -n 5 3. wlanconnect Usage: wlanconnect [-help] [-i] wlanconnect -s <"ssid name"> [-t <"security type">] [-p <"password">] [-ip [-gw -dns ]] [-ip6 [-dns6 ]]

Description: Connect to an AP.

Options: -help	: To display help for scan command [Optional] -i	: To display network configuration [Optional] -s	: SSID -t	: Security Type - OPEN, WPA, WPA2, WEP, WPS Default - OPEN [Optional] -p	: WPA, WPA2 and WEP - password in ASCII char WPS pin - Numeric pin in		 [Optional] -ip	: Static IPv4 ip in "." format [Optional] -gw	: Static IPv4 gateway ip in "." format [Optional] -dns	: Static IPv4 DNS ip in "." format [Optional] -ip6	: Static IPv6 ip in ":" or zero compress format [Optional] -dns6	: Static IPv6 DNS ip in ":" or zero compress format [Optional]

Example: wlanconnect -s demoAP -t WPA2 -p "12345" wlanconnect -s demoAP -t OPEN -ip 192.168.1.150 -ip6 fe80::1234:5678:9abc 4. wlandisconnect Usage: wlandisconnect [-help]

Description: To disconnecte from an AP.

Options: -help	: To display help for scan command [Optional]

Example: wlandisconnect 5. ping Usage: ping [-help] -h  [-c ] [-s ] [-i ] [-t ]

Description: To ping mentioned host

Options: -help	: To display help for scan command [Optional] -h	: Host name in "www." format IP - IPv4 in "." format IP - IPv6 ":" or zero compress format -c	: Number of ECHO_REQUEST to send [Optional] Default - 10 packets -s	: Number of data bytes in a packet [Optional] Default - 56 Bytes -i	: Ping interval [Optional] Default - 1 second -t	: Timeout for each ping request [Optional] Default - 3 seconds Example: ping -h www.ti.com ping -h fe80:0000:0000:0000:1234:5678:91bc:def0 -i 2 -t 5 6. send Usage: send [-help] -c [-u] [-p ] [-nb] [-n ] [-i ] -s [-V] [-u] [-p ] [-nb] [-n ] [-i ]

Description: Send packets over network.

Options: -help	: To display help for scan command [Optional] -c	: Run in client mode and connect to mentioned server. Note - IP should be in "." format for IPv4 socket and ":" or zero compress format for IPv6 -s	: Run in server mode -u	: Use UDP rather than TCP [Optional] -p	: Port number [Optional] Default - 5001 -nb	: Create non-blocking socket rather than blocking [Optional] -n	: Number of packets to transmit [Optional] Default - 1000 (1 packet = 1400 bytes) -V	: Use IPv6 rather than IPv4 [Optional] -i	: Throughput display interval in seconds [Optional] Default - 1 second

Example: send -s -V -n 10000			[IPv6 TCP server] send -c fe80::1234:5678:91bc:def0 -u	[UDP IPv6 client] send -s -p 5005 -i 2			[TCP IPv4 server with 2 second throughput display interval] send -c 192.168.0.110			[TCP IPv4 client] Note: In UDP server mode to send packets to client, client needs to send some packets to server to connect 7. recv Usage: recv[-help] -c [-u] [-p ] [-nb] [-n ] [-i ] -s [-V] [-u] [-p ] [-nb] [-n ] [-i ]

Description: Receive packets over network.

Options: -help	: To display help for scan command [Optional] -c	: Run in client mode and connect to mentioned server. Note - IP should be in "." format for IPv4 socket and ":" or zero compress format for IPv6 -s	: Run in server mode -u	: Use UDP rather than TCP [Optional] -p	: Port number [Optional] Default - 5001 -nb	: Create non-blocking socket rather than blocking [Optional] -n	: Number of packets to transmit [Optional] Default - 1000 (1 packet = 1400 bytes) -V	: Use IPv6 rather than IPv4 [Optional] -i	: Throughput display interval in seconds [Optional] Default - 1 second Example: recv -s -V -n 10000			[IPv6 TCP server] recv -c fe80::1234:5678:91bc:def0 -u	[UDP IPv6 client] recv -s -p 5005 -i 2			[TCP IPv4 server with 2 second throughput display interval] recv -c 192.168.0.110			[TCP IPv4 client] 8. clear Usage: clear

Description: To clear console screen.

Example: clear 9. exit Usage: exit

Description: To exit from command prompt.

Example: exit

= Limitations/Known Issues = = Note = = Links =
 * None
 * Set receive new-line as AUTO or CR+LF in terminal