User`s manual

62 MiniCore RCM5600W
The data passed to the callback function are ephemeral since another scan may occur.
Thus, the data need to be used (or copied) during the callback function.
While waiting for user input, it is important to keep the network alive by calling
tcp_tick(NULL) regularly.
6.2.5 RCM5600W Sample Programs
The following sample programs are in the Dynamic C SAMPLES\RCM5600W\TCPIP\
folder. The Interface Board must be set up as described in Section 3.2.
PINGLED.C—This program demonstrates ICMP by pinging a remote host. It will pro-
duce a long flash of LED DS1 on the Interface Board when a ping is sent, and a short
flash when a ping is received.
Before you compile and run this sample program, change PING_WHO and IFC_WIFI_
SSID
to the host and SSID you want to ping. You may modify PING_DELAY to change
the amount of time in milliseconds between the outgoing pings.
Uncomment the VERBOSE define to see the incoming ping replies.
PINGLED_WPA_PSK.C—This program demonstrates the use of WPA PSK (Wi-Fi
Protected Access with Pre-Shared Key). WPA is a more secure replacement for WEP.
The implementation in the sample program supports use of the TKIP (Temporal Key
Integrity Protocol) cypher suite.
The sample program uses macros to configure the access point for WPA PSK, specify
the TKIP cypher suite, assign the access point SSID, and set the passphrase.
#define WIFI_USE_WPA // Bring in WPA support
#define IFC_WIFI_ENCRYPTION IFPARAM_WIFI_ENCR_TKIP // Define cypher suite
#define IFC_WIFI_SSID "rabbitTest"
The next macro specifies a suitable pre-shared key to use instead of the passphrase. The
key may be entered either as 64 hexadecimal digits or as an ASCII string of up to 63
characters. Authentication should be set to “open system,” which basically means that
knowing the key is sufficient to allow access.
#define IFC_WIFI_WPA_PSK_HEXSTR \
"1010101010101010101010101010101010101010101010101010101010101010"
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 RCM5600W 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.
Change PING_WHO and IFC_WIFI_SSID to the host and SSID you want to ping. You
may modify PING_DELAY to change the amount of time in milliseconds between the
outgoing pings.
Uncomment the VERBOSE define to see the incoming ping replies.