BL4S200 User’s Manual
153
•
PINGLED_WPA2_CCMP.C
—This sample program is an extension of
PINGLED.C
. It
demonstrates the use of WPA2 PSK (Wi-Fi Protected Access with Pre-Shared Key).).
WPA is a more secure replacement for WEP. The implementation in the sample pro-
gram uses the Advanced Encryption Standard (AES) based algorithm, also known as
the CCMP (Counter Mode with Cipher Block Chaining Message Authentication Code
Protocol) cypher suite.
Apart from the configuration of
WPA2_CCMP
at the top of the sample program, the rest
of the code is identical to the case without WPA2 PSK. Indeed, most of the TCP/IP
sample programs should work with WPA2 CCMP simply by using the same configura-
tion settings.
Configure your access point for WPA2 PSK before you run this sample program.
Specify the CCMP cypher suite, and enter a suitable pre-shared key. The key may be
entered either as 64 hexadecimal digits or as an ASCII string of up to 63 characters.
TIP:
There is a good chance of typos since the key is long. First, enter the key in this
sample program macro, then copy and paste it to your access point. This ensures that
both the BL5S220 and the access point have the same key.
TIP:
For an initial test, it may be easier to use the 64 hex digit form of the key rather than
the ASCII passphrase. A passphrase requires considerable computation effort, which
delays the startup of the sample program by about 30 seconds.
Now change
PING_WHO
to the address of the host you want to ping.
You may modify the
PING_DELAY
define to change the amount of time (in milliseconds)
between the outgoing pings.
Uncomment the VERBOSE define to see the incoming ping replies.
Finally, compile and run this sample program. LED DS2 will flash when a ping is sent.
LED DS3 will flash when a ping is received.
electronic components distributor