The Design Cycle
results in putting the TRENDnet
TEW-222CF wireless LAN
CompactFlash card on the air.
We’ve already discussed the
init_USART and init_cf_card functions. The fun begins with the call to
airdrop_config(BSS). This tells the
TEW-222CF that we want to participate in an infrastructure network
(BSS) and ultimately associate with
an access point. The next call to airdrop_config(SSID) is optional. A
string can be defined with the name
of the particular network (BSS) you
would like to join. The service set
identifier (SSID) is a 32-character
identifier that you assign to your
access point/router and is used to differentiate one wireless LAN from
another. For instance, my lab wireless
LAN has an SSID of “EDTP.” To join
the EDTP BSS, I must code the
AirDrop-P 802.11b driver in the
appropriate location as follows:
The TRENDnet TEW-222CF Link
LED is still flashing at this point, indicating that we are still in the setup
process and haven’t made any real
attempts to get on the air. The next
items we need to check off of our
shopping list are the MAC and IP
addresses for the wireless NIC. The
TRENDnet TEW-222CF’s MAC
address is garnered electronically via
an 802.11b driver call, and the IP
address is defined inside the 802.11b
driver code as follows:
char ipaddrc[ 4] = { 192,168,0,151 };
The downside of just copying the
CompactFlash card’s MAC address
and hand coding it in is that, if you
change CompactFlash cards, you’ll
have to reenter the new MAC address
manually.
We’re just about to enter the
EDTP access point’s air space. The
next set of function calls in Listing 3
turn on the 802.11b radio and send
probe messages out into the ether.
The TEW-222CF is actually “fishing”
at this point. The TEW-222CF’s
Activity LED is flashing as data is
passed from the now active TEW-
222CF NIC to any access point in the
range of the TEW-222CF’s probing
radio signal. If everything we’ve done
this far was correct, in less than a second the TEW-222CF’s Activity LED
will flicker and extinguish and the
TEW-222CF’s Link LED will glow
steadily. This indicates that the
AirDrop-P has contacted an access
point and gotten a response from the
access point, telling it who the access
point is and what capabilities the
access point has.
The AirDrop-P then associates with
the selected access point (in our case,
the “EDTP” access point), authenticates itself with the access point — if
necessary — and joins the EDTP
access point’s BSS. The AirDrop-P can
now send and receive meaningful data
on the wireless LAN with the help of
the EDTP access point.
Leaving the
(Air)Drop Zone
char tempstring[] = “EDTP”;
//Your desired SSID here
By leaving the string null (“”
instead of “EDTP”), the first available
BSS will be selected by the TEW-
222CF CompactFlash NIC for association and connection.
E
l
e
c
t
r
o
n
i
c
s
NUTS & VOLTS
F
o
r
E
v
e
r
y
t
h
i
n
g
Now that a wireless communications channel has been established,
the AirDrop-P can communicate with
other Ethernet devices on the wireless LAN and wired LAN segment,
using standard Internet protocols.
The wireless LAN world is very
secretive on the outside; however, you
can use the basic 802.11b driver
code I’ve provided in conjunction
with open source 802.11b Linux
examples from the Internet to gain
enough knowledge (and operational
code) to easily put an AirDrop-P on
your local Ethernet LAN. There’s also
a dedicated Internet user group for
those of you that are interested in
sharing AirDrop-P experiences and
source code. If you’re the least bit
interested in wireless LAN communications with microcontrollers, I highly
suggest monitoring the AirDrop-P
user group’s chatter. NV
To Access the
AirDrop-P User Group
Group name: airdrop_user
Group home page:
http://groups.yahoo.com/group/air
drop_user
Group email address:
airdrop_user@yahoogroups.com
36
APRIL 2005