如何让别的电脑无线控制CC3200实现通信
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
A CC3200 device has the capability to behave as a station in a typical networking system (Infrastructure setup). It can connect to access point (with or without security) and can use the internet services via the same access point, if available.
This application aims to exhibit the CC3200 device as a station in a simple network. Developers/users can refer the function or re-use them while writing new application. The application will be used without the UART terminal. The device connects to an AP (access point), with AP configurations stored in the form of macros in the application. If the connection is successful, it will try to get the IP address of “www.ti.com” and then ping to the ip address. Zero is the expected return value. A different return code would mean that the internet connection is not available or that the ping to the link is not successful.
Macros for Security
#define SSID_NAME "cc3200demo" #define SECURITY_TYPE SL_SEC_TYPE_OPEN #define SECURITY_KEY "" #define WEP_KEY_ID 1
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.
void WlanStationMode( void *pvParameters ) { ... //Start the SimpleLink lMode = sl_Start(0, 0, 0); ... // Connecting to WLAN AP // After this call we will be connected and have IP address */ WlanConnect(); ... // Checking the Lan connection by pinging to AP gateway lRetVal = CheckLanConnection(); ... // Turn on GREEN LED when device gets PING response from AP GPIO_IF_LedOn(MCU_EXECUTE_SUCCESS_IND); ... // Checking the internet connection by pinging to external host lRetVal = CheckInternetConnection(); ... // Turn on ORANGE LED when device gets PING response from AP GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO); ... }
Using the CC3200 as an STA is a simple three step process.
sl_Start() APIsl_WlanConnect() APIsl_NetCfgGet() API or check for SL_NETAPP_IPV4_IPACQUIRED_EVENT NetApp Event to get the IP address of the device.Refer to the main.c file of the reference application for more details