wl_util.h File Reference


Detailed Description

Optional WiFi support/convenience functions.

**************************************************************

This file provides a support interface for wl_api.

Author:
H&D Wireless:

Definition in file wl_util.h.

#include "top_defs.h"
#include <stdint.h>
#include <string.h>
#include "wl_api.h"

Go to the source code of this file.

Defines

#define FALSE   0
#define NET_SET_BSSID(net, xbssid)
#define NET_SET_SSID(net, xssid, ssid_len)
#define TRUE   1

Functions

char * enc_type2str (enum wl_enc_type enc_type) WEAK_DECL
int equal_bssid (const struct wl_mac_addr_t *bssid1, const struct wl_mac_addr_t *bssid2) WEAK_DECL
int equal_ssid (const struct wl_ssid_t *ssid1, const struct wl_ssid_t *ssid2) WEAK_DECL
const char * mac2str (uint8_t mac[6]) WEAK_DECL
const char * ssid2str (struct wl_ssid_t *ssid) WEAK_DECL


Define Documentation

#define FALSE   0

#define NET_SET_BSSID ( net,
xbssid   ) 

Value:

do { \
                memcpy(&(net)->bssid, &(xbssid), sizeof (xbssid));  \
        } while (0)

Definition at line 95 of file wl_util.h.

#define NET_SET_SSID ( net,
xssid,
ssid_len   ) 

Value:

do { \
                memcpy((net)->ssid.ssid, (xssid), (ssid_len));   \
                (net)->ssid.len = (ssid_len);                   \
        } while (0)

Definition at line 90 of file wl_util.h.

#define TRUE   1


Function Documentation

char* enc_type2str ( enum wl_enc_type  enc_type  ) 

Definition at line 70 of file wl_util.c.

Referenced by gui_scan_cb().

00071 {
00072         switch(enc_type) {
00073         case ENC_TYPE_WEP:
00074                 return "WEP";
00075         case ENC_TYPE_CCMP:
00076                 return "CCMP";
00077         case ENC_TYPE_TKIP:
00078                 return "TKIP";
00079         default:
00080                 return "";
00081         };
00082 }

int equal_bssid ( const struct wl_mac_addr_t *  bssid1,
const struct wl_mac_addr_t *  bssid2 
)

Definition at line 43 of file wl_util.c.

Referenced by find_best_candidate(), and gui_connect_cb().

00044                                             {
00045         if (memcmp(bssid1, bssid2, sizeof *bssid1) == 0) {
00046                 return 1;
00047         }
00048         return 0;
00049 }

int equal_ssid ( const struct wl_ssid_t *  ssid1,
const struct wl_ssid_t *  ssid2 
)

Definition at line 34 of file wl_util.c.

Referenced by find_best_candidate().

00035                                           {
00036         if (ssid1->len == ssid2->len &&
00037             (memcmp(ssid1->ssid, ssid2->ssid, ssid1->len) == 0)) {
00038                 return 1;
00039         }
00040         return 0;
00041 }

const char* mac2str ( uint8_t  mac[6]  ) 

const char* ssid2str ( struct wl_ssid_t *  ssid  ) 

Return a buffer with the SSID as a printable string. The returned buffer is static and should not be freed and this function is not thread safe.

Definition at line 51 of file wl_util.c.

Referenced by gui_scan_cb(), gui_status_up_cb(), print_network(), set_wpa_key_cb(), wl_cm_conn_cb(), and wl_media_connected_cb().

00051                                              {
00052         static char buf[WL_SSID_MAX_LENGTH + 1];
00053 
00054         memset(buf, 0, sizeof buf);
00055         memcpy(buf, ssid->ssid, ssid->len);
00056 
00057         return buf;
00058 }


Generated on Fri Feb 19 02:24:09 2010 for AVR32 - H&D by  doxygen 1.5.5