CC3000  1.12
 All Classes Functions Groups
wlan.h
1 /*****************************************************************************
2 *
3 * wlan.h - CC3000 Host Driver Implementation.
4 * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 *****************************************************************************/
35 #ifndef __WLAN_H__
36 #define __WLAN_H__
37 
38 #include "cc3000_common.h"
39 
40 //*****************************************************************************
41 //
42 // If building with a C++ compiler, make all of the definitions in this header
43 // have a C binding.
44 //
45 //*****************************************************************************
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #define WLAN_SEC_UNSEC (0)
51 #define WLAN_SEC_WEP (1)
52 #define WLAN_SEC_WPA (2)
53 #define WLAN_SEC_WPA2 (3)
54 //*****************************************************************************
55 //
58 //
59 //*****************************************************************************
60 
61 
62 //*****************************************************************************
63 //
105 //
106 //*****************************************************************************
107 extern void wlan_init( tWlanCB sWlanCB,
108  tFWPatches sFWPatches,
109  tDriverPatches sDriverPatches,
110  tBootLoaderPatches sBootLoaderPatches,
111  tWlanReadInteruptPin sReadWlanInterruptPin,
112  tWlanInterruptEnable sWlanInterruptEnable,
113  tWlanInterruptDisable sWlanInterruptDisable,
114  tWriteWlanPin sWriteWlanPin);
115 
116 
117 
118 //*****************************************************************************
119 //
142 //
143 //*****************************************************************************
144 extern void wlan_start(UINT16 usPatchesAvailableAtHost);
145 
146 //*****************************************************************************
147 //
157 //
158 //*****************************************************************************
159 extern void wlan_stop(void);
160 
161 //*****************************************************************************
162 //
189 //
190 //*****************************************************************************
191 #ifndef CC3000_TINY_DRIVER
192 extern INT32 wlan_connect(UINT32 ulSecType, CHAR *ssid, INT32 ssid_len,
193  UINT8 *bssid, UINT8 *key, INT32 key_len);
194 #else
195 extern INT32 wlan_connect(CHAR *ssid, INT32 ssid_len);
196 
197 #endif
198 
199 //*****************************************************************************
200 //
208 //
209 //*****************************************************************************
210 
211 extern INT32 wlan_disconnect(void);
212 
213 //*****************************************************************************
214 //
239 //
240 //*****************************************************************************
241 
242 extern INT32 wlan_add_profile(UINT32 ulSecType, UINT8* ucSsid,
243  UINT32 ulSsidLen,
244  UINT8 *ucBssid,
245  UINT32 ulPriority,
246  UINT32 ulPairwiseCipher_Or_Key,
247  UINT32 ulGroupCipher_TxKeyLen,
248  UINT32 ulKeyMgmt,
249  UINT8* ucPf_OrKey,
250  UINT32 ulPassPhraseLen);
251 
252 
253 
254 //*****************************************************************************
255 //
267 //
268 //*****************************************************************************
269 extern INT32 wlan_ioctl_del_profile(UINT32 ulIndex);
270 
271 //*****************************************************************************
272 //
290 //
291 //*****************************************************************************
292 extern INT32 wlan_set_event_mask(UINT32 ulMask);
293 
294 //*****************************************************************************
295 //
304 //
305 //*****************************************************************************
306 extern INT32 wlan_ioctl_statusget(void);
307 
308 
309 //*****************************************************************************
310 //
338 //
339 //*****************************************************************************
341  UINT32 should_connect_to_open_ap,
342  UINT32 should_use_fast_connect,
343  UINT32 ulUseProfiles);
344 
345 //*****************************************************************************
346 //
376 //
377 //*****************************************************************************
378 
379 
380 extern INT32 wlan_ioctl_get_scan_results(UINT32 ulScanTimeout,
381  UINT8 *ucResults);
382 
383 //*****************************************************************************
384 //
417 //
418 //*****************************************************************************
419 extern INT32 wlan_ioctl_set_scan_params(UINT32 uiEnable, UINT32
420  uiMinDwellTime,UINT32 uiMaxDwellTime,
421  UINT32 uiNumOfProbeRequests,
422  UINT32 uiChannelMask,
423  INT32 iRSSIThreshold,UINT32 uiSNRThreshold,
424  UINT32 uiDefaultTxPower,
425  UINT32 *aiIntervalList);
426 
427 
428 //*****************************************************************************
429 //
446 //
447 //*****************************************************************************
448 extern INT32 wlan_smart_config_start(UINT32 algoEncryptedFlag);
449 
450 
451 //*****************************************************************************
452 //
462 //
463 //*****************************************************************************
464 extern INT32 wlan_smart_config_stop(void);
465 
466 //*****************************************************************************
467 //
480 //
481 //*****************************************************************************
482 extern INT32 wlan_smart_config_set_prefix(CHAR* cNewPrefix);
483 
484 //*****************************************************************************
485 //
496 //
497 //*****************************************************************************
498 extern INT32 wlan_smart_config_process(void);
499 
500 //*****************************************************************************
501 //
502 // Close the Doxygen group.
504 //
505 //*****************************************************************************
506 
507 
508 
509 //*****************************************************************************
510 //
511 // Mark the end of the C bindings section for C++ compilers.
512 //
513 //*****************************************************************************
514 #ifdef __cplusplus
515 }
516 #endif // __cplusplus
517 
518 #endif // __WLAN_H__
INT32 wlan_ioctl_set_connection_policy(UINT32 should_connect_to_open_ap, UINT32 ulShouldUseFastConnect, UINT32 ulUseProfiles)
When auto is enabled, the device tries to connect according the following policy: 1) If fast connect ...
Definition: wlan.c:520
INT32 wlan_ioctl_set_scan_params(UINT32 uiEnable, UINT32 uiMinDwellTime, UINT32 uiMaxDwellTime, UINT32 uiNumOfProbeRequests, UINT32 uiChannelMask, INT32 iRSSIThreshold, UINT32 uiSNRThreshold, UINT32 uiDefaultTxPower, UINT32 *aiIntervalList)
start and stop scan procedure. Set scan parameters.
Definition: wlan.c:851
INT32 wlan_smart_config_start(UINT32 algoEncryptedFlag)
Start to acquire device profile. The device acquire its own profile, if profile message is found...
Definition: wlan.c:1008
void wlan_init(tWlanCB sWlanCB, tFWPatches sFWPatches, tDriverPatches sDriverPatches, tBootLoaderPatches sBootLoaderPatches, tWlanReadInteruptPin sReadWlanInterruptPin, tWlanInterruptEnable sWlanInterruptEnable, tWlanInterruptDisable sWlanInterruptDisable, tWriteWlanPin sWriteWlanPin)
Initialize wlan driver.
Definition: wlan.c:178
void wlan_stop(void)
Stop WLAN device by putting it into reset state.
Definition: wlan.c:324
void wlan_start(UINT16 usPatchesAvailableAtHost)
Start WLAN device. This function asserts the enable pin of the device (WLAN_EN), starting the HW init...
Definition: wlan.c:255
INT32 wlan_smart_config_stop(void)
Stop the acquire profile procedure.
Definition: wlan.c:1045
INT32 wlan_add_profile(UINT32 ulSecType, UINT8 *ucSsid, UINT32 ulSsidLen, UINT8 *ucBssid, UINT32 ulPriority, UINT32 ulPairwiseCipher_Or_TxKeyLen, UINT32 ulGroupCipher_TxKeyIndex, UINT32 ulKeyMgmt, UINT8 *ucPf_OrKey, UINT32 ulPassPhraseLen)
When auto start is enabled, the device connects to 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 parameters. All the profiles are stored in CC3000 NVMEM.
Definition: wlan.c:580
INT32 wlan_disconnect()
Disconnect connection from AP.
Definition: wlan.c:471
INT32 wlan_ioctl_get_scan_results(UINT32 ulScanTimeout, UINT8 *ucResults)
Gets entry from scan result table. The scan results are returned one by one, and each entry represent...
Definition: wlan.c:790
INT32 wlan_smart_config_set_prefix(CHAR *cNewPrefix)
Configure station ssid prefix. The prefix is used internally in CC3000. It should always be TTT...
Definition: wlan.c:1078
INT32 wlan_connect(UINT32 ulSecType, CHAR *ssid, INT32 ssid_len, UINT8 *bssid, UINT8 *key, INT32 key_len)
Connect to AP.
Definition: wlan.c:376
INT32 wlan_set_event_mask(UINT32 ulMask)
Mask event according to bit mask. In case that event is masked (1), the device will not send the mask...
Definition: wlan.c:912
INT32 wlan_smart_config_process()
process the acquired data and store it as a profile. The acquired AP information is stored in CC3000 ...
Definition: wlan.c:1125
INT32 wlan_ioctl_del_profile(UINT32 ulIndex)
Delete WLAN profile.
Definition: wlan.c:732
INT32 wlan_ioctl_statusget(void)
get wlan status: disconnected, scanning, connecting or connected
Definition: wlan.c:969