BL4S200 User’s Manual
149
You do not need to configure the SSID of your network since that is done from the
access point names.
Now configure the access to the two access points.
// First Access Point
#define AP_0 "test1"
#define AP_0_LEN strlen(AP_0)
#define MY_ADDRESS_0 "10.10.6.250"
// use this static IP when connected to AP 0
#define PING_ADDRESS_0 "10.10.6.1" // address on AP 0 to ping
#define KEY_0 "0123456789abcdef0123456789"
// Second Access Point
#define AP_1 "test2"
#define AP_1_LEN strlen(AP_1)
#define MY_ADDRESS_1 "10.10.0.99"
// use this static IP when connected to AP 1
#define PING_ADDRESS_1 "10.10.0.50"// address on AP 1 to ping
#define KEY_1 "0123456789abcdef0123456789"
#define IFC_WIFI_SSID AP_0
#define _PRIMARY_STATIC_IP MY_ADDRESS_0
Modify the access point names and keys to match your access points and network.
•
WIFIPINGYOU.C
—sends out a series of pings to a RabbitCore module on an ad-hoc
Wi-Fi network.
This sample program uses some predefined macros. The first macro specifies the
default TCP/IP configuration from the Dynamic C
LIB\Rabbit4000\TCPIP\TCP_
CONFIG.LIB
library.
#define TCPCONFIG 1
Use the next macro unchanged as long as you have only one BL5S220. Otherwise use
this macro unchanged for the first BL5S220.
#define NODE 1
Then change the macro to
#define NODE 2
before you compile and run this sample
program on the second BL5S220.
The next macros assign an SSID name and a channel number to the Wi-Fi network.
#define IFC_WIFI_SSID "rab-hoc"
#define IFC_WIFI_OWNCHANNEL "5"
Finally, IP addresses are assigned to the RabbitCore modules.
#define IPADDR_1 "10.10.8.1"
#define IPADDR_2 "10.10.8.2"
As long as you have only one BL5S220, the Dynamic C
STDIO
window will display
the pings sent out by the module. You may set up a Wi-Fi enabled laptop with the IP
address in
IPADDR_2
to get the pings.
If you have two BL5S220 boards, they will ping each other, and the Dynamic C
STDIO
window will display the pings.