2014-04-30 20:47:50 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* wlan.h - CC3000 Host Driver Implementation.
|
|
|
|
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
2014-05-10 21:28:40 +01:00
|
|
|
* documentation and/or other materials provided with the
|
2014-04-30 20:47:50 +01:00
|
|
|
* distribution.
|
|
|
|
*
|
|
|
|
* Neither the name of Texas Instruments Incorporated nor the names of
|
|
|
|
* its contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
2014-05-10 21:28:40 +01:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
2014-04-30 20:47:50 +01:00
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
2014-05-10 21:28:40 +01:00
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
2014-04-30 20:47:50 +01:00
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
2014-05-10 21:28:40 +01:00
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
2014-04-30 20:47:50 +01:00
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
#ifndef __WLAN_H__
|
|
|
|
#define __WLAN_H__
|
|
|
|
|
|
|
|
#include "cc3000_common.h"
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
// If building with a C++ compiler, make all of the definitions in this header
|
|
|
|
// have a C binding.
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define WLAN_SEC_UNSEC (0)
|
|
|
|
#define WLAN_SEC_WEP (1)
|
|
|
|
#define WLAN_SEC_WPA (2)
|
|
|
|
#define WLAN_SEC_WPA2 (3)
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! \addtogroup wlan_api
|
|
|
|
//! @{
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_init
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param sWlanCB Asynchronous events callback.
|
2014-04-30 20:47:50 +01:00
|
|
|
//! 0 no event call back.
|
|
|
|
//! -call back parameters:
|
|
|
|
//! 1) event_type: HCI_EVNT_WLAN_UNSOL_CONNECT connect event,
|
|
|
|
//! HCI_EVNT_WLAN_UNSOL_DISCONNECT disconnect event,
|
|
|
|
//! HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE config done,
|
2014-05-10 21:28:40 +01:00
|
|
|
//! HCI_EVNT_WLAN_UNSOL_DHCP dhcp report,
|
|
|
|
//! HCI_EVNT_WLAN_ASYNC_PING_REPORT ping report OR
|
2014-04-30 20:47:50 +01:00
|
|
|
//! HCI_EVNT_WLAN_KEEPALIVE keepalive.
|
|
|
|
//! 2) data: pointer to extra data that received by the event
|
|
|
|
//! (NULL no data).
|
|
|
|
//! 3) length: data length.
|
|
|
|
//! -Events with extra data:
|
2014-05-10 21:28:40 +01:00
|
|
|
//! HCI_EVNT_WLAN_UNSOL_DHCP: 4 bytes IP, 4 bytes Mask,
|
2014-04-30 20:47:50 +01:00
|
|
|
//! 4 bytes default gateway, 4 bytes DHCP server and 4 bytes
|
|
|
|
//! for DNS server.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! HCI_EVNT_WLAN_ASYNC_PING_REPORT: 4 bytes Packets sent,
|
|
|
|
//! 4 bytes Packets received, 4 bytes Min round time,
|
2014-04-30 20:47:50 +01:00
|
|
|
//! 4 bytes Max round time and 4 bytes for Avg round time.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param sFWPatches 0 no patch or pointer to FW patches
|
2014-04-30 20:47:50 +01:00
|
|
|
//! @param sDriverPatches 0 no patch or pointer to driver patches
|
|
|
|
//! @param sBootLoaderPatches 0 no patch or pointer to bootloader patches
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param sReadWlanInterruptPin init callback. the callback read wlan
|
2014-04-30 20:47:50 +01:00
|
|
|
//! interrupt status.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param sWlanInterruptEnable init callback. the callback enable wlan
|
2014-04-30 20:47:50 +01:00
|
|
|
//! interrupt.
|
|
|
|
//! @param sWlanInterruptDisable init callback. the callback disable wlan
|
|
|
|
//! interrupt.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param sWriteWlanPin init callback. the callback write value
|
|
|
|
//! to device pin.
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @return none
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @sa wlan_set_event_mask , wlan_start , wlan_stop
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @brief Initialize wlan driver
|
|
|
|
//!
|
|
|
|
//! @warning This function must be called before ANY other wlan driver function
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern void wlan_init( tWlanCB sWlanCB,
|
|
|
|
tFWPatches sFWPatches,
|
|
|
|
tDriverPatches sDriverPatches,
|
|
|
|
tBootLoaderPatches sBootLoaderPatches,
|
|
|
|
tWlanReadInteruptPin sReadWlanInterruptPin,
|
|
|
|
tWlanInterruptEnable sWlanInterruptEnable,
|
|
|
|
tWlanInterruptDisable sWlanInterruptDisable,
|
|
|
|
tWriteWlanPin sWriteWlanPin);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_start
|
|
|
|
//!
|
|
|
|
//! @param usPatchesAvailableAtHost - flag to indicate if patches available
|
2014-05-10 21:28:40 +01:00
|
|
|
//! from host or from EEPROM. Due to the
|
2014-04-30 20:47:50 +01:00
|
|
|
//! fact the patches are burn to the EEPROM
|
2014-05-10 21:28:40 +01:00
|
|
|
//! using the patch programmer utility, the
|
2014-04-30 20:47:50 +01:00
|
|
|
//! patches will be available from the EEPROM
|
|
|
|
//! and not from the host.
|
|
|
|
//!
|
|
|
|
//! @return none
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief Start WLAN device. This function asserts the enable pin of
|
2014-04-30 20:47:50 +01:00
|
|
|
//! the device (WLAN_EN), starting the HW initialization process.
|
|
|
|
//! The function blocked until device Initialization is completed.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! Function also configure patches (FW, driver or bootloader)
|
2014-04-30 20:47:50 +01:00
|
|
|
//! and calls appropriate device callbacks.
|
|
|
|
//!
|
|
|
|
//! @Note Prior calling the function wlan_init shall be called.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @Warning This function must be called after wlan_init and before any
|
2014-04-30 20:47:50 +01:00
|
|
|
//! other wlan API
|
|
|
|
//! @sa wlan_init , wlan_stop
|
|
|
|
//!
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern void wlan_start(unsigned short usPatchesAvailableAtHost);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_stop
|
|
|
|
//!
|
|
|
|
//! @param none
|
|
|
|
//!
|
|
|
|
//! @return none
|
|
|
|
//!
|
|
|
|
//! @brief Stop WLAN device by putting it into reset state.
|
|
|
|
//!
|
|
|
|
//! @sa wlan_start
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern void wlan_stop(void);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_connect
|
|
|
|
//!
|
|
|
|
//! @param sec_type security options:
|
2014-05-10 21:28:40 +01:00
|
|
|
//! WLAN_SEC_UNSEC,
|
2014-04-30 20:47:50 +01:00
|
|
|
//! WLAN_SEC_WEP (ASCII support only),
|
|
|
|
//! WLAN_SEC_WPA or WLAN_SEC_WPA2
|
|
|
|
//! @param ssid up to 32 bytes and is ASCII SSID of the AP
|
|
|
|
//! @param ssid_len length of the SSID
|
|
|
|
//! @param bssid 6 bytes specified the AP bssid
|
2014-05-11 12:09:13 +01:00
|
|
|
//! @param key up to 32 bytes specified the AP security key
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param key_len key length
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, negative is returned.
|
2014-04-30 20:47:50 +01:00
|
|
|
//! Note that even though a zero is returned on success to trigger
|
|
|
|
//! connection operation, it does not mean that CCC3000 is already
|
2014-05-10 21:28:40 +01:00
|
|
|
//! connected. An asynchronous "Connected" event is generated when
|
2014-04-30 20:47:50 +01:00
|
|
|
//! actual association process finishes and CC3000 is connected to
|
2014-05-10 21:28:40 +01:00
|
|
|
//! the AP. If DHCP is set, An asynchronous "DHCP" event is
|
2014-04-30 20:47:50 +01:00
|
|
|
//! generated when DHCP process is finish.
|
2014-05-10 21:28:40 +01:00
|
|
|
//!
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @brief Connect to AP
|
|
|
|
//! @warning Please Note that when connection to AP configured with security
|
|
|
|
//! type WEP, please confirm that the key is set as ASCII and not
|
|
|
|
//! as HEX.
|
|
|
|
//! @sa wlan_disconnect
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
#ifndef CC3000_TINY_DRIVER
|
|
|
|
extern long wlan_connect(unsigned long ulSecType, const char *ssid, long ssid_len,
|
|
|
|
unsigned char *bssid, unsigned char *key, long key_len);
|
|
|
|
#else
|
|
|
|
extern long wlan_connect(const char *ssid, long ssid_len);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_disconnect
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return 0 disconnected done, other CC3000 already disconnected
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief Disconnect connection from AP.
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @sa wlan_connect
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
extern long wlan_disconnect(void);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_add_profile
|
|
|
|
//!
|
|
|
|
//! @param ulSecType WLAN_SEC_UNSEC,WLAN_SEC_WEP,WLAN_SEC_WPA,WLAN_SEC_WPA2
|
|
|
|
//! @param ucSsid ssid SSID up to 32 bytes
|
|
|
|
//! @param ulSsidLen ssid length
|
|
|
|
//! @param ucBssid bssid 6 bytes
|
|
|
|
//! @param ulPriority ulPriority profile priority. Lowest priority:0.
|
|
|
|
//! @param ulPairwiseCipher_Or_TxKeyLen key length for WEP security
|
|
|
|
//! @param ulGroupCipher_TxKeyIndex key index
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param ulKeyMgmt KEY management
|
2014-04-30 20:47:50 +01:00
|
|
|
//! @param ucPf_OrKey security key
|
|
|
|
//! @param ulPassPhraseLen security key length for WPA\WPA2
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @brief When auto start is enabled, the device connects to
|
2014-05-10 21:28:40 +01:00
|
|
|
//! station from the profiles table. Up to 7 profiles are supported.
|
|
|
|
//! If several profiles configured the device choose the highest
|
|
|
|
//! priority profile, within each priority group, device will choose
|
|
|
|
//! profile based on security policy, signal strength, etc
|
2014-04-30 20:47:50 +01:00
|
|
|
//! parameters. All the profiles are stored in CC3000 NVMEM.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @sa wlan_ioctl_del_profile
|
2014-04-30 20:47:50 +01:00
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
extern long wlan_add_profile(unsigned long ulSecType, unsigned char* ucSsid,
|
2014-05-10 21:28:40 +01:00
|
|
|
unsigned long ulSsidLen,
|
2014-04-30 20:47:50 +01:00
|
|
|
unsigned char *ucBssid,
|
|
|
|
unsigned long ulPriority,
|
|
|
|
unsigned long ulPairwiseCipher_Or_Key,
|
|
|
|
unsigned long ulGroupCipher_TxKeyLen,
|
|
|
|
unsigned long ulKeyMgmt,
|
|
|
|
unsigned char* ucPf_OrKey,
|
|
|
|
unsigned long ulPassPhraseLen);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_ioctl_del_profile
|
|
|
|
//!
|
|
|
|
//! @param index number of profile to delete
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief Delete WLAN profile
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @Note In order to delete all stored profile, set index to 255.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @sa wlan_add_profile
|
2014-04-30 20:47:50 +01:00
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern long wlan_ioctl_del_profile(unsigned long ulIndex);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_set_event_mask
|
|
|
|
//!
|
|
|
|
//! @param mask mask option:
|
|
|
|
//! HCI_EVNT_WLAN_UNSOL_CONNECT connect event
|
|
|
|
//! HCI_EVNT_WLAN_UNSOL_DISCONNECT disconnect event
|
|
|
|
//! HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE smart config done
|
|
|
|
//! HCI_EVNT_WLAN_UNSOL_INIT init done
|
|
|
|
//! HCI_EVNT_WLAN_UNSOL_DHCP dhcp event report
|
|
|
|
//! HCI_EVNT_WLAN_ASYNC_PING_REPORT ping report
|
|
|
|
//! HCI_EVNT_WLAN_KEEPALIVE keepalive
|
|
|
|
//! HCI_EVNT_WLAN_TX_COMPLETE - disable information on end of transmission
|
|
|
|
//! Saved: no.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief Mask event according to bit mask. In case that event is
|
|
|
|
//! masked (1), the device will not send the masked event to host.
|
2014-04-30 20:47:50 +01:00
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern long wlan_set_event_mask(unsigned long ulMask);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_ioctl_statusget
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param none
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return WLAN_STATUS_DISCONNECTED, WLAN_STATUS_SCANING,
|
|
|
|
//! STATUS_CONNECTING or WLAN_STATUS_CONNECTED
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @brief get wlan status: disconnected, scanning, connecting or connected
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern long wlan_ioctl_statusget(void);
|
|
|
|
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_ioctl_set_connection_policy
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param should_connect_to_open_ap enable(1), disable(0) connect to any
|
|
|
|
//! available AP. This parameter corresponds to the configuration of
|
2014-04-30 20:47:50 +01:00
|
|
|
//! item # 3 in the brief description.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param should_use_fast_connect enable(1), disable(0). if enabled, tries
|
|
|
|
//! to connect to the last connected AP. This parameter corresponds
|
2014-04-30 20:47:50 +01:00
|
|
|
//! to the configuration of item # 1 in the brief description.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param auto_start enable(1), disable(0) auto connect
|
|
|
|
//! after reset and periodically reconnect if needed. This
|
2014-04-30 20:47:50 +01:00
|
|
|
//! configuration configures option 2 in the above description.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief When auto is enabled, the device tries to connect according
|
2014-04-30 20:47:50 +01:00
|
|
|
//! the following policy:
|
2014-05-10 21:28:40 +01:00
|
|
|
//! 1) If fast connect is enabled and last connection is valid,
|
|
|
|
//! the device will try to connect to it without the scanning
|
2014-04-30 20:47:50 +01:00
|
|
|
//! procedure (fast). The last connection will be marked as
|
2014-05-10 21:28:40 +01:00
|
|
|
//! invalid, due to adding/removing profile.
|
|
|
|
//! 2) If profile exists, the device will try to connect it
|
2014-04-30 20:47:50 +01:00
|
|
|
//! (Up to seven profiles).
|
|
|
|
//! 3) If fast and profiles are not found, and open mode is
|
|
|
|
//! enabled, the device will try to connect to any AP.
|
|
|
|
//! * Note that the policy settings are stored in the CC3000 NVMEM.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @sa wlan_add_profile , wlan_ioctl_del_profile
|
2014-04-30 20:47:50 +01:00
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern long wlan_ioctl_set_connection_policy(
|
|
|
|
unsigned long should_connect_to_open_ap,
|
|
|
|
unsigned long should_use_fast_connect,
|
|
|
|
unsigned long ulUseProfiles);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_ioctl_get_scan_results
|
|
|
|
//!
|
|
|
|
//! @param[in] scan_timeout parameter not supported
|
|
|
|
//! @param[out] ucResults scan result (_wlan_full_scan_results_args_t)
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @brief Gets entry from scan result table.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! The scan results are returned one by one, and each entry
|
|
|
|
//! represents a single AP found in the area. The following is a
|
|
|
|
//! format of the scan result:
|
2014-04-30 20:47:50 +01:00
|
|
|
//! - 4 Bytes: number of networks found
|
|
|
|
//! - 4 Bytes: The status of the scan: 0 - aged results,
|
|
|
|
//! 1 - results valid, 2 - no results
|
|
|
|
//! - 42 bytes: Result entry, where the bytes are arranged as follows:
|
2014-05-10 21:28:40 +01:00
|
|
|
//!
|
2014-04-30 20:47:50 +01:00
|
|
|
//! - 1 bit isValid - is result valid or not
|
2014-05-10 21:28:40 +01:00
|
|
|
//! - 7 bits rssi - RSSI value;
|
2014-04-30 20:47:50 +01:00
|
|
|
//! - 2 bits: securityMode - security mode of the AP:
|
|
|
|
//! 0 - Open, 1 - WEP, 2 WPA, 3 WPA2
|
|
|
|
//! - 6 bits: SSID name length
|
2014-05-10 21:28:40 +01:00
|
|
|
//! - 2 bytes: the time at which the entry has entered into
|
2014-04-30 20:47:50 +01:00
|
|
|
//! scans result table
|
|
|
|
//! - 32 bytes: SSID name
|
2014-05-10 21:28:40 +01:00
|
|
|
//! - 6 bytes: BSSID
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @Note scan_timeout, is not supported on this version.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @sa wlan_ioctl_set_scan_params
|
2014-04-30 20:47:50 +01:00
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
extern long wlan_ioctl_get_scan_results(unsigned long ulScanTimeout,
|
|
|
|
unsigned char *ucResults);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_ioctl_set_scan_params
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param uiEnable - start/stop application scan:
|
|
|
|
//! 1 = start scan with default interval value of 10 min.
|
|
|
|
//! in order to set a different scan interval value apply the value
|
2014-04-30 20:47:50 +01:00
|
|
|
//! in milliseconds. minimum 1 second. 0=stop). Wlan reset
|
|
|
|
//! (wlan_stop() wlan_start()) is needed when changing scan interval
|
|
|
|
//! value. Saved: No
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param uiMinDwellTime minimum dwell time value to be used for each
|
2014-04-30 20:47:50 +01:00
|
|
|
//! channel, in milliseconds. Saved: yes
|
|
|
|
//! Recommended Value: 100 (Default: 20)
|
|
|
|
//! @param uiMaxDwellTime maximum dwell time value to be used for each
|
|
|
|
//! channel, in milliseconds. Saved: yes
|
|
|
|
//! Recommended Value: 100 (Default: 30)
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param uiNumOfProbeRequests max probe request between dwell time.
|
2014-04-30 20:47:50 +01:00
|
|
|
//! Saved: yes. Recommended Value: 5 (Default:2)
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param uiChannelMask bitwise, up to 13 channels (0x1fff).
|
2014-04-30 20:47:50 +01:00
|
|
|
//! Saved: yes. Default: 0x7ff
|
|
|
|
//! @param uiRSSIThreshold RSSI threshold. Saved: yes (Default: -80)
|
|
|
|
//! @param uiSNRThreshold NSR threshold. Saved: yes (Default: 0)
|
|
|
|
//! @param uiDefaultTxPower probe Tx power. Saved: yes (Default: 205)
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param aiIntervalList pointer to array with 16 entries (16 channels)
|
|
|
|
//! each entry (unsigned long) holds timeout between periodic scan
|
2014-04-30 20:47:50 +01:00
|
|
|
//! (connection scan) - in milliseconds. Saved: yes. Default 2000ms.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief start and stop scan procedure. Set scan parameters.
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @Note uiDefaultTxPower, is not supported on this version.
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @sa wlan_ioctl_get_scan_results
|
2014-04-30 20:47:50 +01:00
|
|
|
//
|
|
|
|
//*****************************************************************************
|
2014-05-10 21:28:40 +01:00
|
|
|
extern long wlan_ioctl_set_scan_params(unsigned long uiEnable, unsigned long
|
2014-04-30 20:47:50 +01:00
|
|
|
uiMinDwellTime,unsigned long uiMaxDwellTime,
|
|
|
|
unsigned long uiNumOfProbeRequests,
|
|
|
|
unsigned long uiChannelMask,
|
|
|
|
long iRSSIThreshold,unsigned long uiSNRThreshold,
|
2014-05-10 21:28:40 +01:00
|
|
|
unsigned long uiDefaultTxPower,
|
2014-04-30 20:47:50 +01:00
|
|
|
unsigned long *aiIntervalList);
|
|
|
|
|
2014-05-10 21:28:40 +01:00
|
|
|
|
2014-04-30 20:47:50 +01:00
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_smart_config_start
|
|
|
|
//!
|
|
|
|
//! @param algoEncryptedFlag indicates whether the information is encrypted
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief Start to acquire device profile. The device acquire its own
|
2014-04-30 20:47:50 +01:00
|
|
|
//! profile, if profile message is found. The acquired AP information
|
|
|
|
//! is stored in CC3000 EEPROM only in case AES128 encryption is used.
|
2014-05-10 21:28:40 +01:00
|
|
|
//! In case AES128 encryption is not used, a profile is created by
|
2014-04-30 20:47:50 +01:00
|
|
|
//! CC3000 internally.
|
|
|
|
//!
|
|
|
|
//! @Note An asynchronous event - Smart Config Done will be generated as soon
|
|
|
|
//! as the process finishes successfully.
|
|
|
|
//!
|
|
|
|
//! @sa wlan_smart_config_set_prefix , wlan_smart_config_stop
|
|
|
|
//
|
2014-05-10 21:28:40 +01:00
|
|
|
//*****************************************************************************
|
2014-04-30 20:47:50 +01:00
|
|
|
extern long wlan_smart_config_start(unsigned long algoEncryptedFlag);
|
|
|
|
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_smart_config_stop
|
|
|
|
//!
|
|
|
|
//! @param algoEncryptedFlag indicates whether the information is encrypted
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief Stop the acquire profile procedure
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
|
|
|
//! @sa wlan_smart_config_start , wlan_smart_config_set_prefix
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern long wlan_smart_config_stop(void);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_smart_config_set_prefix
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param newPrefix 3 bytes identify the SSID prefix for the Smart Config.
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief Configure station ssid prefix. The prefix is used internally
|
2014-04-30 20:47:50 +01:00
|
|
|
//! in CC3000. It should always be TTT.
|
|
|
|
//!
|
|
|
|
//! @Note The prefix is stored in CC3000 NVMEM
|
|
|
|
//!
|
|
|
|
//! @sa wlan_smart_config_start , wlan_smart_config_stop
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern long wlan_smart_config_set_prefix(char* cNewPrefix);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
//! wlan_smart_config_process
|
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @param none
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @return On success, zero is returned. On error, -1 is returned
|
2014-04-30 20:47:50 +01:00
|
|
|
//!
|
2014-05-10 21:28:40 +01:00
|
|
|
//! @brief process the acquired data and store it as a profile. The acquired
|
2014-04-30 20:47:50 +01:00
|
|
|
//! AP information is stored in CC3000 EEPROM encrypted.
|
|
|
|
//! The encrypted data is decrypted and stored as a profile.
|
|
|
|
//! behavior is as defined by connection policy.
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
extern long wlan_smart_config_process(void);
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
// Close the Doxygen group.
|
|
|
|
//! @}
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
//
|
|
|
|
// Mark the end of the C bindings section for C++ compilers.
|
|
|
|
//
|
|
|
|
//*****************************************************************************
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif // __cplusplus
|
|
|
|
|
|
|
|
#endif // __WLAN_H__
|