CC3000  1.14
 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 #define WLAN_STATUS_DISCONNECTED (0)
56 #define WLAN_STATUS_SCANNING (1)
57 #define WLAN_STATUS_CONNECTING (2)
58 #define WLAN_STATUS_CONNECTED (3)
59 
60 //*****************************************************************************
61 //
64 //
65 //*****************************************************************************
66 
67 
68 //*****************************************************************************
69 //
111 //
112 //*****************************************************************************
113 extern void wlan_init( tWlanCB sWlanCB,
114  tFWPatches sFWPatches,
115  tDriverPatches sDriverPatches,
116  tBootLoaderPatches sBootLoaderPatches,
117  tWlanReadInteruptPin sReadWlanInterruptPin,
118  tWlanInterruptEnable sWlanInterruptEnable,
119  tWlanInterruptDisable sWlanInterruptDisable,
120  tWriteWlanPin sWriteWlanPin);
121 
122 
123 
124 //*****************************************************************************
125 //
148 //
149 //*****************************************************************************
150 extern void wlan_start(UINT16 usPatchesAvailableAtHost);
151 
152 //*****************************************************************************
153 //
163 //
164 //*****************************************************************************
165 extern void wlan_stop(void);
166 
167 //*****************************************************************************
168 //
195 //
196 //*****************************************************************************
197 #ifndef CC3000_TINY_DRIVER
198 extern INT32 wlan_connect(UINT32 ulSecType, CHAR *ssid, INT32 ssid_len,
199  UINT8 *bssid, UINT8 *key, INT32 key_len);
200 #else
201 extern INT32 wlan_connect(CHAR *ssid, INT32 ssid_len);
202 
203 #endif
204 
205 //*****************************************************************************
206 //
214 //
215 //*****************************************************************************
216 
217 extern INT32 wlan_disconnect(void);
218 
219 //*****************************************************************************
220 //
245 //
246 //*****************************************************************************
247 
248 extern INT32 wlan_add_profile(UINT32 ulSecType, UINT8* ucSsid,
249  UINT32 ulSsidLen,
250  UINT8 *ucBssid,
251  UINT32 ulPriority,
252  UINT32 ulPairwiseCipher_Or_Key,
253  UINT32 ulGroupCipher_TxKeyLen,
254  UINT32 ulKeyMgmt,
255  UINT8* ucPf_OrKey,
256  UINT32 ulPassPhraseLen);
257 
258 
259 
260 //*****************************************************************************
261 //
273 //
274 //*****************************************************************************
275 extern INT32 wlan_ioctl_del_profile(UINT32 ulIndex);
276 
277 //*****************************************************************************
278 //
296 //
297 //*****************************************************************************
298 extern INT32 wlan_set_event_mask(UINT32 ulMask);
299 
300 //*****************************************************************************
301 //
310 //
311 //*****************************************************************************
312 extern INT32 wlan_ioctl_statusget(void);
313 
314 
315 //*****************************************************************************
316 //
344 //
345 //*****************************************************************************
347  UINT32 should_connect_to_open_ap,
348  UINT32 should_use_fast_connect,
349  UINT32 ulUseProfiles);
350 
351 //*****************************************************************************
352 //
382 //
383 //*****************************************************************************
384 
385 
386 extern INT32 wlan_ioctl_get_scan_results(UINT32 ulScanTimeout,
387  UINT8 *ucResults);
388 
389 //*****************************************************************************
390 //
423 //
424 //*****************************************************************************
425 extern INT32 wlan_ioctl_set_scan_params(UINT32 uiEnable, UINT32
426  uiMinDwellTime,UINT32 uiMaxDwellTime,
427  UINT32 uiNumOfProbeRequests,
428  UINT32 uiChannelMask,
429  INT32 iRSSIThreshold,UINT32 uiSNRThreshold,
430  UINT32 uiDefaultTxPower,
431  UINT32 *aiIntervalList);
432 
433 
434 //*****************************************************************************
435 //
452 //
453 //*****************************************************************************
454 extern INT32 wlan_smart_config_start(UINT32 algoEncryptedFlag);
455 
456 
457 //*****************************************************************************
458 //
468 //
469 //*****************************************************************************
470 extern INT32 wlan_smart_config_stop(void);
471 
472 //*****************************************************************************
473 //
486 //
487 //*****************************************************************************
488 extern INT32 wlan_smart_config_set_prefix(CHAR* cNewPrefix);
489 
490 //*****************************************************************************
491 //
502 //
503 //*****************************************************************************
504 extern INT32 wlan_smart_config_process(void);
505 
506 //*****************************************************************************
507 //
508 // Close the Doxygen group.
510 //
511 //*****************************************************************************
512 
513 
514 
515 //*****************************************************************************
516 //
517 // Mark the end of the C bindings section for C++ compilers.
518 //
519 //*****************************************************************************
520 #ifdef __cplusplus
521 }
522 #endif // __cplusplus
523 
524 #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