Bluegiga IWIP3G - IWRAP - IPHONE 3G User manual

iWRAP3
User Guide
Version 1.3
Friday, September 26, 2008

2
Copyright © 2000-2008 Bluegiga Technologies
All rights reserved.
Bluegiga Technologies assumes no responsibility for any errors, which may appear in this manual.
Furthermore, Bluegiga Technologies reserves the right to alter the hardware, software, and/or
specifications detailed herein at any time without notice, and does not make any commitment to
update the information contained herein. Bluegiga Technologies’ products are not authorized for use
as critical components in life support devices or systems.
The WRAP is a registered trademark of Bluegiga Technologies
The Bluetooth trademark is owned by the Bluetooth SIG Inc., USA, and is licensed to Bluegiga
Technologies.
All other trademarks listed herein are owned by their respective owners.

3
Contents:
1. Introduction...............................................................................................12
2. Getting Started...........................................................................................14
3. iWRAP Modes .............................................................................................15
3.1 Command Mode ........................................................................................17
3.2 Data Mode................................................................................................17
3.3 Multiplexing Mode......................................................................................18
3.4 HFP mode.................................................................................................18
3.5 OPP mode ................................................................................................18
3.6 A2DP mode ..............................................................................................18
3.7 AVRCP mode.............................................................................................18
4. Technical Details ........................................................................................19
5. iWRAP Command listing .............................................................................21
5.1 Typographical Conventions .........................................................................26
5.2 AT...........................................................................................................27
5.3 INQUIRY ..................................................................................................28
5.4 IC ...........................................................................................................32
5.5 NAME ......................................................................................................34
5.6 PAIR........................................................................................................35
5.7 AUTH.......................................................................................................37
5.8 CALL........................................................................................................39
5.9 CLOSE .....................................................................................................43
5.10 LIST...................................................................................................44
5.11 SELECT ..............................................................................................49
5.12 SDP ...................................................................................................50
5.13 SDP ADD ............................................................................................52
5.14 IDENT ................................................................................................53
5.15 L2CAP ................................................................................................54
5.16 RFCOMM.............................................................................................55
5.17 SCO ENABLE .......................................................................................56

4
5.18 SCO OPEN ..........................................................................................57
5.19 CLOCK................................................................................................59
5.20 KILL...................................................................................................60
5.21 BER ...................................................................................................61
5.22 RSSI ..................................................................................................62
5.23 TXPOWER ...........................................................................................63
5.24 PING ..................................................................................................64
5.25 ECHO .................................................................................................65
5.26 SLEEP ................................................................................................66
5.27 PIO ....................................................................................................67
5.28 VOLUME .............................................................................................69
5.29 TEMP..................................................................................................70
5.30 BATTERY.............................................................................................71
5.31 BYPASSUART.......................................................................................72
5.32 DEFRAG..............................................................................................73
5.33 BCSP_ENABLE .....................................................................................74
5.34 RESET ................................................................................................75
5.35 BOOT .................................................................................................76
5.36 TEST ..................................................................................................77
5.37 TESTMODE..........................................................................................80
5.38 HELP ..................................................................................................81
5.39 INFO ..................................................................................................82
5.40 CONNECT ...........................................................................................84
6. SET.............................................................................................................85
6.2 SET BT BDADDR........................................................................................87
6.3 SET BT NAME............................................................................................88
6.4 SET BT CLASS...........................................................................................89
6.5 SET BT AUTH ............................................................................................90
6.6 SET BT LAP...............................................................................................92
6.7 SET BT PAGEMODE ....................................................................................94
6.8 SET BT PAIR .............................................................................................96

5
6.9 SET BT ROLE ............................................................................................97
6.10 SET BT SNIFF ......................................................................................99
6.11 SET BT POWER .................................................................................. 101
6.12 SET BT IDENT ................................................................................... 103
6.13 SET CONTROL AUTOCALL.................................................................... 105
6.14 SET CONTROL BAUD........................................................................... 108
6.15 SET CONTROL CD .............................................................................. 110
6.16 SET CONTROL CONFIG ....................................................................... 111
6.17 SET CONTROL ECHO........................................................................... 114
6.18 SET CONTROL ESCAPE........................................................................ 115
6.19 SET CONTROL INIT ............................................................................ 117
6.20 SET CONTROL MUX ............................................................................ 118
6.21 SET CONTROL BIND ........................................................................... 122
6.22 SET CONTROL MSC ............................................................................ 124
6.23 SET CONTROL GAIN ........................................................................... 126
6.24 SET CONTROL VREGEN ....................................................................... 127
6.25 SET CONTROL MICBIAS ...................................................................... 129
6.26 SET CONTROL PCM............................................................................. 131
6.27 SET PROFILE ..................................................................................... 132
6.28 SET {link_id} ACTIVE ......................................................................... 134
6.29 SET {link_id} MASTER........................................................................ 135
6.30 SET {link_id} SLAVE .......................................................................... 136
6.31 SET {link_id} SNIFF ........................................................................... 137
6.32 SET {link_id} MSC ............................................................................. 138
6.33 SET {link_id} SELECT......................................................................... 139
7. iWRAP Events...........................................................................................140
7.1 CONNECT............................................................................................... 141
7.2 INQUIRY_PARTIAL................................................................................... 142
7.3 NO CARRIER........................................................................................... 143
7.4 READY ................................................................................................... 144
7.5 NAME .................................................................................................... 145

6
7.6 NAME ERROR.......................................................................................... 146
7.7 PAIR...................................................................................................... 147
7.8 RING ..................................................................................................... 148
7.9 SYNTAX ERROR....................................................................................... 149
7.10 AUTH ............................................................................................... 150
7.11 CLOCK.............................................................................................. 151
7.12 IDENT .............................................................................................. 152
7.13 IDENT ERROR.................................................................................... 153
7.14 BATTERY........................................................................................... 154
7.15 PIO .................................................................................................. 155
7.16 VOLUME ........................................................................................... 156
8. iWRAP Error Messages .............................................................................157
8.1 HCI Errors .............................................................................................. 157
8.2 SDP Errors ............................................................................................. 160
8.3 RFCOMM Errors ....................................................................................... 162
9. General Information.................................................................................164
9.1 Changing Parameters over RS232 with PSTool............................................. 164
9.2 Using BlueTest over RS232 ....................................................................... 165
9.3 Switching to HCI Firmware........................................................................ 166
9.4 Firmware Updates over SPI....................................................................... 167
9.5 Firmware Updates over UART .................................................................... 167
9.6 UART Hardware Flow Control..................................................................... 168
9.7 RS232 Connections Diagram ..................................................................... 169
9.8 Supported Bluetooth Profiles Overview ....................................................... 170
9.9 Power Saving.......................................................................................... 174
9.10 Bluetooth profile UUIDs....................................................................... 175
10. Known Issues...........................................................................................179
11. Troubleshooting .......................................................................................181
12. iWRAP USAGE Examples...........................................................................182
12.1 Serial Port Profile – Slave mode ........................................................... 182
12.2 Serial Port Profile – Master mode.......................................................... 184

7
12.3 Dial-up Networking ............................................................................ 185
12.4 OBEX Object Push Profile Server .......................................................... 186
12.5 Hands-Free Audio Gateway Connection to a Headset Device..................... 188
12.6 Hands-Free connection to a Mobile Phone .............................................. 192
12.7 iWRAP to iWRAP Serial Port Profile + SCO connection.............................. 195
12.8 Wireless IO Replacement .................................................................... 196
12.9 A2DP Sink......................................................................................... 198
12.10 A2DP Source ..................................................................................... 199
12.11 AVRCP Connection ............................................................................. 200
12.12 Human Interface Device (HID) Example ................................................ 202
12.13 Over-the-Air Configuration .................................................................. 206
12.14 Bluetooth Networking with iWRAP and WRAP Access Server ..................... 207
13. Support ....................................................................................................209
14. Related Documentation............................................................................210
15. Contact Information.................................................................................211
List of Tables:
Table 1: iWRAP modes transitions explained.............................................................16
Table 2: Technical details ......................................................................................19
Table 3: Supported generic iWRAP commands ..........................................................22
Table 4: Supported “SET BT” commands..................................................................23
Table 5: Supported link control commands...............................................................24
Table 6: Supported Bluetooth profile commands .......................................................24
Table 7: Supported “SET CONTROL” commands........................................................25
Table 8: Power classes as defined in Bluetooth specification ..................................... 102
Table 9: Multiplexing frame format ....................................................................... 119
Table 10: HCI errors ........................................................................................... 159
Table 11: SDP errors .......................................................................................... 161
Table 12: RFCOMM errors .................................................................................... 163
Table 13: UUIDs and Profiles................................................................................ 178
Table 14: Known issues in iWRAP ......................................................................... 180
Table 15: Supported HFP-AG commands................................................................ 189

8
Table 16: HFP-AG status messages ....................................................................... 190
Table 17: Supported HFP commands ..................................................................... 193
Table 18: HFP-AG status messages ....................................................................... 194
Table 19: Available AVRCP commands................................................................... 201
Table 20: Available HID key codes and mouse events.............................................. 205

9
List of Figures:
Figure 1: iWRAP Stack ..........................................................................................12
Figure 2: iWRAP boot prompt .................................................................................14
Figure 3: Mode transitions .....................................................................................15
Figure 4: Host-iWRAP-Host communication ............................................................ 120
Figure 5: Host-iWRAP-remote device communications.............................................. 120
Figure 6: MSC signal directions............................................................................. 125
Figure 7: RS232 connections................................................................................ 169
Figure 8: SPP slave example ................................................................................ 182
Figure 9: SPP master example.............................................................................. 184
Figure 10: How to open a DUN connection to a mobile phone.................................... 185
Figure 11: Receiving files through OPP .................................................................. 186
Figure 12: Receiving a vCard over OPP .................................................................. 187
Figure 13: iWRAP to headset Hands-Free connection ............................................... 188
Figure 14: HFP connection to a mobile phone ......................................................... 192
Figure 15: Simultaneous SPP and SCO connection between two iWRAP modules.......... 195
Figure 16: Wireless IO replacement connection....................................................... 196
Figure 17: MSC signal directions........................................................................... 197
Figure 18: A2DP sink example.............................................................................. 198
Figure 19: A2DP source example .......................................................................... 199
Figure 20: AVRCP example .................................................................................. 200
Figure 21: HID keyboard example......................................................................... 202
Figure 22: Raw HID keyboard report ..................................................................... 205
Figure 23: Raw HID mouse report......................................................................... 205
Figure 24: Over-the-Air connection example........................................................... 206
Figure 25: Configuration for multiple slaves ........................................................... 208

10
Version history
Version: Author: Comments:
1.0 MSa iWRAP3 official user guide
1.1 MSa Added “SET CONTROL CONFIG”
1.2 MSa iWRAP3 updates
1.3 MSa Added SET {link_id} SELECT
Terms & Abbreviations
Term or Abbreviation: Explanation:
A2DP Advanced Audio Distribution Profile
AIO Analog Input Output
AVRCP Audio/Video Remote Control Profile
BDR Basic Data Rate
Bluetooth Set of technologies providing audio and data transfer over short-
range radio connections
bps Bits per second
CD Carrier Detect
DTR Data Terminal Ready
DUN Dial-Up Networking Profile
EDR Enhanced Data Rate
EIR Enhanced Inquiry Response
GPIO General Purpose Input Output
HCI Host Controller Interface

11
HFP Hands-Free Profile
HFP-AG Hands-Free audio Gateway
HID Human Interface Device
iWRAP Interface for WRAP – a trademark registered by Bluegiga
Technologies
L2CAP The Logical Link Control and Adaptation Layer Protocol
MSC Modem Status Control
OBEX OBject EXchange Protocol
OPP Object Push Profile
RFCOMM Serial cable emulation protocol; element of Bluetooth
SNIFF mode Bluetooth low power mode
SPP Serial Port Profile
UART Universal Asynchronous Receiver Transmitter
UUID Universally Unique Identifier
VM Virtual Machine
WRAP Wireless Remote Access Platform; Bluegiga Technologies’
wireless product family

12
1. INTRODUCTION
iWRAP is an embedded firmware running entirely on the RISC processor of WRAP THOR
modules. It implements the full Bluetooth protocol stack, and many Bluetooth profiles as
well. All software layers, including application software, run on the internal RISC processor
in a protected user software execution environment known as a Virtual Machine (VM).
The host system can interface to iWRAP firmware through one or more physical interfaces,
which are also shown in the figure below. The most common interfacing is done through
the UART interface by using the ASCII commands that iWRAP firmware supports. With
these ASCII commands, the host can access Bluetooth functionality without paying any
attention to the complexity, which lies in the Bluetooth protocol stack. GPIO interface can
be used for event monitoring, command execution and PCM, SPDIF, I2S or analog
interfaces are available for audio. The available interfaces depend on the used hardware.
The user can write application code to the host processor and DSP to control iWRAP
firmware with ASCII commands or GPIO events. In this way, it is easy to develop
Bluetooth enabled applications.
The DSP processor is only available on WT32 Bluetooth module.
Audio I/O
Host I/O
Radio
RAM Baseband MCU
LC
LM
HCI
L2CAP
RFCOMM SDP
iWRAP
Host
PCM / SPDIF / I2S
Bluetooth stack + iWRAP
Physical
hardware
WRAP THOR
Bluetooth module
+
iWRAP firmware
Analog audio
GPIO / AIO
UART
USB
DSP processor
(WT32 only)
cmd&data
channel
Figure 1: iWRAP Stack

13
In the figure above, a WRAP THOR Bluetooth module with iWRAP firmware could be
connected to a host system for example via the UART interface.
1. If the host system has a processor, software can be used to control iWRAP by using
ASCII based commands or GPIO events.
2. If there is no need to control iWRAP, or the host system does not need have a
processor, iWRAP can be configured to be totally transparent and autonomous, in
which case it only accepts connections or automatically opens them.
3. GPIO lines that WRAP THOR modules offer can also be used together with iWRAP to
achieve additional functionality, such as Carrier Detect or DTR signaling.
4. Audio interfaces can be used to transmit audio over a Bluetooth link.

14
2. GETTING STARTED
To start using iWRAP firmware, you can use, for example, terminal software such as
HyperTerminal. When using the terminal software, make sure that the WRAP THOR
module is connected to your PC’s serial port. By default, iWRAP uses the following UART
settings:
Baud rate: 115200bps
Data bits: 8
Stop bits: 1
Parity bit: No parity
HW Flow Control: Enabled
When you power up your WRAP THOR module or evaluation kit, you can see the boot
prompt appear on the screen of the terminal software. After the “READY.” event iWRAP
firmware is ready to be used.
Figure 2: iWRAP boot prompt

15
3. IWRAP MODES
iWRAP has two basic operational modes, command mode and data mode. In command
mode ASCII commands can be given to iWRAP firmware to perform various actions or to
change configuration settings and is the default mode when there are no Bluetooth
connections. Data mode on the other hand is used to transmit and receive data over a
Bluetooth link and it’s only available if there is a Bluetooth connection. It is possible to
switch between modes at any time assuming the conditions for data mode are fulfilled.
The mode transitions are illustrated below.
Figure 3: Mode transitions

16
Initial mode Target mode Requirements for
state transition
Command Mode
(no Bluetooth connections)
In this mode, ASCII commands
can be given to iWRAP.
Data Mode A connection is successfully
created by using the CALL
command and CONNECT event
that indicates a successful
connection is received.
A remote device opens a
Bluetooth connection to iWRAP.
A RING event that indicates a
received connection is received.
Data Mode
In this mode, all data is sent
transparently from UART
interface to Bluetooth
connection.
Command Mode The user switches mode by
sending an escape sequence to
iWRAP firmware or by toggling
the DTR pin.
A link is terminated (closed by
the remote device or by link
loss) and NO CARRIER event is
received.
Command Mode
(active connection)
In this mode, ASCII commands
can be given to iWRAP.
Data Mode User switches the mode either by
sending the escape sequence or
command SELECT command.
Table 1: iWRAP modes transitions explained
The escape sequence:
The escape sequence causes the iWRAP firmware to go to the command mode from the
data mode or vice versa. The escape sequence consists of three (3) escape characters that
are defined by SET CONTROL ESCAPE command. By default the escape character is ‘+’.
Do not enter any character before and/or after the escape sequence for a guard time
which is 1 second. Also send the escape characters individually, not as a string.
With default settings the escape sequence is:
< 1 second sleep> +++ < 1 second sleep>
When a successful state transition from data mode to command mode is made, iWRAP
sends a “READY.” event to indicate that it’s ready to receive commands.
The same escape sequence or the SELECT command can be used to return to data mode.

17
3.1 Command Mode
The command mode is the default mode when iWRAP is powered up. In command mode,
ASCII commands can be entered to iWRAP to perform various functions.
Note:
In command mode if there are active Bluetooth connections, the data from remote
devices is buffered into iWRAP buffers.
Because of the embedded nature of iWRAP, buffering capabilities are low and only
small amounts of data can be received to buffers. The amount of data which can be
buffered depends on the firmware version and the state of iWRAP. Usually, it is
around 1000 bytes, but may vary radically.
LIST command shows active connections, as well the amount of buffered data.
3.2 Data Mode
Data mode is the default mode when there are one or more Bluetooth. In data mode, all
data is sent transparently from UART interface to the Bluetooth link and vice versa.
Note:
When iWRAP enters command mode, a “READY” event occurs, unless events are
masked away with “4SET CONTROL ECHO” command.
DTR pin can be used instead of escape sequence to switch from data mode to
command mode and it allows much faster mode switching so no guard time is
needed. DTR pin can be enabled with “SET CONTROL ESCAPE”command.
The escape character can also be changed by with “SET CONTROL ESCAPE”
command.
Carrier Detect (CD) pin can also be used to indicate either a Bluetooth connection
or data mode. CD pin can be enabled with “SET CONTROL CD” command.

18
3.3 Multiplexing Mode
In iWRAP version 2.1.0 and newer, there is a special mode called multiplexing mode. In
this mode, iWRAP does not have separate commands or data modes, but data, commands
and events are all handled in one single mode. There is, however, a special protocol to
separate commands and events from the actual data. This protocol must be used between
the host system and iWRAP firmware.
The advantage of this multiplexing mode is that several Bluetooth connections can be
handled simultaneously and there is no need to do time consuming data-command-data
mode switching. However the downside is that the performance of iWRAP is reduced, since
the firmware needs to handle the multiplexing protocol and the overhead it causes.
To learn more about multiplexing mode, please see the description of “SET CONTROL
MUX” command.
3.4 HFP mode
iWRAP 2.2.0 and newer support Bluetooth Hands-Free (v.1.5) profile. This profile include a
lot of control messaging and events, which is handled in the command mode i.e. when a
HFP connection is opened or received no state transition occurs, but iWRAP stays in the
command mode, where all HFP messaging is done. Please refer to HFP profile usage for
more information.
3.5 OPP mode
IWRAP 2.1.0 and newer support Bluetooth Object Push Profile (OPP) profile. The operation
is this profile is quite similar to HFP mode i.e. there is no separate command and data
modes, but iWRAP always stays in the command mode. In OPP mode, Please refer to OPP
profile usage for more information.
3.6 A2DP mode
From iWRAP3 on Bluetooth Advanced Audio Distribution Profile (A2DP) is supported. This
profile includes also control messaging and events, which is handled in the command
mode i.e. when a A2DP connection is opened or received no state transition occurs, but
iWRAP stays in the command mode, where all A2DP messaging is done.
3.7 AVRCP mode
From IWRAP3 on Bluetooth Audio/Video Remote Control Profile (AVRCP) is supported. This
profile includes also control messaging and events, which is handled in the command
mode i.e. when a AVRCP connection is opened or received no state transition occurs, but
iWRAP stays in the command mode, where all AVRCP messaging is done.

19
4. TECHNICAL DETAILS
Feature: Value:
MAX simultaneous ACL connections 4
MAX simultaneous SCO connections 1
MAX data rate
600Kbps (WT12/WT11 to BT2.0 USB dongle)
500Kbps (WT12/WT11 to WT12/WT11)
450Kbps (WT12/WT11 to BT1.1-BT1.2 device)
MAX UART baud rate 921600 bps
Typical data transmission delay 10-15ms
Minimum data transmission delay 5-10ms
Typical SCO delay 30-40ms
Typical A2DP delay* 150-200ms
A2DP coding/encoding methods SBC, MP3**, AAC**, APT-x** and FastStream**
PIN code length Configurable from 0 to 16 characters
Encryption length Configurable from 0 to 128** bits
MAX simultaneous pairings 16
MAX Friendly name length Configurable up to 248 characters
RFCOMM Packet size Configurable from 21 to 1008
Supported Bluetooth profiles (iWRAP3) GAP, SPP, Hands-Free Profile (V.1.5), A2DP,
AVRCP, HID, DUN, DI, and OPP***
Supported power saving modes Sniff and deep sleep
Bluetooth QD ID iWRAP 3.0: B014328, iWRAP 2.2.0: B012647
Table 2: Technical details

20
*) Alternative coding methods (APT-x, FastStream) exist to reduce the delay to 40-60ms
***) Limited support
This manual suits for next models
1
Table of contents
Popular Software manuals by other brands

Logitech
Logitech HD 200a Install instructions

Red Hat
Red Hat CERTIFICATE SYSTEM 7.3 - ADMINISTRATION Administration guide

Lexmark
Lexmark MarkVision Professional user guide

COMPRO
COMPRO COMPRODTV user guide

QMS
QMS ImageServer install guide

Red Hat
Red Hat ENTERPRISE LINUX 3 - SECURITY GUIDE System administration guide