BL4S200 User’s Manual
148
Before you compile and run this sample program, check the TCP/IP configuration
parameters, the IP address, and the SSID in the macros, which are reproduced below.
#define TCPCONFIG 1
// #define WIFI_REGION_VERBOSE
#define PING_WHO "10.10.6.1"
#define _PRIMARY_STATIC_IP "10.10.6.170"
#define IFC_WIFI_SSID "rabbitTest"
Now compile and run this sample program. Uncomment the
#define WIFI_REGION_
VERBOSE
macro to display the channel and power limit settings. The Dynamic C
STDIO
window will then display a menu that allows you to complete the configuration of the
user interface.
6.2.4.2 Wi-Fi Operation
•
WIFIDHCPORTSTATIC.C
—demonstrates the runtime selection of a static IP configura-
tion or DHCP. The
SAMPLES\TCPIP\DHCP.C
sample program provides further exam-
ples of using DHCP with your application.
Before you compile and run this sample program, check the TCP/IP configuration
parameters, the IP address, and the SSID in the macros, which are reproduced below.
#define USE_DHCP
#define TCPCONFIG 1
#define _PRIMARY_STATIC_IP "10.10.6.100"
#define IFC_WIFI_SSID "rabbitTest"
Modify the values to match your network. You may also need to modify the values for
MY_GATEWAY
if you are not pinging from the local subnet.
Now press
F9
to compile and run the sample program. When prompted in the Dynamic C
STDIO
window, type 's' for static configuration or 'd' for DHCP.
•
WIFIMULTIPLEAPS.C
—demonstrates changing access points using WEP keys. You
will need two access points to run this sample program. The access points should be
isolated or on separate networks.
The sample program associates the RabbitCore module with the first access point (
AP_0
defined below) with WEP key
KEY0
(defined below). After associating, the sample
program waits for a predefined time period, and then pings the Ethernet address of the
access point (
AP_ADDRESS_0
). The sample program then associates with the second
access point and pings its Ethernet address (
AP_1
,
KEY1
,
AP_ADDRESS_1
), and then
switches back and forth between the two access points.
When changing access points, first bring the
IF_WIFI0
interface down by calling
ifdown(IF_WIFI0)
. Next, change the SSID and key(s) using
ifconfig()
calls.
Finally, bring the
IF_WIFI0
interface back up by calling
ifup(IF_WIFI0)
. Note that
the sample program checks for status while waiting for the interface to come up or
down.
Before you compile and run this sample program, check the TCP/IP configuration
parameters, the IP address, and the SSID in the macros, which are reproduced below.
#define TCPCONFIG 1
#define IFC_WIFI_ENCRYPTION IFPARAM_WIFI_ENCR_WEP
electronic components distributor