Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Connection Manager

These functions are used to configure and control the WiFi connetion manager.

Data Structures

struct  cm
 
struct  cm_candidate
 

Functions

static struct wl_network_t * find_best_candidate (struct cm *cm)
 This function can be modified to pick a network based on application specific criteria. More...
 
static void select_net (struct cm *cm)
 
wl_err_t wl_cm_set_network (struct wl_ssid_t *ssid, struct wl_mac_addr_t *bssid)
 Set the desired network which the connection manager should try to connect to. More...
 
wl_err_t wl_cm_start (cm_scan_cb_t scan_cb, cm_conn_cb_t conn_cb, cm_disconn_cb_t disconn_cb, void *ctx)
 Doesn't actually start the CM, just initializing. More...
 
static void wl_conn_failure_cb (void *ctx)
 
static void wl_conn_lost_cb (void *ctx)
 
static void wl_event_cb (struct wl_event_t event, void *ctx)
 
static void wl_media_connected_cb (void *ctx)
 
static void wl_scan_complete_cb (void *ctx)
 

Variables

struct wl_mac_addr_t cm_candidate::bssid
 
struct cm_candidate cm::candidate
 
static struct cmcm = NULL
 
cm_conn_cb_tcm::conn_cb
 
void * cm::ctx
 
cm_disconn_cb_tcm::disconn_cb
 
cm_scan_cb_tcm::scan_cb
 
struct wl_ssid_t cm_candidate::ssid
 

static struct wl_network_t* find_best_candidate ( struct cm cm)
static

This function can be modified to pick a network based on application specific criteria.

If the SSID can not be found in the scan list it will be assumed to be a hidden SSID and the wl_connect() command will be called to attempt to probe for the network and connect to it.

References cm_candidate::bssid, cm::candidate, equal_bssid(), equal_ssid(), i, NULL, and cm_candidate::ssid.

Referenced by select_net().

wl_err_t wl_cm_set_network ( struct wl_ssid_t *  ssid,
struct wl_mac_addr_t *  bssid 
)

Set the desired network which the connection manager should try to connect to.

The ssid and bssid of the desired network should be specified. The ssid and bssid will be matched against the networks found during scan. If any parameter is null, it will always match. If both parameters are null, the first found network will be chosen.

Parameters
ssidThe ssid of the desired network. If null, any ssid will match.
bssidThe bssid of the desired network. If null, any bssid will match.

References cm_candidate::bssid, cm::candidate, NULL, and cm_candidate::ssid.

Referenced by cmd_connect().

wl_err_t wl_cm_start ( cm_scan_cb_t  scan_cb,
cm_conn_cb_t  conn_cb,
cm_disconn_cb_t  disconn_cb,
void *  ctx 
)

Doesn't actually start the CM, just initializing.

CM will run whenever an valid ssid is set through wl_cm_set_network().

References CM_DPRINTF, cm::conn_cb, ctx, cm::ctx, cm::disconn_cb, NULL, cm::scan_cb, and wl_event_cb().

Referenced by wl_init_complete_cb().

static void wl_conn_failure_cb ( void *  ctx)
static

References CM_DPRINTF.

Referenced by wl_event_cb().

static void wl_conn_lost_cb ( void *  ctx)
static

References CM_DPRINTF, ctx, cm::ctx, and cm::disconn_cb.

Referenced by wl_event_cb().

static void wl_event_cb ( struct wl_event_t  event,
void *  ctx 
)
static
static void wl_media_connected_cb ( void *  ctx)
static

References CM_DPRINTF, cm::conn_cb, ctx, cm::ctx, and ssid2str().

Referenced by wl_event_cb().

static void wl_scan_complete_cb ( void *  ctx)
static

References CM_DPRINTF, ctx, cm::ctx, cm::scan_cb, and select_net().

Referenced by wl_event_cb().

struct wl_mac_addr_t cm_candidate::bssid
struct cm_candidate cm::candidate
struct cm* cm = NULL
static
cm_conn_cb_t* cm::conn_cb
cm_disconn_cb_t* cm::disconn_cb

Referenced by wl_cm_start(), and wl_conn_lost_cb().

cm_scan_cb_t* cm::scan_cb

Referenced by wl_cm_start(), and wl_scan_complete_cb().

struct wl_ssid_t cm_candidate::ssid