User's Manual

17
www.lairdtech.com
Laird Technologies
BTM510/511
Bluetooth
®
Multimedia Module
General S Registers
Please refer to Appendix, Table 4.1 for a list of supported S Registers.
The main purpose of S Registers is to make the device conguration persistent. All S Registers can be saved to
non-volatile memory by AT&W.
In some cases, an AT command and an S register exist for one and the same setting. In the majority of those
cases the AT command’s setting will be lost on next power cycle whereas the S register can be saved and is still
available after power cycle. This rule applies to many but not to all of those cases.
AT Commands for Inquiry
1. AT+BTI<devclass> { Inquire}
This will make the device perform an inquiry for delay seconds and max number of unique responses,
where delay is dened by S register 517 and max is specied by S register 518.
The <devclass> is an optional parameter where the value species either a six digit device class code or
a two digit major device class. If it is not specied, the value is taken from S register 516.
When <devclass> is six hexadecimal characters long, it species an AND mask which is used to lter
inquiry responses. When <devclass> is two hexadecimal characters long, it forces the inquiry to lter
responses to devices that match their major device class code to this value – which can only be in
the range 00 to 1F.
The response format to AT+BTI is dened by S Register 330 by bitmask. This is device address, device
class, friendly name, receiver strength indicator and extended inquiry data. Please refer to Figure 3.1
and Table 3.2.
For S330=1:
Response: <cr,lf>12346789012
<cr,lf>12345678914
<cr,lf>OK<cr,lf>
A Bluetooth inquiry process is such that for a single inquiry request a device could respond many times.
To ensure that an address is sent to the host only once for a particular AT+BTI, an array of addresses is
created at the start of each AT+BTI and is lled as responses come in. This array of addresses is stored
in dynamic memory and as such if the memory allocation fails then the inquiry procedure is aborted and
in that case an error response is sent to the host. To clarify, a single AT+BTI will never return the same
Bluetooth address more than once. But as long as the responding device is active, all AT+BTI commands
will always return it.
As the inquiry process is driven by randomness, it is not guaranteed that each discoverable device is
always found on the rst attempt. Sometimes more than one inquiry processes might be necessary
to nd a particular device. The probability also depends on the inquiry scanning intervals of the device
being searched for.
The inquiry process can be sped up if the friendly name is not required (ag not set in S330) as part of
the inquiry response or if a <dev_class> lter is used.
Bit 7 6 5 4 3 2 1 0
Reserved for future usage EIRD RSSI FN COD ADR
Default 0 0 0 0 0 0 0 1
Figure 3.1: S Register 330 controlling inquiry response format
Field Description
0 – ADR 1 – display Bluetooth device address on inquiry result
0 – do not display Bluetooth device address on inquiry result; if any further bit is set, a comma is inserted as
separator
1 – COD 1 – display class of device on inquiry result
0 – do not display class of device on inquiry result; if any further bit is set, a comma is inserted as separator
2 – FN 1 – display friendly name on inquiry result
0 – do not display friendly name on inquiry result; if any further bit is set, a comma is inserted as separator
3 – RSSI 1 – display RSSI value on inquiry result
0 – do not display RSSI value on inquiry result; if any further bit is set, a comma is inserted as separator
4 – EIRD 1 – display eird on inquiry result
0 – do not display eird on inquiry result
Table 3.2: Field Descriptions for S Register 330
AT COMMAND SET
REFERENCE