A first step in utilizing CC3000 in a Wi-Fi enabled application is to configure CC3000 to a user’s Wi-Fi network. This requires information on the AP, or SSID name, and the security passcode when WEP/WPA/WPA2 is enabled. Considering that embedded Wi-Fi applications will generally lack user interfaces such as keypads or touchscreens, this process can be complex without the use of advanced I/O.
To create a great user experience, TI has created SmartConfig? technology - a one-step and one-time process to connect a CC3000-enabled device to the home wireless network. This greatly stands apart from other Wi-Fi suppliers who require multiple steps to configure a device onto the network.
Smart Config leverages the standard mechanisms present in Wi-Fi to configure a CC3000‘s association information on the fly, regardless of whether user-interface is available. In this process a Wi-Fi enabled device such as a smartphone, tablet or a laptop is used to send the association information to the CC3000.
Addtionally, SmartConfig does not depend on the host microcontroller‘s I/O capabilities, thereby usable by deeply embedded applications. It can be used to associate multiple devices to the same AP simultaneously. The Configuration process is secured with AES-128 encryption, and the SSID and KEY length are supported up to 32 bytes. And furthermore, the device used to configure (smartphone, tablet, or PC) stays connected to the user’s home network during the configuration process (as opposed to other methods that require disconnection).
Refer to getting started with Smartconfig link, in order to see how to run the smartconfig aplicaiton on smartphones.
In order to perform the Smart Config procedure, CC3000 must initially enter the Smart config mode. This process can be triggered externally on the CC3000 device by pressing a button on the processor‘s board. For example, it will be S1 on the MSP430 Experimenter board. For more details on this, please refer to Using Smart Config section in the CC3000 First Time Getting Started Guide.
When the configuration process is triggered, the CC3000 device performs the following:
Important Note: During the smartconfig process, there is a momentary insecurity when working in "AES encryption disabled" mode, as the SSID and password are sent unencrypted during that time. This step is typically performed once in a product‘s lifetime. The advantage of working in "AES encryption disabled" mode is the ability to configure simultaneously multiple devices without the need to sync the key among all of them. It also gives a better user experience in some product deployments.
For security, users/customers should use the "AES encryption enabled" mode (assuming memory is not an issue). This requires customers to ship a unique AES key with each device shipped (e.g. printed on a sticker on the side of the device).
The APIs used to complete the Smart Config process are as follows:
nvmem_create_entry(NVMEM_AES128_KEY_FILEID, AES128_KEY_SIZE) – Create an entry at field ID 12 to store the AES key. (Only when AES encryption is enabled)
aes_write_key(key)- write the key to EEPROM - fileID 12. (Only when AES encryption is enabled)
wlan_smart_config_set_prefix(aucCC3000_prefix)– Set CC3000 prefix. Currently this API has to be called with the value ‘TTT’.
wlan_smart_config_start() – Send command to CC3000 to start the Smart config process.
wlan_smart_config_process(1) – Call this API with value 1 when AES encryption is enabled, otherwise 0. Brief process the acquired data and store it as a profile.
wlan_ioctl_set_connection_policy(DISABLE, DISABLE, ENABLE)– sets the connection policy, Set parameters to use Auto connect in order to connect to a stored profile.
NOTE: It is possible to configure multiple CC3000 devices to different APs serially, OR configure multiple CC3000 devices to the same AP simultaneously
The following section shows how to set the IOS application to configure CC3000 to connect to a specific AP. Before you begin, it is important to ensure that CC3000 is in Smart Config mode and the configuring device is connected to the same network that you want the CC3000 to connect to.
TI provides Smart Config example application for IOS, Android and PC devices.
This application is the configuring side in the process of connecting CC3000 device to a specific AP using the Smart Config feature.
In order to develop similar application for your product, please use the following wiki pages:
Smart Config Application development information - iOS
Smart Config Application development information - Android
Smart Config Application development information - PC
原文:http://www.cnblogs.com/34nl/p/3538292.html