Download: | ![u blox Malmo 090202S Serial Port Adapter User Manual Part 2](/pdf.png) |
Mirror Download [FCC.gov] | ![u blox Malmo 090202S Serial Port Adapter User Manual Part 2](/pdf.png) |
Document ID | 606950 |
Application ID | 0U0usZyaRAWj40dz8YJc1Q== |
Document Description | Users Manual Part 2 |
Short Term Confidential | No |
Permanent Confidential | No |
Supercede | No |
Document Type | User Manual |
Display Format | Adobe Acrobat PDF - pdf |
Filesize | 30.97kB (387083 bits) |
Date Submitted | 2005-11-30 00:00:00 |
Date Available | 2005-11-30 00:00:00 |
Creation Date | 2005-10-12 11:58:01 |
Producing Software | Acrobat Distiller 4.05 for Windows |
Document Lastmod | 2005-10-12 11:58:01 |
Document Title | Users Manual Part 2 |
INDUSTRIAL BLUETOOTH™
Serial Port Adapter™
Version 2 and 3
AT Commands
Serial Port Adapter™
Version 2 and 3
AT Commands
Copyright © 2003 connectBlue AB.
The contents of this document can be changed by connectBlue AB without prior
notice and do not constitute any binding undertakings from connectBlue AB. connectBlue AB is not responsible under any circumstances for direct, indirect, unexpected damage or consequent damage that is caused by this document.
All rights reserved.
Release: 0510
Document version: 3.2
Document number: cBProject-0501-11 (8)
Printed in Sweden.
Trademarks
The BLUETOOTH trademarks are owned by their proprietor and used by connectBlue under license.
Third party brands and names are the property of their respective owners.
iii
Contents
1. Introduction
1.1
Related Documents ........................................................................... 8
2. Data Mode and AT Mode
3. Baud Rate
10
4. Configuration and Operation
11
4.1
4.2
4.3
4.4
4.5
4.6
4.7
LED Indication ................................................................................. 11
Bluetooth Settings............................................................................ 11
Searching for Other Bluetooth Devices ........................................... 12
Searching for Services..................................................................... 12
Creating Serial Connections and Sending Data .............................. 12
How to Select What Profile to Use .............................................. 12
Client or Server............................................................................ 12
Wireless Multidrop™ ................................................................... 12
Connection Establishment – Server ............................................ 13
Connection Establishment – Client.............................................. 13
Master/Slave Handling..................................................................... 13
Bluetooth Security............................................................................ 14
Security Modes ............................................................................ 14
Bonding and Pairing .................................................................... 15
5. Power Save Modes
5.1
16
How to Use the Stop Mode Feature ................................................ 16
6. Restoring Default Configuration
6.1
6.2
17
Serial Settings.................................................................................. 17
Factory Settings............................................................................... 17
7. AT Commands Over Bluetooth
18
8. Optimization
19
9. Version 3 vs. Version 2
20
10. Syntax
21
10.1
10.2
Command Line Format .................................................................... 21
Data Types ...................................................................................... 21
String 22
Integer 22
Enumerator .................................................................................. 22
Bd_Addr....................................................................................... 22
Introduction
11. AT Commands Reference
11.1
11.2
11.3
11.4
11.5
11.6
23
Standard AT Commands ................................................................. 23
Command “AT” ............................................................................ 23
Command “AT*”........................................................................... 23
Command “ATZ”.......................................................................... 23
Command “AT&F” ....................................................................... 24
Command “ATS2”........................................................................ 24
Command “ATE”.......................................................................... 24
GAP Commands.............................................................................. 25
Read_Discoverability_Mode (AT*AGDM?) ................................. 25
Write_Discoverability_Mode (AT*AGDM=) ................................. 25
Read_Connectability_Mode (AT*AGCM?) .................................. 26
Write_Connectability_Mode (AT*AGCM=) .................................. 26
Read_Pairing_Mode (AT*AGPM?).............................................. 27
Write_Pairing_Mode (AT*AGPM=).............................................. 27
Read_Security_Mode (AT*AGSM?)............................................ 28
Write_Security_Mode (AT*AGSM=)............................................ 28
Name_Discovery (AT*AGND=) ................................................... 28
Device_Discovery (AT*AGDD=).................................................. 29
Inquiry (AT*AGI=) ........................................................................ 30
Bond (AT*AGB=) ......................................................................... 31
Un_Bond (AT*AGUB=)................................................................ 31
Read_Bonded_Devices (AT*AGBD?) ......................................... 32
Read_Fixed_PIN (AT*AGFP?).................................................... 32
Write_Fixed_PIN (AT*AGFP=).................................................... 33
Read_Local_Name (AT*AGLN?) ................................................ 33
Write_Local_Name (AT*AGLN=) ................................................ 33
Read_Local_COD (AT*AGLC?) .................................................. 34
Write_Local_COD (AT*AGLC=) .................................................. 35
Get_MasterSlaveRole (AT*AGGMSR=)...................................... 36
Change_MasterSlaveRole (AT*AGCMSR=) ............................... 36
Read_MasterSlaveRole_Policy (AT*AGMSP?) .......................... 37
Write_MasterSlaveRole_Policy (AT*AGMSP=) .......................... 37
Get_RSSI (AT*AGRSS=) ............................................................ 38
Service Search Commands............................................................. 39
Service_Search (AT*ARSS=)...................................................... 39
Data Mode Commands.................................................................... 40
Data_Mode (AT*ADDM) .............................................................. 40
Connect_To_Serial_Service_Data_Mode (AT*ADCP=) ............. 41
Close_Serial_Connection_Data_Mode (AT*ADCC=) ................. 42
Read_Default_Client_Profile (AT*ADDCP?) ............................... 42
Write_Default_Client_Profile (AT*ADDCP=) ............................... 42
Read_Default_Server_Profile (AT*ADDSP?).............................. 43
Write_Default_Server_Profile (AT*ADDSP=).............................. 43
Read_Max_No_Of_Remote_Peers (AT*ADMRP?) .................... 44
Read_No_Of_Remote_Peers (AT*ADNRP?) ............................. 45
Write_No_Of_Remote_Peers (AT*ADNRP=) ............................. 45
Read_Default_Remote_Peer (AT*ADRDRP=) ........................... 45
Write_Default_Remote_Peer (AT*ADWDRP=)........................... 46
Read_Inactivity_Tick (AT*ADIT?)................................................ 47
Write_Inactivity_Tick (AT*ADIT=)................................................ 48
Read_Wireless_Multidrop_Configuration (AT*ADWM?)............. 48
Write_Wireless_Multidrop_Configuration (AT*ADWM=)............. 49
Informational Commands ................................................................ 50
Read_Local_BD_ADDR (AT*AILBA?) ........................................ 50
Read_Local_Version_Information (AT*AILVI?)........................... 50
Miscellaneous Commands .............................................................. 51
Read_RS232_Settings (AT*AMRS?) .......................................... 51
Contents
11.7
12. Model Compatibility
Write_RS232_Settings (AT*AMRS=) .......................................... 52
Read_Serial_Interface_Type (AT*AMSIT?) ................................ 52
Write_Serial_Interface_Type (AT*AMSIT=) ................................ 53
Read_Favorites (AT*ACF?)......................................................... 53
Add_Change_Favorite (AT*ACACF=)......................................... 54
Delete_Favorite (AT*ACDF=) ...................................................... 54
Read_Allow_Configuration_Over_Bluetooth (AT*ACCB?) ......... 55
Write_Allow_Configuration_Over_Bluetooth (AT*ACCB=) ......... 55
Read_Controller_Power_Save_Mode (AT*AMPM?)................... 56
Write_Controller_Power_Save_Mode (AT*AMPM=)................... 56
Read_Max_Output_Power (AT*AMMP?) .................................... 57
Write_Max_Output_Power (AT*AMMP=) .................................... 57
Read_Esc_Sequence_Timing (AT*AMET?) ............................... 58
Write_Esc_Sequence_Timing (AT*AMET=)................................ 59
Read_Button_Operation_Mode (AT*AMBOR=) .......................... 59
Write_Button_Operation_Mode (AT*AMBO=)............................. 60
Read_LED_Operation_Mode (AT*AMLO?) ................................ 60
Write_LED_Operation_Mode (AT*AMLO=)................................. 61
Store_Factory_Settings (AT*AMSF)............................................ 61
Read_Watchdog_Settings (AT*AMWS?) .................................... 62
Write_Watchdog_Settings (AT*AMWS=) .................................... 63
Read_DTR_DSR_Settings (AT*AMDS?) .................................... 63
Write_DTR_DSR_Settings (AT*AMDS=) .................................... 64
Read_Link_Policy (AT*AMLP?)................................................... 65
Write_Link_Policy (AT*AMLP=)................................................... 65
Events
67
Serial_Connection_Data_Mode_Closed (*ADCCO) ................... 67
68
Introduction
Chapter 1: Introduction
1.1: Related Documents
Chapter 1
Introduction
1.1
Related Documents
•
The Serial Port Adapter AT Commands document, this document, contains a description of the AT commands supported in the Serial Port
Adapter. It also contains information on how to use the AT commands to
create Bluetooth applications.
•
The OEM Serial Port Adapter Electrical & Mechanical Datasheet contains important information about the OEM Serial Port Adapter. Read this
document if you are using the OEM Serial Port Adapter.
1.1: Related Documents
Chapter 2: Data Mode and AT Mode
Chapter 2
Data Mode and AT Mode
The Serial Port Adapter can be in two different modes AT mode and data mode1.
The Serial Port Adapter starts up in data mode and can be requested to move to
AT mode by sending an escape sequence. The default escape sequence consists of
three consecutive forward slash characters ‘/’. The escape sequence character can
be changed using the ATS2 command. Pressing the restore-button on the Serial
Port Adapter, when it is powered up, restores the default escape character.
The following criteria must be met for the Serial Port Adapter to interpret the sequence as a valid escape sequence:
•
Before the escape sequence there must be silence for 1 second. This time can
be changed using the AT*AMET command.
•
After the escape sequence there must be silence for 1 second. This time can be
changed using the AT*AMET command.
•
The entire escape sequence must be sent within 200 ms.
To move from AT mode to data mode, use the “AT*ADDM” command.
Transparent
data mode
AT*ADDM
AT mode
AT escape
sequence
Some serial port adapter models also support the ECI mode, which is not covered in this document.
1.1: Related Documents
Chapter 3: Baud Rate
Chapter 3
Baud Rate
The Serial Port Adapter does not support auto baud rate. The baud rate is set using
the “Write_RS232_Settings” command.
The default RS232 settings are 57600 bits/s, 8 data bits, no parity, 1 stop bit, and
hardware flow control. Pressing the restore-button on the Serial Port Adapter,
when it is powered up, restores the default serial settings.
10
Chapter 4: Configuration and Operation
4.1: LED Indication
Chapter 4
Configuration and Operation
This chapter gives some guidelines on how to perform basic configuration and operation.
There are several request packets that can be used to configure the Serial Port
Adapter. Many of these request packets take a boolean parameter called
. If this parameter is set to 1 the setting will be applied immediately and also when the Serial Port Adapter starts up in the next
power cycle. If this parameter is set to 0 the setting will be applied immediately but
it will not be applied when the Serial Port Adapter starts up in the next power cycle.
Note that for some of the version 3 modules there is a constraint on some AT
commands, which means that the module must be restarted for the command to
take affect. For those commands the parameter must
always be 1.
Note that for applications that always configure the serial port adapter at startup,
it is not necessary to store settings in the startup database. It is intended for applications where the serial port adapter is configured once before installation.
4.1
LED Indication
The LED indicates what mode is currently active and what activity that is currently
in progress.
The following color indications are used.
•
Green: The current mode is data mode and no connection attempt is in progress.
•
Orange: The current mode is AT mode.
•
Purple: A connection attempt is in progress.
•
Blue: A connection is currently active.
•
Blue Blinking: A connection is active and data is transmitted or received over
air.
•
Red Blinking: Buffer overflow, parity or framing error detected on the UART.
4.2
Bluetooth Settings
A Bluetooth device can be in several different operation modes. The operation
mode determines whether or not a device can be connected to and whether or
not other devices performing searches can discover a device. Use the
“Write_Discoverability_Mode” and “Write_Connectability_Mode” commands to
set the operation mode.
All Bluetooth devices have a user-friendly name. Use the “Write_Local_Name”
command to set the local device name.
11
4.3: Searching for Other Bluetooth Devices
Chapter 4: Configuration and Operation
All Bluetooth devices have a ‘class-of-device’ indicator that can be discovered by
other devices when they are performing searches. Use the “Write_Local_COD”
command to set the ‘class-of-device’.
4.3
Searching for Other Bluetooth Devices
Two commands are available to search for other devices:
•
The “Inquiry” command returns the Bluetooth device address and the
class of device of all the devices in the vicinity that are in discoverable
mode.
•
The “Device Discovery” command returns the Bluetooth device address,
the class of device and the name of all the devices in the vicinity that are in
discoverable mode.
The “Inquiry” command is faster than the “Device_Discovery” command. A “Device_Discovery” is an “Inquiry” followed by a “Name_Discovery” on each found
device.
4.4
Searching for Services
It is possible to search for services on remote devices. A service search is performed
using the “Service_Search” command.
4.5 Creating Serial Connections and Sending Data
Serial connections are Bluetooth connections based on the Serial Port Profile, the
Dial-up Networking Profile and the LAN Access Profile2.
How to Select What Profile to Use
It is important that the same profile is used on both devices wanting to communicate. If the remote device is not a Serial Port Adapter, refer to the documentation
of that device to determine what profile it uses or to find out how to select what
profile to use.
Client or Server
First decide if your device is supposed to act as a client (initiator of connections), a
server (acceptor of connections) or both.
Wireless Multidrop™
The Wireless Multidrop™ feature allows the Serial Port Adapter to simultaneously
communicate with several devices even when it is in data mode. If Wireless Multidrop™ is used all data sent to the Serial Port Adapter via the serial interface will
be forwarded to all connected devices. All data received from any of the connected devices will be forwarded on the serial interface in the order that the data
was received.
The Wireless Multidrop™ feature can be used if the Serial Port Adapter has been
configured as a server as well as if it has been configured as a client. When configured as a server several devices are able to connect to your Serial Port Adapter and
Only supported in version 2 of the serial port adapter models.
12
4.6: Master/Slave Handling
Chapter 4: Configuration and Operation
join the wireless multidrop network. If configured as a client you must tell the Serial Port Adapter which devices to connect to.
Exactly how to configure for Wireless Multidrop™ see Connection Establishment –
Server and Connection Establishment – Client.
Connection Establishment – Server
In AT mode, use the “Write_Default_Server_Profile” command to select what profile to use when acting as a server.
If you want to use the Wireless Multidrop™ feature and allow several devices to
simultaneously connect to your device you must enable Wireless Multidrop™ using
the “Write_Wireless_Multidrop_Configuration” command. In addition, the Serial
Port Adapter must be configured to perform a master/slave switch every time a device connects to it. This is done using the “Write_MasterSlaveRole_Policy” command.
After configuring the Serial Port Adapter for server operation, move to data mode.
Connection Establishment – Client
For clients there are two methods that can be used to create connections to a remote device:
1. Establish the connection in AT mode using the “Connect_To_Serial_Service_Data_Mode” command. Then move to data mode and
utilize the connection as a transparent data mode connection. It is possible to
utilize the Wireless Multidrop™ feature and connect to several devices. Note
that Wireless Multidrop™ must be enabled to be able to connect to more than
one device.
2. Configure the Serial Port Adapter in AT mode then move to data mode.
a.
Select the number of devices to connect to using the
“Write_No_Of_Remote_Peers” command. Select 1 for point-to-point
operation and more than 1 for Wireless Multidrop™ operation. Note
that Wireless Multidrop™ must be enabled to be able to use a value
higher than 1. The maximum number of remote peers can be determined by calling the “Read_Max_No_Of_Remote_Peers” command.
b. Select what device(s) to communicate with using the
“Write_Default_Remote_Peer” command.
c.
Then use the “Write_Default_Client_Profile” command to select what
profile to use when connecting to the selected default remote peer.
d. Finally move to data mode and send data. The Serial Port Adapter will
connect to the selected remote peer(s) using the selected profile according to the connect scheme setting (connect on data, always connected or connect on external signal).
Specify zero number of remote peers using the “Write_No_Of_Remote_Peers”
command if you do not want to act as a client.
4.6
Master/Slave Handling
When a device communicates with several other devices it is called the master. The
other devices are called slaves.
13
4.7: Bluetooth Security
Chapter 4: Configuration and Operation
A master can:
•
Setup a connection to another device.
•
Perform searches.
•
Accept connections from other devices.
A slave cannot:
•
Connect to another device.
•
Perform searches.
•
Accept connections from other devices.
There are a few settings and parameters that affect how the roles master and slave
are assigned to the devices communicating.
First, it is possible for a device to request to become the master when another device connects to it. This setting is called the master/slave role policy. Use the
“Write_MasterSlaveRole_Policy” command to set the policy to either:
•
0, the device will request to become the master every time another device
tries to connect.
•
1, the device will become the slave every time another device tries to connect.
Second, when connecting to another device using the “Connect_To_Serial_Service” command the parameter indicates
whether or not the connecting device allows the server to become the master of
the connection.
NOTE: If is 1 and the server has set master/slave role policy to 0
(become master) the connection will not be established.
If you do not specifically need to become the master the parameter should be set to 0 to allow the server to select which role to take.
4.7
Bluetooth Security
Bluetooth has support for security. The Bluetooth security is based on authentication during connection establishment and encryption of sent and received data.
Security Modes
A Bluetooth device can be in two different security modes, security enabled (authentication and encryption turned on) and security disabled (authentication and
encryption turned off). If at least one of the two devices wanting to communicate
has security enabled, security will be used. Use the “Write_Security_Mode” command to set the security mode for the device.
Only the highest security level, security level 3 (link level security) and not security
level 2 (service level), is supported.
14
4.7: Bluetooth Security
Chapter 4: Configuration and Operation
Bonding and Pairing
To be able to communicate if security has been enabled, bonding has to be performed. The bonding procedure creates a link key, valid between two devices,
which is used during the authentication procedure. Once bonded the two devices
can establish connections with each other using security enabled.
During bonding both devices must be in pairable mode (able to accept bonding).
Use the “Write_Pairing_Mode” command to set the device(s) in pairable mode.
During bonding a pin code is used. Use the “Write_Fixed_PIN” command to set
the PIN code to use.
To perform bonding use one of the following methods:
•
Create a connection. If authentication or encryption is turned on, on either device, bonding will be performed automatically.
•
On one device use the “Bond” command. Not supported in all versions of
the serial port adapter.
It is possible for the Serial Port Adapter to store link keys for several devices at the
same time. Use the “Read_Bonded_Devices” command to get a list of the currently bonded devices.
It is also possible to remove a device from the list of bonded devices. To do this,
use the “Un_Bond” command.
15
5.1: How to Use the Stop Mode Feature
Chapter 5: Power Save Modes
Chapter 5
Power Save Modes
The Serial Port Adapter is optimized to consume as little power as possible.
However, the deepest power save mode, called stop mode, is not turned on by default. Instead an AT command (AT*AMPM) is available to allow the host system to
turn on the stop mode feature.
When the Serial Port Adapter is in stop mode:
•
It can accept incoming connections over Bluetooth.
•
The host system cannot send data to the Serial Port Adapter.
The Serial Port Adapter will only enter stop mode if:
•
The stop mode feature has been turned on using the AT*AMPM AT
command
•
The DSR pin on the Serial Port Adapter is not active.
•
If there is no Bluetooth connection.
•
If the "Always connected" feature has not been turned on.
The Serial Port Adapter will exit mode if:
•
A Bluetooth connection is established from a remote device.
•
The host system moves the DSR pin from non-active to active.
Note: The Serial Port Adapter needs 10 ms to leave stop mode. As a consequence the host system must not send data to the Serial Port Adapter
until 10 ms after the host system has activated the DSR pin.
5.1
How to Use the Stop Mode Feature
If your device only acts as a server (accepts incoming connections), the stop mode
feature can be used without the host having to toggle the DSR pin before sending
data to the Serial Port Adapter. The reason for this is that while in stop mode, the
Serial Port Adapter can accept incoming connections. In addition, when the Bluetooth connection is established the Serial Port Adapter automatically leaves stop
mode and only returns to stop mode after the Bluetooth connection has been disconnected. However, in this scenario, it is important that the host system keeps
the DSR pin in the non-active state at all times. Otherwise the Serial Port Adapter
will not enter stop mode at all.
If your device acts as a client (establishes connections) or client and server, the stop
mode feature cannot be used without the use of the DSR pin. The reason for this is
that once in stop mode, the Serial Port Adapter has to be told to leave stop mode
before the host system can send data to the Serial Port Adapter. When the host
system has nothing to send to the Serial Port Adapter, it may set the DSR pin to
the non-active state to tell the Serial Port Adapter that it may enter stop mode if it
is able to.
16
6.1: Serial Settings
Chapter 6: Restoring Default Configuration
Chapter 6
Restoring Default Configuration
6.1
Serial Settings
In some situations it is necessary to restore some settings to their default values.
The following settings can be restored using the procedure described below:
•
Serial settings: 57600 baud, 8 data bits, no parity, 1 stop bit, hardware flow
control.
•
Serial interface type: RS232.
•
AT escape sequence: ‘///’.
•
Escape sequence timing: 1000 ms of no data transmission required before
and after the escape sequence for the escape sequence to be valid.
Procedure:
1. Remove power from the Serial Port Adapter.
2. Press and hold the default settings button on the Serial Port Adapter.
3. Apply power to the Serial Port Adapter.
When powered up the default settings will be stored in the Serial Port Adapter.
6.2
Factory Settings
The factory setting is the configuration of the serial port adapter when it is produced. For some modules it may be possible to set a new factory setting configuration by using the “Store_Factory_Settings” command.
To restore the factory setting configuration use the “AT&F” command or perform
the following procedure. The latter only applies to version 3 Serial Port Adapters.
1. Remove power from the OEM Serial Port Adapter.
2. Press and hold both the Default settings and Function buttons on the OEM Serial Port Adapter.
4. Apply power to the OEM Serial Port Adapter.
Note that this command should not be used at every startup to restore the factory
settings. Instead it is better not to write to the startup database at all.
17
6.2: Factory Settings
Chapter 7: AT Commands Over Bluetooth
Chapter 7
AT Commands Over Bluetooth
It is possible to configure and control a remote Serial Port Adapter via Bluetooth
using AT commands.
Criteria for using AT commands over Bluetooth:
18
•
A Bluetooth connection to the remote device (the device to configure) must exist. The Bluetooth connection can e.g. be established using another Serial Port
Adapter, a device with a PC-card/compact flash or a device with embedded
Bluetooth support.
•
The remote Serial Port Adapter must have turned on the support for configuration over Bluetooth, for more information see the
“Write_Allow_Configuration_Over_Bluetooth” command.
•
Once the connection has been established, the escape sequence must be sent
over the Bluetooth connection to the remote Serial Port Adapter to move it
into AT mode.
o The same escape sequence rules apply to AT over Bluetooth as for AT
over cable, for more information see the section about Data Mode and
AT Mode.
o Note that the same escape sequence is used for cable and Bluetooth.
Therefore, if you are using two Serial Port Adapters one of the Serial
Port Adapters must have its escape sequence changed using the ATS2
command. This is to keep the first Serial Port Adapter to enter AT
mode instead of the remote Serial Port Adapter.
6.2: Factory Settings
Chapter 8: Optimization
Chapter 8
Optimization
On some versions of the serial port adapter there are some limited optimization
support regarding throughput, response time and power consumption.
Typically consider the following settings for the “Write_Link_Policy” command:
•
High throughput: Link policy 1 and 2 depending on which side is transmitting and receiving. Note that this will only be useful to improve performance in one direction.
•
Short Response times: Link policy 3. Note that this will increase power
consumption. Link policy 4 may also be an option.
•
Low Power Consumption: Link policy 6-8. A longer sniff period will decrease power consumption more but provide longer response times. To
get even better results combine link policy 6-8 with stop mode.
Note that there is no guarantee that the configuration will improve performance
for a specific case. There may, for example, be some negotiation with the remote
device that forces some other parameters than the selected ones.
For best interoperability it is recommended to use the default link policy. For other
configurations make sure to test the specific application.
19
6.2: Factory Settings
Chapter 9: Version 3 vs. Version 2
Chapter 9
Version 3 vs. Version 2
If you are migrating from using the version 2 (second generation) of Serial Port
Adapters from connectBlue to version 3 there are some AT commands/events that
have been changed, added or removed. Each AT command description will include
a table to clarify what the differences are (if any) between different models.
Specifically some version 3 models (cB-OEMSPA311, cB-OEMSPA331, cBOEMSPA312, cB-OEMSPA332) do not support multipoint connections. Hence wireless multidrop is not supported.
20
10.1: Command Line Format
Chapter 10: Syntax
Chapter 10
Syntax
10.1 Command Line Format
Each command line sent from the DTE to the DCE is made up of a prefix, body and
terminator. As prefix for the Serial Port Adapter AT commands, only “AT” (ASCII
065, 084) and “at” (ASCII 097, 116) can be used. There is no distinction between
upper and lower case characters. The body is a string of characters in the range
ASCII 032-255. Control characters other than (carriage return; ASCII 013)
and (back space; ASCII 008) in a command line are ignored. The terminator
is .
Commands denoted with a “*” character are extended AT commands, i.e. Serial
Port Adapter specific AT commands.
S-registers are not used and not supported, except for the S2 register.
Multiple commands in the same command line are not supported. Each command
has to be terminated by a before a new command can be sent. A command
must not be larger than 300 characters.
A command can either be:
•
Read commands without parameters:
AT?
•
Write commands without parameters:
AT
•
Read and write commands with parameters:
AT=, parameter2>, …
Responses are sent back to the host and can be any of the following:
•
Successful final message:
OK
•
Successful intermediate/final message with parameters follows an OK message
in some commands. In these cases the OK message works as a confirm message only.
:, parameter2>, …
•
Error message:
ERROR
10.2 Data Types
The definition of each command specifies the data types used for values associated
with the command.
There are four data types:
•
String
•
Integer
•
Enumerator
•
Bluetooth Device Address
21
10.2: Data Types
Chapter 10: Syntax
String
A string shall consist of a sequence of displayable characters from the ISO 8859-1
(8-bit ASCII) character set, except for characters “\” and “"“ and characters below
32 (space). A string constant shall be delimited by two double-qoute (“"“) characters, e.g. “Donald Duck”. If the double-quote character (“"“) is to be used within
a string, e.g. "My friend "Bono" is a singer", they have to be represented as
“\22”. If the back-slash character (“\”) is to be used within a string constant, it has
to be represented as “\5C”. An empty string is represented by two adjacent delimiters, "".
Integer
An integer value consists of a sequence of characters all in the range {0..9}.
Numeric constants are expressed in decimal format only.
Enumerator
An enumerator value is actually an integer, where all its possible values are specified in each case. Only the defined values are accepted for the command in question.
Bd_Addr
This type is used to represent the Bluetooth Device Address. The type is composed
of six fields, each representing a hexadecimal value using two characters. For example, the Bluetooth Device Address 0x112233AABBCC is represented as
112233AABBCC or 112233aabbcc. Note that the Bluetooth Device Address is not
delimited with by two double-qoute (“"“) characters.
22
11.1: Standard AT Commands
Chapter 11: AT Commands Reference
Chapter 11
AT Commands Reference
11.1 Standard AT Commands
Command “AT”
AT Command
Description
AT
Attention command determining the presence of a DCE, i.e. the
Serial Port Adapter.
Responses
Description
OK
Successful response.
ERROR
Error response.
Command “AT*”
AT Command
Description
AT*
Lists the supported AT commands.
Responses
Description
This response is sent to the host for every supported command.
OK
Successful response.
ERROR
Error response.
Command “ATZ”
AT Command
Description
ATZ
Does nothing.
Responses
Description
OK
Successful response.
ERROR
Error response.
Model
Constraint
cB-OEMSPA311
Not supported.
23
11.1: Standard AT Commands
Chapter 11: AT Commands Reference
cB-OEMSPA331
cB-OEMSPA312
cB-OEMSPA332
Command “AT&F”
AT Command
Description
AT&F
If the command Store_Factory_Settings has been used to fill the
factory settings database then this command will restore all the
settings to the factory settings.
If the command Store_Factory_Settings has not been used to fill
the factory settings database then this command will do nothing.
Note that this command should not be used at every startup to
restore the factory settings. Instead it is better not to write to the
startup database at all.
Responses
Description
OK
Successful response.
ERROR
Error response.
Model
Constraint
cB-OEMSPA311
cB-OEMSPA331
cB-OEMSPA312
cB-OEMSPA332
The Store_Factory_Settings are not available. Instead, the
command will restore production settings. After the AT&F command has been sent, the module must be reset for the restored
settings to take affect.
Command “ATS2”
AT Command
Description
ATS2=
Changes the escape character to esc_char.
Command Parameters
Type
Description
esc_char
integer
esc_char is the ASCII value of the new escape
character. E.g. 47 equals ‘/’. The default value is
‘/’.
Note that the escape sequence will be “///”.
Hence, the character is used three times.
Responses
Description
OK
Successful response.
ERROR
Error response.
Command “ATE”
24
AT Command
Description
ATE
Set whether or not the Serial Port Adapter shall echo incoming
11.2: GAP Commands
Chapter 11: AT Commands Reference
characters.
Command Parameters
Type
Description
echo
integer
0: Incoming characters will not be echoed.
1: Incoming characters will be echoed.
Responses
Description
OK
Successful response.
ERROR
Error response.
11.2 GAP Commands
Read_Discoverability_Mode (AT*AGDM?)
AT Command
Description
AT*AGDM?
This command reads the current GAP discoverability mode.
Responses
Description
*AGDM:OK
Successful response.
ERROR
Error response.
Response Parameters
Type
Value
discoverability_mode
enumerator
1: GAP non-discoverable mode
2: GAP limited discoverable mode
3: GAP general discoverable mode
(default value)
Write_Discoverability_Mode (AT*AGDM=)
AT Command
Description
AT*AGDM=,
This command writes the current GAP discoverability
mode.
Command Parameters
Type
Value
discoverability_mode
enumerator
1: GAP non-discoverable mode
2: GAP limited discoverable mode
3: GAP general discoverable mode
(default value)
25
11.2: GAP Commands
Chapter 11: AT Commands Reference
store_in_startup_database
enumerator
0: The setting will only be valid for the
current power cycle.
1: The Serial Port Adapter will remember
the setting between power cycles. The
settings database in the Serial Port
Adapter will be updated.
Responses
Description
OK
Successful response.
ERROR
Error response.
Model
Constraint
cB-OEMSPA311
cB-OEMSPA331
cB-OEMSPA312
cB-OEMSPA332
Limited discoverability mode not supported.
Read_Connectability_Mode (AT*AGCM?)
AT Command
Description
AT*AGCM?
This command reads the current GAP connectability
mode.
Responses
Description
*AGCM:OK
Successful response.
ERROR
Error response.
Result Parameters
Type
Value
connectablilty_mode
enumerator
1: GAP non-connectable mode
2: GAP connectable mode (default value)
Write_Connectability_Mode (AT*AGCM=)
26
AT Command
Description
AT*AGCM=,
Writes the GAP connectability mode.
Command Parameters
Type
Value
connectablilty_mode
enumerator
1: GAP non-connectable mode
2: GAP connectable mode (default value)
11.2: GAP Commands
Chapter 11: AT Commands Reference
store_in_startup_database
enumerator
0: The setting will only be valid for the current
power cycle.
1: The Serial Port Adapter will remember the
setting between power cycles. The settings
database in the Serial Port Adapter will be
updated.
Responses
Description
OK
Successful response.
ERROR
Error response.
Read_Pairing_Mode (AT*AGPM?)
AT Command
Description
AT*AGPM?
Reads the pairing mode.
Responses
Description
*AGPM:OK
Successful response.
ERROR
Error response.
Result Parameters
Type
Value
pairing_mode
enumerator
1: GAP non-pairing mode
2: GAP pairing mode (default value)
Write_Pairing_Mode (AT*AGPM=)
AT Command
Description
AT*AGPM=,
Writes the GAP pairing
mode.
Command Parameters
Type
Value
pairing_mode
enumerator
1: GAP non-pairable mode.
2: GAP pairable mode (default value).
store_in_startup_database
enumerator
0: The setting will only be valid for the current
power cycle.
1: The Serial Port Adapter will remember the
setting between power cycles. The settings
database in the Serial Port Adapter will be
updated.
Responses
Description
OK
Successful response.
ERROR
Error response.
27
11.2: GAP Commands
Chapter 11: AT Commands Reference
Read_Security_Mode (AT*AGSM?)
AT Command
Description
AT*AGSM?
Reads the GAP security mode.
Responses
Description
*AGSM:OK
Successful response.
ERROR
Error response.
Result Parameters
Type
Value
security_mode
enumerator
1: Link level authentication and encryption disabled (GAP security mode 1 with encryption
disabled). (Default value)
2: Link level authentication and encryption enabled (GAP security mode 3 with encryption
enabled).
Write_Security_Mode (AT*AGSM=)
AT Command
Description
AT*AGSM=,
Writes the GAP security
mode.
Command
Parameters
Type
Value
security_mode
enumerator
1: Link level authentication and encryption disabled (GAP security mode 1 with encryption
disabled). (Default value)
2: Link level authentication and encryption enabled (GAP security mode 3 with encryption
enabled).
store_in_startup_database
enumerator
0: The setting will only be valid for the current
power cycle.
1: The Serial Port Adapter will remember the
setting between power cycles. The settings
database in the Serial Port Adapter will be updated.
Responses
Description
OK
Successful response.
ERROR
Error response.
Name_Discovery (AT*AGND=)
28
AT Command
Description
AT*AGND=
Retrieves the device name of a remote device given its
11.2: GAP Commands
Chapter 11: AT Commands Reference
Bluetooth device address.
Command
Parameters
Type
Value
bd_addr
Bd_Addr
Bluetooth device address of the device from which
to retrieve the name.
Responses
Description
*AGND:OK
ERROR
Successful response
Error message.
Response
Parameters
Type
Value
device_name
string
Null terminated string of maximum 240 characters
(8-bit ASCII).
Model
Constraint
cB-OEMSPA311
cB-OEMSPA331
cB-OEMSPA312
cB-OEMSPA332
Device names longer than 31 bytes will be truncated.
Device_Discovery (AT*AGDD=)
AT Command
Description
AT*AGDD=,
Performs device discovery.
Command
Parameters
Type
Description
inquiry_type
enumerator
1: Limited inquiry
2: General inquiry
inquiry_length
integer
Maximum amount of time specified before the
inquiry is halted.
Range: 8-48
Time = inquiry_length*1.28 seconds
Range in seconds: 10.24-61.44
Responses
Description
*AGDD: OK
Successful response
*AGDDE:, , ,
This response is sent for
every found device.
ERROR
Error message.
29
11.2: GAP Commands
Chapter 11: AT Commands Reference
Response
Parameters
Type
Value
no_of_devices
integer
Value in range {0..255}.
Number of devices discovered during the inquiry
procedure.
bd_addr
Bd_Addr
Bluetooth device address of a discovered device.
cod
integer
See Read_Local_COD command.
device_name_valid
enumerator
1: device_Name parameter valid.
0: Device was discovered, but its name could not
be retrieved. device_name is parameter invalid and
should be ignored.
device_name
string
Name of discovered device. ASCII represented
string of maximum 240 bytes.
Model
Constraint
cB-OEMSPA311
cB-OEMSPA331
cB-OEMSPA312
cB-OEMSPA332
Not supported. Instead use the Inquiry and Name_Discovery
commands.
Inquiry (AT*AGI=)
30
AT Command
Description
AT*AGI=,,
Performs an inquiry procedure to find
any discoverable devices in the vicinity.
Command Parameters
Type
Description
inquiry_type
enumerator
1: Limited inquiry
2: General inquiry
inquiry_length
integer
Maximum amount of time specified before the
inquiry is halted.
Range: 1-48
Time = inquiry_length*1.28 seconds
Range in seconds: 1.28-61.44
max_no_of_devices_to_find
integer
0: No limitation on the number of devices to find.
1-255: Maximum number of devices to find.
Responses
Description
*AGI:,
This response is sent for every found device.
OK
Successful response.
ERROR
Error message.
Response
Parameters
Type
Value
Bd_addr
Bd_Addr
Bluetooth device address of a found device.
cod
integer
See Read_Local_COD command.
11.2: GAP Commands
Chapter 11: AT Commands Reference
Model
Constraint
cB-OEMSPA311
cB-OEMSPA331
cB-OEMSPA312
cB-OEMSPA332
If more than 20 devices are found, then devices may be listed
several times.
Bond (AT*AGB=)
AT Command
Description
AT*AGB=
Performs a GAP bond procedure with another Bluetooth device.
During the bonding procedure the fixed PIN code is
used, see the Write_Fixed_PIN and Read_Fixed_PIN
commands. Note that to be able to perform bonding
the remote device must be in pairable mode.
Command
Parameters
Type
Value
bd_addr
Bd_Addr
Bluetooth device address of the device to bond
with.
Responses
Description
OK
Successful response
ERROR
Error message.
Model
Constraint
cB-OEMSPA311
cB-OEMSPA331
cB-OEMSPA312
cB-OEMSPA332
Not supported. Bonding is automatic when connecting if either of
the sides enforces security. The link keys are stored in a FIFO of
size five.
Un_Bond (AT*AGUB=)
AT Command
Description
AT*AGUB=
This command un-bonds a previously bonded device.
Command
Parameters
Type
Value
bd_addr
Bd_Addr
Bluetooth device address of the device subject to
un-bond.
Responses
Description
31
11.2: GAP Commands
Chapter 11: AT Commands Reference
OK
Successful response
ERROR
Error message.
Read_Bonded_Devices (AT*AGBD?)
AT Command
Description
AT*AGBD?
Read the bonded devices.
Responses
Description