BL4S200 User’s Manual
154
6.3 Dynamic C Wi-Fi Configurations
Rabbit has implemented a packet driver for the BL5S220 that functions much like an Eth-
ernet driver for the Dynamic C implementation of the TCP/IP protocol stack. In addition
to functioning like an Ethernet packet driver, this driver implements a function call to
access the functions implemented on the 802.11b/g interface, and to mask channels that
are not available in the region where the BL5S220 will be used.
The Wi-Fi interface may be used either at compile time using macro statements or at run
time with the
ifconfig()
function call from the Dynamic C
LIB\Rabbit4000\TCPIP\
NET.LIB
library.
6.3.1 Configuring TCP/IP at Compile Time
Digi International has made it easy for you to set up the parameter configuration using
already-defined
TCPCONFIG
macros from the Dynamic C
LIB\Rabbit4000\TCPIP\
TCP_CONFIG.LIB
library at the beginning of your program as in the example below.
#define TCPCONFIG 1
There are two
TCPCONFIG
macros specifically set up for Wi-Fi applications with the
BL5S220. (
TCPCONFIG 0
is not supported for Wi-Fi applications.)
These default IP address, netmask, nameserver, and gateway network parameters are set
up for the
TCPCONFIG
macros.
#define _PRIMARY_STATIC_IP "10.10.6.100"
#define _PRIMARY_NETMASK "255.255.255.0"
#define MY_NAMESERVER "10.10.6.1"
#define MY_GATEWAY "10.10.6.1"
The use of quotation marks in the examples described in this chapter is important since the
absence of quotation marks will be flagged with warning messages when encrypted librar-
ies are used.
Wi-Fi Parameters
•
Access Point SSID—
IFC_WIFI_SSID
. This is the only mandatory parameter. Define
the
IFC_WIFI_SSID
macro to a string for the SSID of the access point in the infra-
structure (BSS) mode, or the SSID of the ad-hoc network in the ad-hoc (IBSS) mode.
The default is shown below.
#define IFC_WIFI_SSID "rabbitTest"
•
Mode—
IFC_WIFI_MODE
determines the mode:
IFPARAM_WIFI_INFRASTRUCT
for the infrastructure mode, or
IFPARAM_WIFI_ADHOC
for the ad-hoc mode.
The default is shown below.
#define IFC_WIFI_MODE IFPARAM_WIFI_INFRASTRUCT
TCPCONFIG 1
No DHCP
TCPCONFIG 5
DHCP enabled