User Manual

Table Of Contents
7.3. Writing iWRAP Applications
There are two approaches when writing a iWRAP server program (a program accepting incom-
ing calls) for Access Server, both having different pros and cons:
1. Forklistener
2. iWRAP Client
Note: When writing a client program (that is, a program making an outgoing call), you have to use
iWRAP.
7.3.1. Forklistener
This is a standard program reading data from standard input and writing output to standard
output. See the SDK directory examples/forkserver/ for an example of this kind of program.
Pros:
Easy to write.
Very robust for simple services.
You do not have to understand Bluetooth or iWRAP.
Cons:
Your program is started and stopped for every incoming connection.
If there are multiple connections, it is not possible to communicate to an external program
through one socket.
You cannot use stdout for debugging; you must use syslog or a log file.
iWRAP’s advanced features are not available: powermodes, MSC, SDP, inquiry, ...
To setup a forklistener, see the SET command.
7.3.2. iWRAP Client
iWRAP client is a program communicating with the iWRAP server through control and data
sockets. See the SDK directory examples/btserver/ for an example of this kind of program.
Pros:
The cons with forklistener do not apply.
Cons:
More complex than forklistener.
You must have basic knowledge about Bluetooth and iWRAP.
For documentation about iWRAP, read this chapter carefully.
69