Staging:CC3220 Data Traffic

Overview
The Objective of this application is to showcase following capabilities of Simplelink:
 * 1) Wlan
 * 2) * Scanning APs
 * 3) * Connecting to an AP using either OPEN or WEP or WPA2 or WPS
 * 4) * Acquiring IPv4 and IPv6 ip using DHCP
 * 5) * Configuring static IPv4 and IPv6 ip
 * 6) * Disconnecting from AP
 * 7) Netapp
 * 8) * Ping to IPv4 host
 * 9) * Ping to Ipv6 host
 * 10) * Ping to external host (www. format)
 * 11) Socket
 * 12) * Creating IPv4/IPv6 TCP Client and sending/receiving data
 * 13) * Creating IPv4/IPv6 TCP Server and sending/receiving data
 * 14) * Creating IPv4/IPv6 UDP Client and sending/receiving data
 * 15) * Creating IPv4/IPv6 UDP Server and sending/receiving data
 * 16) * Creating non-blocking socket

There are 9 commands and divided in 5 groups:
 * 1) Wlan - scan, wlanconnect, wlandisconnect
 * 2) Netapp - ping
 * 3) Socket - send, recv
 * 4) Console - clear, exit
 * 5) Others - help

Source Files briefly explained

 * main.c - Initialize the device in default configuration and create 2 task mainTask and ThroughputTask.
 * cc_launchpad.c: - Contains mandatory board specific initialization. Also initializes the peripherals exercised.
 * data_traffic.c - Command prompt implementation.
 * data_traffic_common.c - Common function that used by all other files.
 * cmd_wlan.c - All wlan command implementation.
 * cmd_socket.c - All socket related command implementation
 * cmd_netapp.c - All netapp related command implementation
 * cmd_console.c - All console related command implementation
 * str.c	- Define all command, option and message strings
 * pinmux.c - Pinmux configuration
 * timer_if.c - Functions for timer control
 * uart_if.c - Functions to display information on UART
 * startup_*.c - IDE specific startup functions (not required when working with TI-RTOS)

Usage

 * 1) By default all 4 groups of command are enabled. To enable/disable a particular group of command using following macros in project properties:
 * 2) *ENABLE_CMD_WLAN 	- To enable Wlan command group
 * 3) *ENABLE_CMD_NETAPP 	- To enable Netapp command group
 * 4) *ENABLE_CMD_SOCKET 	- To enable Socket command group
 * 5) *ENABLE_CMD_CONSOLE 	- To enable Console command group
 * 6) Compile the code.
 * 7) Flash code using image creator tool.
 * 8) On bootup command prompt will appear, to know about command type 'help' and enter.

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]

Limitation: 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
None

Note

 * 1) Set receive new-line as AUTO or CR+LF in terminal for better view

= Links =