Chapter 3 Terminal Specific Function Library
131
3.13.3 Initialization & Termination
After the networking parameters are properly configured, an application program can call
NetInit()
to initialize any wireless module (802.11b or Bluetooth) and networking protocol
stack. The wireless modules will not be powered until
NetInit()
is called.
When an application program needs to stop using the network,
NetClose()
must be called to
shut down the network as well as the modules (so that power can be saved). To enable the
network again,
NetInit()
must be called again.
Note: Any previous network connection and data will be lost after calling NetClose().
NetInit
Purpose
To perform TCP/IP networking initialization.
Syntax
int NetInit (void);
int NetInit (unsigned long mode);
Example
struct NETSTATUS ns;
..............................
if (NetInit() < 0) {
printf ("Initialization Fail");
.................................
}
do {
OSTimeDly (10);
GetNetStatus (&ns);
} while (!ns.IPReady);
Description
This routine initializes the wireless module and TCP/IP networking protocol
stack. The value of
mode
can be one of the following:
WLAN_NETWORKING
0
BLUETOOTH_NETWORKING
1
Reserved
2
BT_GPRS_NETWORKING
3
IR_PPP_NETWORKING
4
RS232_PPP_NETWORKING
5
Some part of the initialization is done in a background system task.
When this routine returns, the initialization process might not yet been done.
Summary of Contents for Optimus R
Page 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Page 6: ......
Page 8: ...2 C Programming Guide For Optimus S R...
Page 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Page 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Page 24: ...18 C Programming Guide For Optimus S R...
Page 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...