summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/cc3k/wlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/cc3k/wlan.c')
-rw-r--r--stmhal/cc3k/wlan.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/stmhal/cc3k/wlan.c b/stmhal/cc3k/wlan.c
index b22796a7c8..4300bd995c 100644
--- a/stmhal/cc3k/wlan.c
+++ b/stmhal/cc3k/wlan.c
@@ -3,14 +3,6 @@
* wlan.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
-* Adapted for use with the Arduino/AVR by KTOWN (Kevin Townsend)
-* & Limor Fried for Adafruit Industries
-* This library works with the Adafruit CC3000 breakout
-* ----> https://www.adafruit.com/products/1469
-* Adafruit invests time and resources providing this open source code,
-* please support Adafruit and open-source hardware by purchasing
-* products from Adafruit!
-
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -60,7 +52,6 @@
#include "nvmem.h"
#include "security.h"
#include "evnt_handler.h"
-#include "ccdebug.h"
extern int errno;
@@ -133,13 +124,12 @@ static void SimpleLink_Init_Start(unsigned short usPatchesAvailableAtHost)
ptr = tSLInformation.pucTxCommandBuffer;
args = (unsigned char *)(ptr + HEADERS_SIZE_CMD);
- if (usPatchesAvailableAtHost > 2)
- usPatchesAvailableAtHost = 2;
- UINT8_TO_STREAM(args, usPatchesAvailableAtHost);
+ UINT8_TO_STREAM(args, ((usPatchesAvailableAtHost) ? SL_PATCHES_REQUEST_FORCE_NONE : SL_PATCHES_REQUEST_DEFAULT));
// IRQ Line asserted - send HCI_CMND_SIMPLE_LINK_START to CC3000
hci_command_send(HCI_CMND_SIMPLE_LINK_START, ptr, WLAN_SL_INIT_START_PARAMS_LEN);
+
SimpleLinkWaitEvent(HCI_CMND_SIMPLE_LINK_START, 0);
}
@@ -294,7 +284,7 @@ wlan_start(unsigned short usPatchesAvailableAtHost)
// Check the IRQ line
ulSpiIRQState = tSLInformation.ReadWlanInterruptPin();
- // ASIC 1273 chip enable: toggle WLAN EN line
+ // Chip enable: toggle WLAN EN line
tSLInformation.WriteWlanPin( WLAN_ENABLE );
if (ulSpiIRQState)
@@ -315,11 +305,9 @@ wlan_start(unsigned short usPatchesAvailableAtHost)
{
}
}
- DEBUGPRINT_F("SimpleLink start\n\r");
SimpleLink_Init_Start(usPatchesAvailableAtHost);
// Read Buffer's size and finish
- DEBUGPRINT_F("Read buffer\n\r");
hci_command_send(HCI_CMND_READ_BUFFER_SIZE, tSLInformation.pucTxCommandBuffer, 0);
SimpleLinkWaitEvent(HCI_CMND_READ_BUFFER_SIZE, 0);
}
@@ -342,7 +330,7 @@ wlan_start(unsigned short usPatchesAvailableAtHost)
void
wlan_stop(void)
{
- // ASIC 1273 chip disable
+ // Chip disable
tSLInformation.WriteWlanPin( WLAN_DISABLE );
// Wait till IRQ line goes high...
@@ -371,7 +359,7 @@ wlan_stop(void)
//! @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
-//! @param key up to 16 bytes specified the AP security key
+//! @param key up to 32 bytes specified the AP security key
//! @param key_len key length
//!
//! @return On success, zero is returned. On error, negative is returned.
@@ -576,13 +564,17 @@ wlan_ioctl_set_connection_policy(unsigned long should_connect_to_open_ap,
//! @param ulSsidLen ssid length
//! @param ucBssid bssid 6 bytes
//! @param ulPriority ulPriority profile priority. Lowest priority:0.
+//! Important Note: Smartconfig process (in unencrypted mode)
+//! stores the profile internally with priority 1, so changing
+//! priorities when adding new profiles should be done with extra care
//! @param ulPairwiseCipher_Or_TxKeyLen key length for WEP security
//! @param ulGroupCipher_TxKeyIndex key index
//! @param ulKeyMgmt KEY management
//! @param ucPf_OrKey security key
//! @param ulPassPhraseLen security key length for WPA\WPA2
//!
-//! @return On success, zero is returned. On error, -1 is returned
+//! @return On success, index (1-7) of the stored profile is returned.
+//! On error, -1 is returned.
//!
//! @brief When auto start is enabled, the device connects to
//! station from the profiles table. Up to 7 profiles are supported.