NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
CC3200 Getting Started with WLAN AP
Contents
Overview[edit]
The SimpleLink CC3200 device can act as an AP (access point). Any Wifi Enabled Client in its range can connect to the device and then communicate as per standard networking protocols.
Application details[edit]
This application aims to exhibit the CC3200 device as AP. Developers/users can refer the function or re-use them while writing new application.
The device comes up as an AP (access point), and then wait for a station to connect to it. If the connection is successful, it will ping to that station. Zero is the expected return value. A different return code would mean that the ping to the station is unsuccessful.
This example can be used either on TI-RTOS or FreeRTOS.
For the application to work with TI-RTOS, ti_rtos project and ti_rtos_config project need to be imported into the application workspace. These projects can be found in CC3200-SDK under ti_rtos folder. Please follow this link for CC3200 TI-RTOS usage CC3200 TI-RTOS
Source Files briefly explained[edit]
- main.c – main file creates the simplelink task which does most of the network related operations, a WlanAPMode task makes calls to the network related APIs of simplelink library.
- startup_ewarm.c – IAR workbench specific vector table implementation for interrupts.
Code flow[edit]
<syntaxhighlight lang='c'> void WlanAPMode( void *pvParameters ) { ... lRetVal = sl_Start(NULL,NULL,NULL); ... // Configure the networking mode and ssid name(for AP mode) if(lRetVal != ROLE_AP) {
if(ConfigureMode(lRetVal) != ROLE_AP) { UART_PRINT("Unable to set AP mode, exiting Application...\n\r"); sl_Stop(SL_STOP_TIMEOUT); LOOP_FOREVER(); }
} while(!IS_IP_ACQUIRED(g_ulStatus)) {
//looping till ip is acquired
} ... lRetVal = sl_NetCfgGet(SL_IPV4_STA_P2P_CL_GET_INFO,&ucDHCP,&len,(unsigned char *)&ipV4); ... while(!IS_IP_LEASED(g_ulStatus)) {
//wating for the client to connect
}
ulIpAddr = g_ulStaIp; iTestResult = PingTest(ulIpAddr); ... } </syntaxhighlight>
Using the CC3200 as an AP is a simple two step process.
- Start the SimpleLink by calling
sl_Start()
API. - Wait until the device gets an ip address.
After the device has come up in AP mode, we will follow two more steps to make sure the device can act as an AP.
- wait for a station to connect to the device (you have to connect a machine to the device).
- ping to the machine (station).
Refer to the main.c file of the reference application for more details.
Note 1: In case, if the device is not able to ping to the connected machine, try disabling the antivirus on your machine.
Usage[edit]
- Run this application (getting_started_with_wlan_ap) application from IAR/CCS or Flash to the device.
- Application with switch to AP mode if it's not in AP mode.
- After client connected to device, device(AP) will ping to client and print the result over UART.
- All result can be viewed on Terminal screen.
- Observe the execution flow to understand the working.
Limitations/Known Issues[edit]
None.
Links[edit]
{{#invoke: Navbox | navbox }} {{#invoke: Navbox | navbox }}