Stollmann BlueMod+S Command Reference Manual

BlueMod+S
AT Command Reference
Release r02
BlueMod+S
Release r02 www.stollmann.de Page 2 of 33
Note
This product was developed for the purpose of communication. It is intended solely for our clients for integration into their own technical products after careful examination by experienced technical personnel for its suitability for the intended purpose. The product was not developed for or intended for use in any specific customer application. It may have to be adapted to the specific intended modalities of use or even replaced by other components in order to ensure flawless function in the respective areas of application. Performance data (range, power requirements, footprint, etc.) may depend on the operating environment, the area of application, the configuration, and method of control, as well as on other conditions of use; these may deviate from the technical specifications, the Design Guide specifications, or other product documentation. The actual performance characteristics can be determined only by measurements subsequent to integration in the target environment. Variations in the performance data of mass-produced devices may occur due to individual differences between such devices. Product samples were tested in a reference environment for compliance with the legal requirements applicable to the reference environment. No representation is made regarding the compliance with legal, regulatory, or other requirements in other environments. No representation can be made and no warranty can be assumed regarding the suitability of the product for a specific purpose. Stollmann reserves the right to make changes to the product without prior notice or to replace the product with a successor model. Of course, any changes to the product for which we have entered into a supply agreement with our customers will be made only if, and only to the extent that, such changes can reasonably be expected to be acceptable to our customers. No general commitment will be made regarding periods of availability; these must be subject to individual agreement. All agreements are subject to our Terms and Conditions for Deliveries and Payments, a copy of which is available from Stollmann.
Trademarks
The Bluetooth® word mark and logos are owned by the Bluetooth SIG, Inc.. The NFC word mark and logos are owned by the NFC Forum. Any use of such marks by Stollmann E+V GmbH is under license. Other trademarks and trade names are those of their respective owners.
BlueMod+S
Release r02 www.stollmann.de Page 3 of 33
Table of contents
1 Introduction ........................................................................................................ 5
1.1 AT Command Mode ...................................................................................... 5
1.2 Escape Sequence ......................................................................................... 5
1.3 Multiplexing Mode (MUX) .............................................................................. 6
1.4 Hangup ......................................................................................................... 7
2 Commands ........................................................................................................ 8
2.1 General ......................................................................................................... 8
%B Baud Rate ..................................................................................... 8
&F Load Factory Defaults ................................................................... 9
&W Store Active Configuration .......................................................... 10
A Accept Incoming Call .................................................................. 10
BIOCAP SSP I/O Capabilities ................................................................... 10
BMITM SSP Man in the middle protection ............................................... 10
BMUX Activate Multiplexing Mode.......................................................... 11
BNAME Local Device Name ..................................................................... 11
BNDDEL Delete Bonding Information ......................................................... 12
BNDLIST Show Bonded Device List ........................................................... 12
BNDS Storage Mode for Bonds ............................................................. 12
BNDSIZE Bonded Devices List Size ........................................................... 13
BOAD Bluetooth Own Device Address ................................................... 13
BPAIRMODE Configure Pairable Mode ......................................................... 13
BSSPPIN SSP Passkey Response ............................................................. 14
E Local Echo .................................................................................. 14
H Disconnect .................................................................................. 14
I Display Version Information ........................................................ 15
IOACFG Config of Pin IOA ........................................................................ 15
LOAD Load Stored Parameter Setting ................................................... 16
O Return to Online State ................................................................. 16
Q Suppress Results ........................................................................ 16
RESET Reset Device .............................................................................. 16
BlueMod+S
Release r02 www.stollmann.de Page 4 of 33
RFMAXTXPWR Maximum Output Power ...................................................... 16
S AT S Register ............................................................................. 17
UICP Set UART Interface Control Protocol ........................................... 17
V Result Message Format .............................................................. 18
W Extended Result Codes .............................................................. 18
2.2 Bluetooth Low Energy ................................................................................. 18
LEADINTMAX Maximum Advertising Interval ................................................ 18
LEADINTMIN Minimum Advertising Interval .................................................. 19
LECONINTMAX Maximum Connection Interval ............................................. 19
LECONINTMIN Minimum Connection Interval ............................................... 19
LEROLE Bluetooth Low Energy Device Role ............................................. 20
LESLAVELAT Slave Latency ........................................................................ 20
LETIO Enable Terminal I/O Service ....................................................... 20
LEADDATA Setup Advertise Data for Customized Advertising ....................... 21
LEADE Enable Customized Advertising .................................................. 21
LEADPAR Setup Parameters for Customized Advertising ............................ 22
LESCDATA Setup Scan Response Data for Customized Advertising ............. 22
2.3 GATT .......................................................................................................... 23
2.3.1 GATT Server ............................................................................... 23
LEATTRIB Define Attributes for a Service ..................................................... 23
3 Appendix .......................................................................................................... 29
3.1 Linktype ...................................................................................................... 29
3.2 AT Result Codes ......................................................................................... 29
3.3 Extended Result Codes .............................................................................. 29
3.3.1 CONNECT .................................................................................. 29
3.3.2 RING ........................................................................................... 29
3.3.3 NO CARRIER ............................................................................. 30
3.4 Events ......................................................................................................... 31
4 Related Documents ......................................................................................... 32
5 History ............................................................................................................. 33
BlueMod+S
Release r02 www.stollmann.de Page 5 of 33
1 Introduction
This documentation specifies the command interface for the BlueMod+S.
The BlueMod+S supports AT command mode.
1.1 AT Command Mode
Each command line consists of a prefix, a body and a terminator.
All command lines begin with the prefix AT (ASCII 065, 084) or at (ASCII 097, 116).
The body is a string of characters in the ASCII range 032-255. Control characters other than <CR> (carriage return; ASCII 013) and <BS> (back space; ASCII 008) in a command line are ignored.
The terminator is <CR>.
There is no distinction between upper-case and lower-case characters. A command line can have a maximum length of 80 characters. It is automatically discarded if the input is longer. Corrections are made using <BS>. Multiple commands on the same command line are not allowed.
Commands have the following syntax:
Syntax
Description
AT<command>=<value><CR>
Write the value of the command
Responses are sent back to the host and can be any of the following:
Responses
Description
<CR><LF>value<CR><LF>
Read only value (e.g. AT+BOAD)
<CR><LF>OK<CR><LF>
Successful final message
<CR><LF>ERROR<CR><LF>
Error message, command not supported
Note: Exceptions of this syntax are marked seperately.
1.2 Escape Sequence
To enter the command mode during an active data connection the following se­quence (escape sequence) can be used:
<delay time1><+><+><+><delay time>
1
Delay time defined in the S12 register (see page 16)
BlueMod+S
Release r02 www.stollmann.de Page 6 of 33
The time interval between each of the three plus signs must not exceed 1 second. The escape sequence remains transparent to the remote device.
1.3 Multiplexing Mode (MUX)
The multiplexing mode is used to handle incoming and outgoing data of different remote endpoints and command data.
Data has to be sent and are received in the following framing (all values in hexadecimal format):
Name
Description
Length
Value
Start
Start of frame
8 bit
CC
Channel ID
Channel identifier
8 bit
00 – FF
Length
Length of data
8 bit
-
Data
Max. 255 bytes data
Min. 0 byte Max. 255 bytes
-
The start byte is used to detect the start of a frame.
The channel ID determines the channel to send data to. This can be the link ID of an active link in case of classic Bluetooth, the data channel of a BLE endpoint or the AT command interface (value FF).
The length field sets the length of the payload to send or to received in bytes.
The data field consists of the payload data to send or receive.
Start of frame, channel ID, length and data are always transmitted in direct, binary form. AT commands have to be sent to the channel ID FF, simply prefixed with start of frame, 0xFF, and length byte. Data received from the AT command interface are marked by channel ID FF. Line editing using backspace is not available in multiplexing mode.
Examples:
CC 01 0B 31 32 33 34 35 36 37 38 39 30 0D
Send data “1234567890<CR>” to channel 1 via MUX protocol
CC FF 06 41 54 49 39 39 0D
Send AT command “ATI99<CR>” via MUX protocol
CC FF 06 0D 0A 4F 4B 0D 0A
Receive response “<CR><LF>OK<CR><LF>” from AT command interface via MUX protocol
Result messages like RING, CONNECT and NO CARRIER may be sent in multiple frames by the BlueMod+S module. The host controller application needs to collect the data until the closed <CR><LF>is received.
If the multiplexing mode is enabled the commands ATH and the result messages RING, CONNECT and NO CARRIER includes the additional parameter “channel ID”.
BlueMod+S
Release r02 www.stollmann.de Page 7 of 33
For Terminal I/O connections, the “channel ID” is assigned while connection setup
(by messages RING for incoming connections and CONNECT for outgoing connections) and is valid until the connection is terminated (message NO CARRIER).
For customer defined GATT services, the “channel ID” is assigned while service
definition for each defined characteristic separately and is valid until the BlueMod+S is resetted.
1.4 Hangup
An active data connection can be disconnected by setting the HANGUP pin (GPIO4) to high level.
BlueMod+S
Release r02 www.stollmann.de Page 8 of 33
2 Commands
The description of the commands is structured into the following parts:
General commands Bluetooth Low Energy (BLE) specific commands
The factory-default values of the commands are marked using the bold letter format.
2.1 General
%B Baud Rate
AT syntax: AT%B<value>
This command determines the baud rate for the UART.
The following standard baud rates are supported:
Value
Description
4
9,600 bps
5
19,200 bps
6
38,400 bps
7
57,600 bps
8
115,200 bps
9
230,400 bps
22
460,800 bps
23
921,600 bps
Additionally to the standard baud rates described above, it is possible to set the following baud rates.
BlueMod+S
Release r02 www.stollmann.de Page 9 of 33
Value
Description
1200
1,200 bps
2400
2,400 bps
4800
4,800 bps
9600
9,600 bps
14400
14,400 bps
19200
19,200 bps
28800
28,800 bps
38400
38,400 bps
57600
57,600 bps
76800
76,800 bps
115200
115,200 bps
230400
230,400 bps
250000
250,000 bps
460800
460,800 bps
921600
921,600 bps
1000000
1,000,000 bps
To set a baud rate write the desired value in the command.
Examples:
AT%B9
Set baud rate to 230,400 bps
AT%B250000
Set baud rate to 250,000 bps
Note: Information regarding the deviation of the real baud rate to the value set can be found in the BlueMod+S Hardware Reference [1].
&F Load Factory Defaults
AT syntax: AT&F<value>
The factory-default values will be loaded. For storing values in non-volatile memory, use the &W command.
Value
Description
0
Set all parameters except bndlist to factory defaults
1
Set all parameters to factory defaults
Note: Some restored values require an additional reset to get active (e.g. AT+LETIO, AT+UICP).
BlueMod+S
Release r02 www.stollmann.de Page 10 of 33
&W Store Active Configuration
AT syntax: AT&W
The active configuration is stored in non-volatile memory.
A Accept Incoming Call
AT syntax (normal mode): ATA AT syntax (MUX mode): ATA <channel ID>
This command is supported for compatibility reasons only. A Bluetooth low energy device has to answer every connection automatically. See also Register S0 description.
Examples:
ATA
Accepts connection in normal mode
ATA 0x01
Accepts connection in MUX mode at channel ID 0x01
BIOCAP SSP I/O Capabilities
AT syntax: AT+BIOCAP=<value>
This command sets the input and output capabilities of the device used for SSP.
Value
Description
0
Display only
1
Display Yes/No
2
Keyboard only
3
No input no output
4
Display and keyboard
BMITM SSP Man in the middle protection
AT syntax: AT+BMITM=<value>
This command controls the man in the middle (MITM) protection of the device during SSP. It has to be set in context with BIOCAP command. In SSP there are scenarios where MITM protection is not possible.
BlueMod+S
Release r02 www.stollmann.de Page 11 of 33
Value
Description
0
Man in the middle protection disabled
1
Man in the middle protection enabled
In case the user choose a scenario where MITM protection is not possible but one of the communication devices is configured to BMITM=1 (MITM protection enabled), the pairing is refused.
Possible combinations of I/O capabilities and the possibility of MITM protection are described in the BlueMod+S User Guide [2].
BMUX Activate Multiplexing Mode
AT syntax: AT+BMUX=<value>
This command is used to activate the multiplexing mode protocol.
In the default configuration the device is working in normal AT mode. Setting BMUX=1 enables the multiplexing mode.
Note: After receiving “OK” in the response of the BMUX=1 command all subsequent commands have to be entered in multiplexing frame format.
The multiplexing mode is not stored persistent. To disable the multiplexing mode the device must be reset.
In multiplexing mode extended result codes are always active (see chapter 3.3 Extended Result Codes).
BNAME Local Device Name
AT syntax: AT+BNAME=<name>
This command allows the modification of the local device name. The device name is shown on a remote Bluetooth device during device/service discovery. It is limited to 19 characters.
The device name can contain a format element to include the device’s own address or parts of it in the name.
In BLE advertising the name is truncated to the first 10 characters.
Format: %[<s>][<d>]a
“%”
Identifier start format element
<s>
Character separator on byte order (optional)
<d>
Number (1-12) of digits included in device name (optional, default is 4)
“a”
Identifier end format element
BlueMod+S
Release r02 www.stollmann.de Page 12 of 33
Examples: Device address = 0123456789AB
AT+BNAME=BM+S %4a
Display on remote end: BM+S 89AB
AT+BNAME=BM+S %4a
Display on remote end: BM+S 89AB
AT+BNAME=BM+S %:3a
Display on remote end: BM+S 9:AB
AT+BNAME=BM+S %3a
Display on remote end: BM+S 9AB
AT+BNAME=BM+S %:12a
Display on remote end: BM+S 01:23:45:67:89:AB
BNDDEL Delete Bonding Information
AT syntax: AT+BNDDEL=<value>
This command deletes the bonding information stored by the BlueMod+S.
Value
Description
Bluetooth address
Delete the bond of the device with specified address from bndlist
*
Delete all bonded devices from bndlist
BNDLIST Show Bonded Device List
AT syntax: AT+BNDLIST
This command shows information about the devices bonded with the BlueMod+S.
Each entry in the BNDLIST contains the Bluetooth address and the linktype (see chapter 3.1).
Example:
AT+BNDLIST
0080254800DA 0x02 9C04EB06ACA2 0x0A OK
BNDS Storage Mode for Bonds
AT syntax: AT+BNDS=<mode>
This command controls the storage mode for bonding information (link keys).
Mode
Description
0
Bonds persists for the duration of the authenticated connection
1
Bonds are permanently stored in the NVRAM of the BlueMod+S
BlueMod+S
Release r02 www.stollmann.de Page 13 of 33
Note: By setting BNDS to 0 the BNDLIST is deleted internally.
BNDSIZE Bonded Devices List Size
AT syntax: AT+BNDSIZE=<value>
This command reduces the number of entries (1…4) the bonded-device list can hold.
The default size is 4 for BlueMod+S.
Note: Modification of this parameter will delete all entries in the bonded-device list.
Example:
AT+BNDSIZE=1
Limit the number of bonded devices to 1
BOAD Bluetooth Own Device Address
AT syntax: AT+BOAD
This command reads the Bluetooth devices’ own device address.
Note: This command is read only.
BPAIRMODE Configure Pairable Mode
AT syntax: AT+BPAIRMODE=<mode>
This command controls the pairable mode of the BlueMod+S.
When set to “0” the module is only connectable for clients stored in the local bondlist. New pairing requests will be rejected.
Mode
Description
0
No pairing allowed, BlueMod+S advertises TIO as “functional”
1
Pairing allowed, BlueMod+S advertises TIO as “bondable and functional”
Note: This command restricts the access only to security enabled characteristics.
For Terminal I/O this means AT+LETIO has to be set to 1.
For the GATT Server the permission parameters of the command
AT+LEATTRIB have to be set to a value that requires authentication (e.g.
BlueMod+S
Release r02 www.stollmann.de Page 14 of 33
“AT+LEATTRIB=charval,uuid=2A19,perm=0022,len=1” with “perm” for read with authentication permitted and write with authentication permitted).
BSSPPIN SSP Passkey Response
AT syntax: AT+BSSPPIN <Bluetooth address>,<SSP passkey>
If a SSP is initiated and MITM is active (BMITM=1), depending on the I/O capabilities (BIOCAP) the AT interface generates an event SSPPIN and asks the user for the SSP passkey.
Event: SSPPIN <Bluetooth address> ?
The user has to answer this request with the SSP passkey displayed on the remote device.
Example:
SSPPIN 00802507C08D ? AT+BSSPPIN 00802507C08D,314546 OK
RING
CONNECT
Receive SSP passkey request Send SSP passkey response
E Local Echo
AT syntax: ATE<value>
This command selects the local echo in command mode.
Value
Description
0 or empty
No local echo
1
Local echo on in command phase
H Disconnect
AT syntax (normal mode): ATH AT syntax (MUX mode): ATH <channel ID>
This command disconnects the existing Bluetooth connection.
BlueMod+S
Release r02 www.stollmann.de Page 15 of 33
Examples:
ATH
Disconnects connection in normal mode
ATH 0x01
Disconnects connection in MUX mode at channel ID 0x01
I Display Version Information
AT syntax: ATI<value>
Displays different information about version number and settings.
Value
Description
0 or empty
Returns the device name (e.g. “BlueMod+S“)
1
Returns “0”
2
Returns “OK”
3
Returns the version string: “V1.xyz”
4
Returns the manufacturers name: “Stollmann E+V GmbH”
5
Returns “ERROR
6
Returns the copyright string: “(c) Copyright Stollmann E+V GmbH”
7
Returns “OK”
8
Returns “ERROR”
9
Returns “OK”
77
Returns bootloader version
99
Returns the firmware creation date
IOACFG Config of Pin IOA
AT syntax: AT+IOACFG=<value>
This command configures the function of the IOA pin (GPIO8). GPIO8 can be configured as output signal “Device Ready". The signal is low active, a low level shows the device ready to process commands and establish Bluetooth connections after startup.
Value
Description
0
Input: Analog (no function, lowest power consumption)
1
Output: Signal “Device Ready”
BlueMod+S
Release r02 www.stollmann.de Page 16 of 33
LOAD Load Stored Parameter Setting
AT syntax: AT+LOAD
This command loads all parameters stored in non-volatile RAM.
O Return to Online State
AT syntax: ATO
If the BlueMod+S is in command mode after issuing an escape sequence while a connection is active, ATO returns the BlueMod+S to data mode.
Q Suppress Results
AT syntax: ATQ<value>
This command allows/suppresses result codes and messages.
Value
Description
0 or empty
Enable result messages after command input
1
Suppress result messages after command input
RESET Reset Device
AT syntax: AT+RESET
This command resets the whole functionality of the BlueMod+S by a forced hardware reset (like power off/on).
RFMAXTXPWR Maximum Output Power
AT syntax: AT+RFMAXTXPWR=<value>
This command sets the maximum output power of the Bluetooth radio of the device.. The chip uses this value for BLE (advertising, scan response). This is also the power used for new connections.
Value
Description
-128
Use factory default maximum output power
-127127
Maximum output power in dBm
BlueMod+S
Release r02 www.stollmann.de Page 17 of 33
All other values in the range of -127 to 127 could be set with this command as well, but the equal or next lower value from the power table will be set internally. Furthermore the value will be set to a value amongst minimum and maximum output power value of the device.
Example:
AT+RFMAXTXPWR=0
The maximum output power will be set to 0 dBm
S AT S Register
AT syntax: ATSx=<value>
This command configures the S register settings.
Mode
Description
Sx?
Show the current setting of register Sx
Sx=1
Set register Sx to 1
AT command S register set (all values in decimal format):
Register
Value
Description
S0
1
Immediate call acceptance
Note: Setting of S0only allow value 1 for BLE.. In case of BLE connections always one RING is signalised and automatic call acceptance is set.
S2
43
Character for escape sequence
S3
13
Carriage-return character
S4
10
Line-feed character
S5
08
Backspace character
S12
100
Delay time by using the escape sequence in 10 ms increments
UICP Set UART Interface Control Protocol
AT syntax: AT+UICP=<mode>
This command sets the mode of the UART Interface Control Protocol (UICP).
To activate UICP, it is necessary to store the settings and perform a reset.
Mode
Description
0
UICP off
1
UICP on
The valid sequence to e.g. activate UICP is:
BlueMod+S
Release r02 www.stollmann.de Page 18 of 33
AT+UICP=1
AT&W
AT+RESET
V Result Message Format
AT syntax: ATV<value>
This command determines the format of the result messages.
Value
Description
0 or empty
Result message is presented numerically (followed by <CR>)
1
Result message is presented as text
W Extended Result Codes
AT syntax: ATW<value>
This command enables/disables extended result codes.
Value
Description
0 or empty
Result message is presented without extended result codes
1
Result message is presented with extended result codes (include error causes)
2.2 Bluetooth Low Energy
LEADINTMAX Maximum Advertising Interval
AT syntax: AT+LEADINTMAX=<value>
This command configures the maximum advertising interval (in milliseconds) for a Bluetooth Low Energy Peripheral.
Value
Description
n=20…10240
Use maximum advertising interval of n ms
1280
Use maximum advertising interval of 1280 ms
Note: Make sure that the value of LEADINTMAX is higher or equal the value of LEADINTMIN.
BlueMod+S
Release r02 www.stollmann.de Page 19 of 33
LEADINTMIN Minimum Advertising Interval
AT syntax: AT+LEADINTMIN=<value>
This command is not used in the BlueMod+S. It is just provided for compatibility reasons. The used advertising interval is set by AT+LEADINTMAX parameter.
LECONINTMAX Maximum Connection Interval
AT syntax: AT+LECONINTMAX=<value>
This command configures the maximum connection interval for a Bluetooth Low Energy connection. The unit is in 1.25 milliseconds timeslots.
Value
Description
n=6…3200
Use maximum connection interval of n * 1.25 ms
32
Use maximum connection interval of 40 ms
Note: Make sure that the value of LECONINTMAX is higher or equal the value of LECONINTMIN.
LECONINTMIN Minimum Connection Interval
AT syntax: AT+LECONINTMIN=<value>
This command configures the minimum connection interval for a Bluetooth Low Energy connection. The unit is in 1.25 milliseconds timeslots.
Value
Description
n=6…3200
Use minimum connection interval of n * 1.25 ms
16
Use minimum connection interval of 20 ms
Note: Make sure that the value of LECONINTMAX is higher or equal the value of LECONINTMIN.
BlueMod+S
Release r02 www.stollmann.de Page 20 of 33
LEROLE Bluetooth Low Energy Device Role
AT syntax: AT+LEROLE=<value>
This command configures the Bluetooth Low Energy role of the device.
Value
Description
0
Set device role to “Peripheral”
When set to “Peripheral” (default), the device advertises and accepts incoming BLE
connections. Searching for Bluetooth Low Energy devices with LESCAN command is not possible.
LESLAVELAT Slave Latency
AT syntax: AT+LESLAVELAT=<value>
This command configures the slave latency (in connection intervals) for a Bluetooth Low Energy connection.
Value
Description
n=0…499
Use a slave latency of n connection intervals
0
Use no slave latency
LETIO Enable Terminal I/O Service
AT syntax: AT+LETIO=<value>
This command controls the Terminal I/O service. If set to 0 the Terminal I/O service is disabled. To activate the change, it is necessary to store the settings (AT&W) and perform a reset (AT+RESET).
Value
Description
0
Terminal I/O service disabled (no advertising, no characteristics)
1
Terminal I/O service enabled, security is required
2
Terminal I/O service enabled, no security required
The valid sequence to change the setting is:
AT+LETIO=1
AT&W
AT+RESET
BlueMod+S
Release r02 www.stollmann.de Page 21 of 33
LEADDATA Setup Advertise Data for Customized Advertising
AT syntax: AT+LEADDATA=<value1> .. <valuen>
This command is used to setup the advertise data for a customized advertising.
Valuek represents an octet in hexadecimal format, k <= 31.
The coding of the data is according to the Bluetooth 4.0 Core Specification / Vol. 3, Part C, Chapter 11 and 18 (Length/Type/Value coding) [3].
Example:
41 54 2B 4C 45 41 44 44 41 54 41 3D 30 32 30 31 30 36 30 33 30 32 30 46 31 38 0D
(human readable: AT+LEADDATA=02010603020F18)
Set flags + UUID of battery service
LEADE Enable Customized Advertising
AT syntax: AT+LEADE=<value>
This command controls the advertising behavior.
With AT+LEADE=0 only the build in Terminal I/O service is advertised.
With AT+LEADE=1 only the customized advertisimg value is advertised.
With AT+LEADE=3 the module stops all advertising. With disabled advertising the client (e.g. iPhone) is not able to discover the device or to connect to the device. This should only be done when the service is not in use to save battery power.
With disabled internal TI/O due to AT+LETIO=0, the values 0 and 3 show the same behavior. There will be no advertising and no connection.
Value
Description
0
Customized advertising disabled, internal TIO advertising enabled
1
Customized advertising enabled, internal TIO advertising disabled
2
Reserved for future use
3
Advertising off, customized advertising disabled, internal TIO advertising disabled
BlueMod+S
Release r02 www.stollmann.de Page 22 of 33
LEADPAR Setup Parameters for Customized Advertising
AT syntax: AT+LEADPAR=par1=<value1>[, .. [,parn=<valuen>]]
This command is used to setup parameters for a customized advertising.
parn
valuen
advtype
Optional Coding: decimal.
Type of advertising:
0: undirected (default)
2: scannable 3: non-connectable
This command is optional, if not submitted these defaults apply:
advtype = 0 - advertising type “undirected”
Note: The values for the minimum and maximum of the advertising interval may be set with the LEADINTMIN and LEADINTMAX commands.
Example:
AT+LEADPAR=ADVTYPE=0
Set type of advertising “undirected”
LESCDATA Setup Scan Response Data for Customized Advertising
AT syntax: AT+LESCDATA=<value1> .. <valuen>
This command is used to setup the scan response data for a customized advertising.
Valuek represents an octet in hexadecimal format, k <= 31.
The coding of the data is according to the Bluetooth 4.0 Core Specification / Vol. 3, Part C, Chapter 11 and 18 (Length/Type/Value coding) [3].
Example:
41 54 2B 4C 45 53 43 44 41 54 41 3D 30 33 30 32 30 46 31 38 0D
(human readable: AT+LESCDATA=03020F18)
Set UUID of battery service
BlueMod+S
Release r02 www.stollmann.de Page 23 of 33
2.3 GATT
All commands described in this chapter can only be used in multiplexing mode (BMUX=1).
2.3.1 GATT Server
LEATTRIB Define Attributes for a Service
AT syntax: AT+LEATTRIB=<type>[,par1=<value1>[, .. ,parn=<valuen>]..]]
This command is used to define attributes for one or more services in the GATT server. The maximum number of services and characteristics depends on the used features. Every combination results in a different number of possible service and characteristic combinations. The maximum number of possible characteristics is limited to 20. This restriction results from the limited size of the internal definition array. If the space is completely used the command “AT+LEATTRIB=charval,…” returns “ERROR”.
The GAP and GATT services that each GATT server must expose are built-in services in the BlueMod+Stollmann E+V GmbH and thus shall not be defined by the application!
BlueMod+S
Release r02 www.stollmann.de Page 24 of 33
The presence of parameters par1,..,parn depends on the value of <type>:
type
par1
par2
par3
pserv
Mandatory
uuid=<16/128bit UUID>
Mandatory
Coding: hexadecimal.
char
Mandatory
prop=<properties>
Mandatory
Coding: hexadecimal.
properties may have the bitmask values Read,
Write Without Response, Write, Notify and Indicate
set.
Note: internally the controller generates an additional Client Characteristic Configuration Descriptor (CCCD) attribute with
permissions „readable and
writable without authentication or authorization“ if bits Notify or Indicate are set.
charval
Mandatory
uuid=<16/128bit UUID>
Mandatory
Coding: hexadecimal.
perm=<permissions>
Mandatory
Coding: hexadecimal.
16-bit value that decodes the access permissions and authentication requirements.
len=<length>
Mandatory
Coding: decimal.
Maximum supported length is 20 bytes.
BlueMod+S
Release r02 www.stollmann.de Page 25 of 33
type
par1
par2
par3
chardcccd
Optional
perm=<permissions>
Mandatory
Coding: hexadecimal.
This command is needed only if a CCCD shall be generated with permissions other than
„readable and writable
without authentication or
authorization“. See note in
type=char description.
chardusrd
Optional
usrd=<user description >
Mandatory
Coding: UTF-8 string.
User description string.
Note:
- Since Extended Properties (see type=char, parameter properties description) are not supported the remote peer may not write to this characteristic descriptor.
- The number of characters is limited to 13. Internally the character sequence is terminated by a zero byte resulting in an ASCII-Z string.
perm=<permissions>
Optional
Coding: hexadecimal.
16-bit value that decodes the access permissions and authentication requirements.
If this parameter is omitted the default readable
without authentication or authorization applies.
complete
Mandatory
No parameter.
Used to signal that all attribute definitions have been sent to the controller.
BlueMod+S
Release r02 www.stollmann.de Page 26 of 33
The characteristic properties are coded as a hexadecimal bitmask as defined in Bluetooth Core Spec 4.0 Volume3 Part G Chapter 3.3.1.1 [3].
Value
Properties
02
Read
04
Write without response
08
Write
10
Notify
20
Indicate
The values can be combined, for example read & notify result in 12.
The attribute permissions (parameter perm=<permissions>) are bit coded in a 16 bit hexadecimal value.
Bit
Value
Function
0,1
0 1 2 3
Read not permitted Read permitted Read with authentication permitted Read with authentication and MITM protection permitted
2..3 - Reserved
4,5
0 1 2 3
Write not permitted Write permitted Write with authentication permitted Write with authentication and MITM protection permitted
6..15
-
Reserved
Example: value for read only is 0001.
The complete service/s is/are defined through repeated submissions of the LEATTRIB command (see example below).
BlueMod+S
Release r02 www.stollmann.de Page 27 of 33
The LEATTRIB commands must be submitted in a specific order:
Definition of first service:
AT+LEATTRIB=pserv, …
Definition of first characteristic of first service:
AT+LEATTRIB=char, …
… optional characteristic descriptors (AT+LEATTRIB=chardxxx) …
AT+LEATTRIB=charval, …
Definition of second characteristic of first service:
AT+LEATTRIB=char, …
… optional characteristic descriptors (AT+LEATTRIB=chardxxx) …
AT+LEATTRIB=charval, …
Definition of second service:
AT+LEATTRIB=pserv, …
Definition of first characteristic of second service:
AT+LEATTRIB=char, …
… optional characteristic descriptors (AT+LEATTRIB=chardxxx) …
AT+LEATTRIB=charval, …
Completion of service and characteristics definition:
AT+LEATTRIB=complete
Upon successful execution of the LEATTRIB command with type=charval the device returns the data channel ID which is associated to the characteristic value.
Format: <CR><LF>0x<channel><CR><LF>
Data belonging to the characteristic value is exchanged over multiplexer data channel ID channel. The channel value is coded in hexadecimal digits.
BlueMod+S
Release r02 www.stollmann.de Page 28 of 33
Example:
The example below shows the Battery Service. Battery Service is a simple service which exposes the battery charging level as single characteristic value.
Command
Response
Description
CC FF 1C 41 54 2B 4C 45 41 54 54 52 49 42 3D 70 73 65 72 76 2C 75 75 69 64 3D 31 38 30 46 0D
(human readable: AT+LEATTRIB=pserv,uuid=180F)
CC FF 19 41 54 2B 4C 45 41 54 54 52 49 42 3D 63 68 61 72 2C 70 72 6F 70 3D 31 32 0D
(human readable: AT+LEATTRIB=char,prop=12)
CC FF 06 0D 0A 4F 4B 0D 0A
(OK)
CC FF 06 0D 0A 4F 4B 0D 0A
(OK)
Declares the properties of the battery level value
CC FF 2E 41 54 2B 4C 45 41 54 54 52 49 42 3D 63 68 61 72 76 61 6C 2C 75 75 69 64 3D 32 41 31 39 2C 70 65 72 6D 3D 30 30 30 31 2C 6C 65 6E 3D 31 0D
(human readable: AT+LEATTRIB=charval,uuid=2A19,perm=0001, len=1)
CC FF 08 0D 0A 30 78 30 32 0D 0A CC FF 06 0D 0A 4F 4B 0D 0A
(0x02 OK)
Declares the battery level value (one byte in the range 0,..,100). Battery level values are exchanged over multiplexer channel 2
CC FF 15 41 54 2B 4C 45 41 54 54 52 49 42 3D 63 6F 6D 70 6C 65 74 65 0D
(human readable: AT+LEATTRIB=complete)
CC FF 06 0D 0A 4F 4B 0D 0A
(OK)
Completes the service definition sequence
If a connection exists values written to data multiplexer channel 2 will be sent to the remote device. If no connection exsists, the last value written to a multiplexer channel will be stored in RAM. In case a connection from or to a remote device is established, the remote device will receive the last value that the application wrote to channel 2. If the application did not write a value to the data channel yet, the value of the characteristic is set to 0. It is recommended that the application sets default data values for all characteristics immediately after registration of all characteristics.
BlueMod+S
Release r02 www.stollmann.de Page 29 of 33
3 Appendix
3.1 Linktype
Linktype
Meaning
0x02
Bluetooth low energy using public address
0x03
Bluetooth low energy using random address
0x0A
Bluetooth low energy using resolved address
3.2 AT Result Codes
Result codes (numerical and verbose):
Numeric
Text
Meaning
0
OK
Command completed
1
CONNECT
Connection established
2
RING
Indicates an incoming call (link request received)
3
NO CARRIER
Connection disconnected
4
ERROR
Illegal command or error that cannot be indicated otherwise
3.3 Extended Result Codes
Extended result codes (numerical and verbose) are available after activation with W1 command.
In multiplexing mode extended result codes are always active.
3.3.1 CONNECT
For the AT result code CONNECT the following extended result codes are available:
Syntax normal mode: CONNECT <Bdaddr> <linktype>
Syntax MUX mode: CONNECT <Bdaddr> <linktype> <channel ID>
Examples:
Normal mode
Numerical (ATV0)
1 <00802501D11A 0x02>
Verbose (ATV1)
CONNECT <00802501D11A 0x02>
MUX mode
Numerical (ATV0)
1 <00802501D11A 0x02 0x01>
Verbose (ATV1)
CONNECT <00802501D11A 0x02 0x01>
3.3.2 RING
For the AT result code RING the following extended result codes are available:
Syntax normal mode: RING <Bdaddr> <linktype>
Syntax MUX mode: RING <Bdaddr> <linktype> <channel ID>
BlueMod+S
Release r02 www.stollmann.de Page 30 of 33
Examples:
Normal mode
Numerical (ATV0)
2 <00802501D11A 0x02>
Verbose (ATV1)
RING <00802501D11A 0x02>
MUX mode
Numerical (ATV0)
2 <00802501D11A 0x02 0x01>
Verbose (ATV1)
RING <00802501D11A 0x02 0x01>
3.3.3 NO CARRIER
For the AT result code NO CARRIER the following extended result codes are available:
Syntax normal mode: NO CARRIER <Bluetooth release/error code>
Syntax MUX mode; NO CARRIER <Bluetooth release/error code> <channel ID>
The following table shows the release/error codes:
Error code
Meaning
0x0000
Success
0x0001
Accept
0x0002
Reject
0x0003
Resource error
0x0004
Invalid parameter
0x0005
Invalid state
0x0006
Connection disconnect
0x0007
Connection paused
0x0008
Connection lost
0x0009
Authentication failed
0x000A
Flowcontrol violation
0x000B
Init timeout
0x000C
Init out of sync
0x000D
Init hardware failure
0x000E
Lower layer error
0x00FD
Unspecified
0x00FE
Not supported
Examples:
Normal mode
Numerical (ATV0)
3 <0006>
Verbose (ATV1)
NO CARRIER <0006>
MUX mode
Numerical (ATV0)
3 <0006 0x01>
Verbose (ATV1)
NO CARRIER <0006 0x01>
BlueMod+S
Release r02 www.stollmann.de Page 31 of 33
3.4 Events
Text
Description
SSPPIN <Bdaddr> ?
SSP passkey request (see BSSPPIN command)
BlueMod+S
Release r02 www.stollmann.de Page 32 of 33
4 Related Documents
[1] BlueMod+S Hardware Reference
[2] BlueMod+S User Guide
[3] Bluetooth 4.0 Core Specification
[4] BlueMod+S - BlueMod+SR Delta Reference
BlueMod+S
Release r02 www.stollmann.de Page 33 of 33
5 History
Version
Release Date
By
Change description
r01
06.03.2014
or
Initial version
r02d01
11.06.2014
or
Add custom gatt server and advertising commands. Add bootloader version support. Decrease BNDLIST size to 4 Remove ATS30
r02d02
05.08.2014
ta
Add BPAIRMODE command
r02
27.08.2014
or
Modified gatt server parameter Added note for MUX mode results Added note for AT&F More detailed description for returned channel format Correct characteristic default value description Remove note from LEATTRIB table Revised description of LEADPAR
Stollmann Entwicklungs- und Vertriebs-GmbH Mendelssohnstraße 15 D 22761 Hamburg Germany
Phone: +49 (0)40 890 88-0 Fax: +49 (0)40 890 88-444 E-mail: info@stollmann.de www.stollmann.de
Loading...