CC3000
1.12
|
Functions | |
void | wlan_init (tWlanCB sWlanCB, tFWPatches sFWPatches, tDriverPatches sDriverPatches, tBootLoaderPatches sBootLoaderPatches, tWlanReadInteruptPin sReadWlanInterruptPin, tWlanInterruptEnable sWlanInterruptEnable, tWlanInterruptDisable sWlanInterruptDisable, tWriteWlanPin sWriteWlanPin) |
Initialize wlan driver. More... | |
void | SpiReceiveHandler (void *pvBuffer) |
The function triggers Received event/data processing. It is called from the SPI library to receive the data. More... | |
void | wlan_start (UINT16 usPatchesAvailableAtHost) |
Start WLAN device. This function asserts the enable pin of the device (WLAN_EN), starting the HW initialization process. The function blocked until device Initialization is completed. Function also configure patches (FW, driver or bootloader) and calls appropriate device callbacks. More... | |
void | wlan_stop (void) |
Stop WLAN device by putting it into reset state. More... | |
INT32 | wlan_connect (UINT32 ulSecType, CHAR *ssid, INT32 ssid_len, UINT8 *bssid, UINT8 *key, INT32 key_len) |
Connect to AP. More... | |
INT32 | wlan_disconnect () |
Disconnect connection from AP. More... | |
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 is enabled and last connection is valid, the device will try to connect to it without the scanning procedure (fast). The last connection will be marked as invalid, due to adding/removing profile. 2) If profile exists, the device will try to connect it (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. More... | |
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. More... | |
INT32 | wlan_ioctl_del_profile (UINT32 ulIndex) |
Delete WLAN profile. More... | |
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 represents a single AP found in the area. The following is a format of the scan result: More... | |
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. More... | |
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 masked event to host. More... | |
INT32 | wlan_ioctl_statusget (void) |
get wlan status: disconnected, scanning, connecting or connected More... | |
INT32 | wlan_smart_config_start (UINT32 algoEncryptedFlag) |
Start to acquire device profile. The device acquire its own profile, if profile message is found. The acquired AP information is stored in CC3000 EEPROM only in case AES128 encryption is used. In case AES128 encryption is not used, a profile is created by CC3000 internally. More... | |
INT32 | wlan_smart_config_stop (void) |
Stop the acquire profile procedure. More... | |
INT32 | wlan_smart_config_set_prefix (CHAR *cNewPrefix) |
Configure station ssid prefix. The prefix is used internally in CC3000. It should always be TTT. More... | |
INT32 | wlan_smart_config_process () |
process the acquired data and store it as a profile. The acquired 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. More... | |
Variables | |
volatile sSimplLinkInformation | tSLInformation |
UINT8 | key [AES128_KEY_SIZE] |
UINT8 | profileArray [SMART_CONFIG_PROFILE_SIZE] |
void SpiReceiveHandler | ( | void * | pvBuffer | ) |
The function triggers Received event/data processing. It is called from the SPI library to receive the data.
SpiReceiveHandler
pvBuffer | - pointer to the received data buffer The function triggers Received event/data processing |
Pointer | to the received data |
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.
wlan_add_profile
ulSecType | WLAN_SEC_UNSEC,WLAN_SEC_WEP,WLAN_SEC_WPA,WLAN_SEC_WPA2 |
ucSsid | ssid SSID up to 32 bytes |
ulSsidLen | ssid length |
ucBssid | bssid 6 bytes |
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 |
ulPairwiseCipher_Or_TxKeyLen | key length for WEP security |
ulGroupCipher_TxKeyIndex | key index |
ulKeyMgmt | KEY management |
ucPf_OrKey | security key |
ulPassPhraseLen | security key length for WPA |
wlan_add_profile
ulSecType | WLAN_SEC_UNSEC,WLAN_SEC_WEP,WLAN_SEC_WPA,WLAN_SEC_WPA2 |
ucSsid | ssid SSID up to 32 bytes |
ulSsidLen | ssid length |
ucBssid | bssid 6 bytes |
ulPriority | ulPriority profile priority. Lowest priority:0. |
ulPairwiseCipher_Or_TxKeyLen | key length for WEP security |
ulGroupCipher_TxKeyIndex | key index |
ulKeyMgmt | KEY management |
ucPf_OrKey | security key |
ulPassPhraseLen | security key length for WPA |
INT32 wlan_connect | ( | UINT32 | ulSecType, |
CHAR * | ssid, | ||
INT32 | ssid_len, | ||
UINT8 * | bssid, | ||
UINT8 * | key, | ||
INT32 | key_len | ||
) |
Connect to AP.
wlan_connect
sec_type | security options: WLAN_SEC_UNSEC, WLAN_SEC_WEP (ASCII support only), WLAN_SEC_WPA or WLAN_SEC_WPA2 |
ssid | up to 32 bytes and is ASCII SSID of the AP |
ssid_len | length of the SSID |
bssid | 6 bytes specified the AP bssid |
key | up to 32 bytes specified the AP security key |
key_len | key length |
INT32 wlan_disconnect | ( | ) |
Disconnect connection from AP.
wlan_disconnect
void wlan_init | ( | tWlanCB | sWlanCB, |
tFWPatches | sFWPatches, | ||
tDriverPatches | sDriverPatches, | ||
tBootLoaderPatches | sBootLoaderPatches, | ||
tWlanReadInteruptPin | sReadWlanInterruptPin, | ||
tWlanInterruptEnable | sWlanInterruptEnable, | ||
tWlanInterruptDisable | sWlanInterruptDisable, | ||
tWriteWlanPin | sWriteWlanPin | ||
) |
Initialize wlan driver.
wlan_init
sWlanCB | Asynchronous events callback. 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, HCI_EVNT_WLAN_UNSOL_DHCP dhcp report, HCI_EVNT_WLAN_ASYNC_PING_REPORT ping report OR 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: HCI_EVNT_WLAN_UNSOL_DHCP: 4 bytes IP, 4 bytes Mask, 4 bytes default gateway, 4 bytes DHCP server and 4 bytes for DNS server. HCI_EVNT_WLAN_ASYNC_PING_REPORT: 4 bytes Packets sent, 4 bytes Packets received, 4 bytes Min round time, 4 bytes Max round time and 4 bytes for Avg round time. |
sFWPatches | 0 no patch or pointer to FW patches |
sDriverPatches | 0 no patch or pointer to driver patches |
sBootLoaderPatches | 0 no patch or pointer to bootloader patches |
sReadWlanInterruptPin | init callback. the callback read wlan interrupt status. |
sWlanInterruptEnable | init callback. the callback enable wlan interrupt. |
sWlanInterruptDisable | init callback. the callback disable wlan interrupt. |
sWriteWlanPin | init callback. the callback write value to device pin. |
INT32 wlan_ioctl_del_profile | ( | UINT32 | ulIndex | ) |
Delete WLAN profile.
wlan_ioctl_del_profile
index | number of profile to delete |
In order to delete all stored profile, set index to 255.
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 represents a single AP found in the area. The following is a format of the scan result:
wlan_ioctl_get_scan_results
[in] | scan_timeout | parameter not supported |
[out] | ucResults | scan results (_wlan_full_scan_results_args_t) |
- 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: - 1 bit isValid - is result valid or not - 7 bits rssi - RSSI value; - 2 bits: securityMode - security mode of the AP: 0 - Open, 1 - WEP, 2 WPA, 3 WPA2 - 6 bits: SSID name length - 2 bytes: the time at which the entry has entered into scans result table - 32 bytes: SSID name - 6 bytes: BSSID
scan_timeout, is not supported on this version.
wlan_ioctl_get_scan_results
[in] | scan_timeout | parameter not supported |
[out] | ucResults | scan result (_wlan_full_scan_results_args_t) |
- 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: - 1 bit isValid - is result valid or not - 7 bits rssi - RSSI value; - 2 bits: securityMode - security mode of the AP: 0 - Open, 1 - WEP, 2 WPA, 3 WPA2 - 6 bits: SSID name length - 2 bytes: the time at which the entry has entered into scans result table - 32 bytes: SSID name - 6 bytes: BSSID
scan_timeout, is not supported on this version.
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 is enabled and last connection is valid, the device will try to connect to it without the scanning procedure (fast). The last connection will be marked as invalid, due to adding/removing profile. 2) If profile exists, the device will try to connect it (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.
wlan_ioctl_set_connection_policy
should_connect_to_open_ap | enable(1), disable(0) connect to any available AP. This parameter corresponds to the configuration of item # 3 in the brief description. |
should_use_fast_connect | enable(1), disable(0). if enabled, tries to connect to the last connected AP. This parameter corresponds to the configuration of item # 1 in the brief description. |
auto_start | enable(1), disable(0) auto connect after reset and periodically reconnect if needed. This configuration configures option 2 in the above description. |
* Note that the policy settings are stored in the CC3000 NVMEM.
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.
wlan_ioctl_set_scan_params
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 in milliseconds. minimum 1 second. 0=stop). Wlan reset (wlan_stop() wlan_start()) is needed when changing scan interval value. Saved: No |
uiMinDwellTime | minimum dwell time value to be used for each channel, in milliseconds. Saved: yes Recommended Value: 100 (Default: 20) |
uiMaxDwellTime | maximum dwell time value to be used for each channel, in milliseconds. Saved: yes Recommended Value: 100 (Default: 30) |
uiNumOfProbeRequests | max probe request between dwell time. Saved: yes. Recommended Value: 5 (Default:2) |
uiChannelMask | bitwise, up to 13 channels (0x1fff). Saved: yes. Default: 0x7ff |
uiRSSIThreshold | RSSI threshold. Saved: yes (Default: -80) |
uiSNRThreshold | NSR threshold. Saved: yes (Default: 0) |
uiDefaultTxPower | probe Tx power. Saved: yes (Default: 205) |
aiIntervalList | pointer to array with 16 entries (16 channels) each entry (UINT32) holds timeout between periodic scan (connection scan) - in millisecond. Saved: yes. Default 2000ms. |
uiDefaultTxPower, is not supported on this version.
wlan_ioctl_set_scan_params
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 in milliseconds. minimum 1 second. 0=stop). Wlan reset (wlan_stop() wlan_start()) is needed when changing scan interval value. Saved: No |
uiMinDwellTime | minimum dwell time value to be used for each channel, in milliseconds. Saved: yes Recommended Value: 100 (Default: 20) |
uiMaxDwellTime | maximum dwell time value to be used for each channel, in milliseconds. Saved: yes Recommended Value: 100 (Default: 30) |
uiNumOfProbeRequests | max probe request between dwell time. Saved: yes. Recommended Value: 5 (Default:2) |
uiChannelMask | bitwise, up to 13 channels (0x1fff). Saved: yes. Default: 0x7ff |
uiRSSIThreshold | RSSI threshold. Saved: yes (Default: -80) |
uiSNRThreshold | NSR threshold. Saved: yes (Default: 0) |
uiDefaultTxPower | probe Tx power. Saved: yes (Default: 205) |
aiIntervalList | pointer to array with 16 entries (16 channels) each entry (UINT32) holds timeout between periodic scan (connection scan) - in milliseconds. Saved: yes. Default 2000ms. |
uiDefaultTxPower, is not supported on this version.
INT32 wlan_ioctl_statusget | ( | void | ) |
get wlan status: disconnected, scanning, connecting or connected
wlan_ioctl_statusget
none |
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 masked event to host.
wlan_set_event_mask
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. |
INT32 wlan_smart_config_process | ( | ) |
process the acquired data and store it as a profile. The acquired 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.
wlan_smart_config_process
none |
INT32 wlan_smart_config_set_prefix | ( | CHAR * | cNewPrefix | ) |
Configure station ssid prefix. The prefix is used internally in CC3000. It should always be TTT.
wlan_smart_config_set_prefix
newPrefix | 3 bytes identify the SSID prefix for the Smart Config. |
The prefix is stored in CC3000 NVMEM
INT32 wlan_smart_config_start | ( | UINT32 | algoEncryptedFlag | ) |
Start to acquire device profile. The device acquire its own profile, if profile message is found. The acquired AP information is stored in CC3000 EEPROM only in case AES128 encryption is used. In case AES128 encryption is not used, a profile is created by CC3000 internally.
wlan_smart_config_start
algoEncryptedFlag | indicates whether the information is encrypted |
An asynchronous event - Smart Config Done will be generated as soon as the process finishes successfully.
INT32 wlan_smart_config_stop | ( | void | ) |
Stop the acquire profile procedure.
wlan_smart_config_stop
algoEncryptedFlag | indicates whether the information is encrypted |
void wlan_start | ( | UINT16 | usPatchesAvailableAtHost | ) |
Start WLAN device. This function asserts the enable pin of the device (WLAN_EN), starting the HW initialization process. The function blocked until device Initialization is completed. Function also configure patches (FW, driver or bootloader) and calls appropriate device callbacks.
wlan_start
usPatchesAvailableAtHost | - flag to indicate if patches available from host or from EEPROM. Due to the fact the patches are burn to the EEPROM using the patch programmer utility, the patches will be available from the EEPROM and not from the host. |
Prior calling the function wlan_init shall be called. This function must be called after wlan_init and before any other wlan API
void wlan_stop | ( | void | ) |
Stop WLAN device by putting it into reset state.
wlan_stop
none |