Staging:CC3220 NWP Filters woWLAN (Texas Instruments NDA restrictions applicable)

= Overview = This sample application demonstrates Wake and wireless feature and filters features of 'CC3220 SimpleLinkTM Wi-Fi Network Processor' device in both connected as well as promiscuous mode. The Rx-filters module lets the user define a set of rules that will determine which frames will be received or discarded. Filters can applied based on MAC, IP, frame type, frame subtype, BSSID and payload among other things. Every received frame will transverse through a series of decision tree (filter) that will determine how the frames are treated. Wake on wireless feature (WoWLAN) allows user to define a pattern in payload which can used to wake up the host MCU/processor. For more details on the feature refer to NWP programmers guide. 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
 * Display network configuration
 * wlandisconnect
 * Disconnect from AP


 * filters
 * createfilter
 * Create a filter based on MAC, IP, Frame type, BSSID and other parameters. Can be used to create a filter tree.
 * enablefilter
 * Enable all the configured filters
 * disablefilter
 * disable all the filters
 * deletefilter
 * delete all the filters


 * WoWLAN
 * enablewowlan
 * Enable the wake on WLAN using a payload pattern
 * disablewowlan
 * Disables wake on WLAN.


 * Socket
 * recv
 * Create a transceiver mode socket for receiving data
 * Create a IPv4/IPv6 TCP/UDP Server for receiving data


 * Console
 * clear
 * exit
 * Others
 * help

Source files briefly explained

 * main.c - Initializes the device in default configuration and creates task 'filtersTask'
 * pinmux.c - Pinmux configurations as required by the application.
 * cc_launchpad.c - Initializes peripherals.
 * filters_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_filters.c - Implementation for filter related command
 * cmd_wowlan.c - Implementation wake on wireless related command
 * cmd_console.c - Implementation to exercise all console related command
 * str.c - Defines all command option and message strings
 * timer_if.c - Functions to control timer.
 * uart_if.c - Functions to display information on UART.
 * startup_*.c - IDE specific startup functions (not required when working with TI-RTOS).

= Usage =

Prerequisite

 * 1x CC3220LP
 * 1x Access point
 * 2x Micro-USB cables
 * 1x Windows-PC/Smartphone running IPerf

General Guidelines
Note: Section:'Build and Execution Process' of Getting Started Guide has detailed build instructions
 * Connect a terminal-program running on Windows w/ the target - This is required for seeing the application logs. Terminal setup for detailed instructions for configuring the terminal-program
 * Open the application project. 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
 * DIABLE_CMD_WoWLAN 	- To disable Wake on WLAN command group
 * DISABLE_CMD_FILTERS 	- To disable Wake on NWP filters 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 the command name

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

Description: To scan for available APs. Maximum 30 APs can be listed.

Options: -n     Maximum number of APs to scan/search [Optional] -help  Display this help.

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">] Description: To connect to an AP.

Options: -help	: To display help for scan command [Optional] -i	: To display network configuration [Optional] -s	: SSID -t	: Type of security - OPEN, WPA, WPA2, WEP, WPS Default - OPEN [Optional] -p	: WPA, WPA2 and WEP - password in ASCII char WPS pin - Numeric pin in		 [Optional] Example: wlanconnect -s demoAP -t WPA2 -p "12345"

4. wlandisconnect Usage: wlandisconnect [-help]

Description: To disconnect from an AP.

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

Example: wlandisconnect 5. createfilter Usage: createfilter [-help] -f [-v ] [-e ] [-d ] [-i ] [-m ]

Description: Create a filter to filter out the packets

Options: -help  Display this help. -f     Filter type parameter.' "Filter Types" =[S_MAC, D_MAC, BSSID, S_IP, D_IP, FRAME_TYPE, FRAME_SUBTYPE]. -v     Comparison Value used by the Filter -e     Compare type. "Compare type" = [YES, NO]. -d     Drop Packets. "Drop Packets" = [YES, NO] -i     Parent filter for a leaf filter otherwise 0 -m     Mode for Filter. "Mode" = [CON, TRANS] for connected and transceiver mode. Example: createfilter -f S_MAC -v 38:21:A4:43:32:34 -e NO -d YES -i 0 -m TRANS

6. enablefilter Usage: enablefilter enablefilter [-help]

Description: Enable all the configured filters

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

Example: enablefilter 7. disablefilter Usage: disablefilter disablefilter [-help]

Description: Disable all the configured filters

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

Example: disablefilter 8. deletefilter Usage: deletefilter deletefilter [-help]

Description: Delete all the configured filters

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

Example: deletefilter 9. enablewowlan Usage: enablewowlan [-help] enablewowlan -v " " -u  -p  [-ch ] [-i ]

Description: To enable the Wake on WLAN

Options: -help  Display this help. -v     Pattern Value used by the Filter, should be character string, Length should less than 16 -u     WoWLAN filter Action ID, should be less than 255 -p     Paylod type pattern used, "Payload Type" = [L1, L4] L4 - Used in connected mode L1 - Used in Non connected mode -i     Pattern offset in payload default 0 -ch     Channel used for transceiver mode socket, 1-13 (Valid only with L1 option)

Example: enablewowlan -v "Pattern1234" -u 9 -p L4 -i 0 enablewowlan -v "Pattern1234" -u 9 -p L1 -ch 6 -i 0

Note:  Enabling L1 payload pattern WoW will open a transceiver mode socket, WoW need to be disabled if set for L1 pattern is used before using transceiver recv 10. disablewowlan Usage: disablewowlan disablewowlan [-help]

Description: To disable wake on WLAN

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

Example: disablewowlan

11. recv Usage: recv [-help] [-T -ch ] [-nb] [-n ] recv [-help] [-s [-V] [-u] [-p ]] [-nb] [-n ]

Description: Receive packets over network.

Options: -help	: To display help for scan command [Optional] -T      Receive packets in transceiver mode -s      Run in server mode. -u      Use UDP rather than TCP (Valid only with -s option) -p      Port number to send/receive data. Default 5001 (Valid only with -s option) -nb     Create non-blocking socket rather than blocking. -n      Number of packets to transmit. Default 1000 -V      Use IPv6 rather than IPv4 (Valid only with -s option) -ch     Channel used for transceiver mode socket, 1-13 (Valid only with -T option)

Example: recv -T -ch 6 -n 10000			[Transceiver mode recv] recv -s -p 5005 -nb			[TCP server with non blocking socket]

12. clear Usage: clear

Description: To clear console screen.

Example: clear 13. 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