None

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Embed: (wiki syntax)

« Back to documentation index

cc3000_wlan Class Reference

cc3000_wlan Class Reference

WLAN layer. More...

#include <cc3000.h>

Public Member Functions

 cc3000_wlan (cc3000_simple_link &simple_link, cc3000_event &event, cc3000_spi &spi, cc3000_hci &hci)
 Ctor.
 ~cc3000_wlan ()
 Dtor.
void simpleLink_init_start (uint16_t patches_available_host)
 Send SIMPLE LINK START to cc3000.
void start (uint16_t patches_available_host)
 Start wlan device.
void stop (void)
 Stop wlan device.
int32_t connect (uint32_t sec_type, const uint8_t *ssid, int32_t ssid_length, uint8_t *b_ssid, uint8_t *key, int32_t key_len)
 Connect to AP.
int32_t add_profile (uint32_t sec_type, uint8_t *ssid, uint32_t ssid_length, uint8_t *b_ssid, uint32_t priority, uint32_t pairwise_cipher_or_tx_key_len, uint32_t group_cipher_tx_key_index, uint32_t key_mgmt, uint8_t *pf_or_key, uint32_t pass_phrase_length)
 Add profile.
int32_t ioctl_get_scan_results (uint32_t scan_timeout, uint8_t *results)
 Gets entry from scan result table.
int32_t ioctl_set_scan_params (uint32_t enable, uint32_t min_dwell_time, uint32_t max_dwell_time, uint32_t num_probe_requests, uint32_t channel_mask, int32_t rssi_threshold, uint32_t snr_threshold, uint32_t default_tx_power, uint32_t *interval_list)
 Start and stop scan procedure.
int32_t ioctl_statusget (void)
 Get wlan status: disconnected, scanning, connecting or connected.
int32_t connect (const uint8_t *ssid, int32_t ssid_length)
 Connect to AP.
int32_t add_profile (uint32_t sec_type, uint8_t *ssid, uint32_t ssid_length, uint8_t *b_ssid, uint32_t priority, uint32_t pairwise_cipher_or_tx_key_len, uint32_t group_cipher_tx_key_index, uint32_t key_mgmt, uint8_t *pf_or_key, uint32_t pass_phrase_length)
 When auto start is enabled, the device connects to station from the profiles table.
int32_t smart_config_process (void)
 Process the acquired data and store it as a profile.
int32_t disconnect ()
 Disconnect connection from AP.
int32_t ioctl_set_connection_policy (uint32_t should_connect_to_open_ap, uint32_t use_fast_connect, uint32_t use_profiles)
 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).
int32_t ioctl_del_profile (uint32_t index)
 Delete WLAN profile.
int32_t set_event_mask (uint32_t mask)
 Mask event according to bit mask.
int32_t smart_config_start (uint32_t encrypted_flag)
 Start to acquire device profile.
int32_t smart_config_stop (void)
 Stop the acquire profile procedure.
int32_t smart_config_set_prefix (uint8_t *new_prefix)
 Configure station ssid prefix.

Detailed Description

WLAN layer.

Definition at line 1332 of file cc3000.h.


Constructor & Destructor Documentation

cc3000_wlan ( cc3000_simple_link simple_link,
cc3000_event event,
cc3000_spi spi,
cc3000_hci hci 
)

Ctor.

Parameters:
simple_linkReference to the simple link object.
eventReference to the event object.
spiReference to the spi object.
hciReference to the hci object.
Returns:
none

Definition at line 45 of file cc3000_wlan.cpp.

~cc3000_wlan (  )

Dtor.

Parameters:
none
Returns:
none

Definition at line 50 of file cc3000_wlan.cpp.


Member Function Documentation

int32_t add_profile ( uint32_t  sec_type,
uint8_t *  ssid,
uint32_t  ssid_length,
uint8_t *  b_ssid,
uint32_t  priority,
uint32_t  pairwise_cipher_or_tx_key_len,
uint32_t  group_cipher_tx_key_index,
uint32_t  key_mgmt,
uint8_t *  pf_or_key,
uint32_t  pass_phrase_length 
)

Add profile.

Up to 7 profiles are supported.

Parameters:
sec_typeSecurity option.
ssidUp to 32 bytes, ASCII SSID
ssid_lengthLength of SSID
b_ssid6 bytes specified the AP bssid
priorityUp to 16 bytes specified the AP security key
pairwise_cipher_or_tx_key_lenKey length
group_cipher_tx_key_indexKey length for WEP security
key_mgmtKEY management
pf_or_keySecurity key
pass_phrase_lengthSecurity key length for WPA
Returns:
On success, zero is returned. On error, negative is returned.

Definition at line 326 of file cc3000_wlan.cpp.

int32_t add_profile ( uint32_t  sec_type,
uint8_t *  ssid,
uint32_t  ssid_length,
uint8_t *  b_ssid,
uint32_t  priority,
uint32_t  pairwise_cipher_or_tx_key_len,
uint32_t  group_cipher_tx_key_index,
uint32_t  key_mgmt,
uint8_t *  pf_or_key,
uint32_t  pass_phrase_length 
)

When auto start is enabled, the device connects to station from the profiles table.

If several profiles configured the device choose the highest priority profile.

Parameters:
sec_typeWLAN_SEC_UNSEC,WLAN_SEC_WEP,WLAN_SEC_WPA,WLAN_SEC_WPA2
ssidSSID up to 32 bytes
ssid_lengthSSID length
b_ssidbssid 6 bytes
priorityProfile priority. Lowest priority:0.
pairwise_cipher_or_tx_key_lenKey length for WEP security
group_cipher_tx_key_indexKey index
key_mgmtKEY management
pf_or_keySecurity key
pass_phrase_lengthSecurity key length for WPA
Returns:
On success, zero is returned. On error, -1 is returned
int32_t connect ( const uint8_t *  ssid,
int32_t  ssid_length 
)

Connect to AP.

Parameters:
ssidUp to 32 bytes and is ASCII SSID of the AP
ssid_lengthLength of the SSID
Returns:
On success, zero is returned. On error, negative is returned.

Definition at line 521 of file cc3000_wlan.cpp.

int32_t connect ( uint32_t  sec_type,
const uint8_t *  ssid,
int32_t  ssid_length,
uint8_t *  b_ssid,
uint8_t *  key,
int32_t  key_len 
)

Connect to AP.

Parameters:
sec_typeSecurity option.
ssidup to 32 bytes, ASCII SSID
ssid_lengthlength of SSID
b_ssid6 bytes specified the AP bssid
keyup to 16 bytes specified the AP security key
key_lenkey length
Returns:
On success, zero is returned. On error, negative is returned.

Definition at line 284 of file cc3000_wlan.cpp.

int32_t disconnect (  )

Disconnect connection from AP.

Parameters:
none
Returns:
0 if disconnected done, other CC3000 already disconnected.

Definition at line 116 of file cc3000_wlan.cpp.

int32_t ioctl_del_profile ( uint32_t  index )

Delete WLAN profile.

Parameters:
indexNumber of profile to delete
Returns:
On success, zero is returned. On error, -1 is returned

Definition at line 159 of file cc3000_wlan.cpp.

int32_t ioctl_get_scan_results ( uint32_t  scan_timeout,
uint8_t *  results 
)

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.

Parameters:
scan_timeoutNot supported yet
resultsScan result
Returns:
On success, zero is returned. On error, -1 is returned

Definition at line 435 of file cc3000_wlan.cpp.

int32_t ioctl_set_connection_policy ( uint32_t  should_connect_to_open_ap,
uint32_t  use_fast_connect,
uint32_t  use_profiles 
)

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. Note that the policy settings are stored in the CC3000 NVMEM.

Parameters:
should_connect_to_open_apEnable(1), disable(0) connect to any available AP.
use_fast_connectEnable(1), disable(0). if enabled, tries to connect to the last connected AP.
use_profilesEnable(1), disable(0) auto connect after reset. and periodically reconnect if needed.
Returns:
On success, zero is returned. On error, -1 is returned

Definition at line 133 of file cc3000_wlan.cpp.

int32_t ioctl_set_scan_params ( uint32_t  enable,
uint32_t  min_dwell_time,
uint32_t  max_dwell_time,
uint32_t  num_probe_requests,
uint32_t  channel_mask,
int32_t  rssi_threshold,
uint32_t  snr_threshold,
uint32_t  default_tx_power,
uint32_t *  interval_list 
)

Start and stop scan procedure.

Set scan parameters.

Parameters:
enableStart/stop application scan
min_dwell_timeMinimum dwell time value to be used for each channel, in ms. (Default: 20)
max_dwell_timeMaximum dwell time value to be used for each channel, in ms. (Default: 30)
num_probe_requestsMax probe request between dwell time. (Default:2)
channel_maskBitwise, up to 13 channels (0x1fff).
rssi_thresholdRSSI threshold. Saved: yes (Default: -80)
snr_thresholdNSR threshold. Saved: yes (Default: 0)
default_tx_powerprobe Tx power. Saved: yes (Default: 205)
interval_listPointer to array with 16 entries (16 channels)
Returns:
On success, zero is returned. On error, -1 is returned.

Definition at line 454 of file cc3000_wlan.cpp.

int32_t ioctl_statusget ( void   )

Get wlan status: disconnected, scanning, connecting or connected.

Parameters:
none
Returns:
WLAN_STATUS_DISCONNECTED, WLAN_STATUS_SCANING, STATUS_CONNECTING or WLAN_STATUS_CONNECTED

Definition at line 491 of file cc3000_wlan.cpp.

int32_t set_event_mask ( uint32_t  mask )

Mask event according to bit mask.

In case that event is masked (1), the device will not send the masked event to host.

Parameters:
maskevent mask
Returns:
On success, zero is returned. On error, -1 is returned

Definition at line 180 of file cc3000_wlan.cpp.

void simpleLink_init_start ( uint16_t  patches_available_host )

Send SIMPLE LINK START to cc3000.

Parameters:
patches_available_hostFlag to indicate if patches are available.
Returns:
none

Definition at line 54 of file cc3000_wlan.cpp.

int32_t smart_config_process ( void   )

Process the acquired data and store it as a profile.

Parameters:
none
Returns:
On success, zero is returned. On error, -1 is returned.

Definition at line 557 of file cc3000_wlan.cpp.

int32_t smart_config_set_prefix ( uint8_t *  new_prefix )

Configure station ssid prefix.

Parameters:
new_prefix3 bytes identify the SSID prefix for the Smart Config.
Returns:
On success, zero is returned. On error, -1 is returned.

Definition at line 255 of file cc3000_wlan.cpp.

int32_t smart_config_start ( uint32_t  encrypted_flag )

Start to acquire device profile.

The device acquire its own profile, if profile message is found.

Parameters:
encrypted_flagIndicates whether the information is encrypted
Returns:
On success, zero is returned. On error, -1 is returned.

Definition at line 218 of file cc3000_wlan.cpp.

int32_t smart_config_stop ( void   )

Stop the acquire profile procedure.

Parameters:
none
Returns:
On success, zero is returned. On error, -1 is returned

Definition at line 240 of file cc3000_wlan.cpp.

void start ( uint16_t  patches_available_host )

Start wlan device.

Blocking call until init is completed.

Parameters:
patches_available_hostFlag to indicate if patches are available.
Returns:
none

Definition at line 68 of file cc3000_wlan.cpp.

void stop ( void   )

Stop wlan device.

Parameters:
none
Returns:
none

Definition at line 105 of file cc3000_wlan.cpp.