> 17.11 | AT^SPBS Step through the selected phonebook alphabetically

> AT^SPBS can be used to scroll sequentially through the active phonebook records in alphabetical order by name. Three entries will be displayed at a time.
> Every time the write command is executed, 3 rows of phonebook records are returned. Each triplet overlaps with the next one. The actual index depends on parameter <value>. This parameter determines whether the index will be increased or decreased.
> If the index in one output line reaches the last index in the alphabetical list, the next output line will display the first list entry.
> After the last record of the phonebook has been reached (see parameter <used> for AT^SPBG), the <internal-counter> switches over to the first.
> There are two ways to use AT^SPBS:

> • | If the optional parameter <RealLocReq> is omitted or (0) the sorted entries will be sequentially numbered. As these numbers are not identical with the location numbers stored in the various phonebooks AT^SPBS can be used for reading only. For example, it helps you find entries starting with matching characters. Do not use the serial numbers to dial out or modify entries.

> • | If parameter <RealLocReq>=1 is given by the write command, the response parameter <location> additionally appended to each entry indicates the actual location number. This number can be used for editing with AT+CPBW or dialing with ATD><mem><n>. The first index number of each entry is only the serial number of the sorted list.

> See examples below.
> Syntax

> Test Command AT^SPBS=?
> Response(s)
> ^SPBS: (list of supported <value>)
> OK

> Write Command AT^SPBS=<value>[, <RealLocReq>]
> Response(s)
> ^SPBS: <index-a>, <number>, <type>, <text>[, <location>]
> ^SPBS: <index-b>, <number>, <type>, <text>[, <location>]
> ^SPBS: <index-c>, <number>, <type>, <text>[, <location>]
> OK
> +CME ERROR

> Reference(s) |  | PIN |  | ASC0 | ASC1 | USB | MUX1 | MUX2 | MUX3 |  |  | Charge | Q | Last
> SIEMENS |  | + |  | + | + | + | + | + | + |  |  | - | + | -

> Parameter Description

> <value>(num)

> 1
> To make a step forward in the alphabetically sorted phonebook.
> 2
> To make a step backward in the alphabetically sorted phonebook.

> <index-a>(num)

> 1...maxindex
> The index in the sorted list of phonebook entries that identifies the first entry displayed.
> The value of <index-a> is determined by the value of the <internal-counter> and by parameter <value>.
> After a write command has terminated successfully with "OK", the value from parameter <index-a> is saved and retained as the new <internal-counter> value.
> Mind after the last record of phonebook, the first entry follows.

> <index-b>(num)

> 1...maxindex
> The index in the sorted list of phonebook entries that identifies the second entry displayed.
> <index-b>= (<index-a>+1).
> Mind after the last record of phonebook, the first entry follows.

> <index-c>(num)

> 1...maxindex
> The index in the sorted list of phonebook entries that identifies the third entry displayed.
> <index-c>= (<index-b>+1).
> Mind after the last record of phonebook, the first entry follows.

> <number>(str)

> String type phone number in format specified by <type>.
> the number parameter may be an empty string.

> <type>(num)

> Type of address octet, which defines the used type of number (ton) and the numbering plan identification (npi).
> Please consider that for types other than 129 or 145 dialing from phonebook with ATD><mem><n> is, depending on the network, not always possible (refer to GSM 04.08 subclause 10.5.4.7 for details). See also <type> of AT+CPBW.
> Possible values are:
> 145
> Dialing string <number> includes international access code character '+'
> 161
> National number. Network support of this type is optional.
> 209
> Dialing string <number> has been saved as ASCII string and includes non-digit characters other than "*", "#" or "+". Note that phonebook entries saved with this type cannot be dialed.
> 255
> Dialing string <number> is a command to control a Supplementary Service, i.e. "*", "#" codes are contained. Network support of this type is optional.
> 129
> Otherwise

> <text>(str)(+CSCS)

> Text assigned to the phone number.

> <RealLocReq>(num)

> Is a display of the "real" <location> of the entry required?
> [0]
> Do not show an entry's "real" location number. Parameter <location> will not be displayed
> 1
> Show the "real" location number as parameter <location> at the end of the entry

> <location>(num)

> The location within phonebook memory at which the corresponding entry is located.
> This location may be used for other phonebook commands (e.g. AT+CPBR, AT+CPBW, ATD><mem><n>).

> <internal-counter>(num)

> 0(&F)...maxindex
> This parameter is only an internal parameter and cannot modified directly.
> The internal counter will be reset to index 0 after a call to ATZ or AT&F.
> Notes

> • | The complete list of sorted entries can be retrieved using AT command AT^SPBG.

> • | The command can be used for the phonebooks "SM", "FD", "ME" (cf. AT+CPBS).

> • | Users should be aware that when using this AT command quickly after SIM PIN authentication the SIM data may not yet be accessible, resulting in a short delay before the requested AT command response is returned. See Section 23.1, Restricted access to SIM data after SIM PIN authentication for further detail.

> Examples

> EXAMPLE 1 | This example illustrates how to search down and up again using AT^SPBS=1 and 2:

> at&f | First, AT&F is issued to make sure that AT^SPBS=1 starts from the first character in alphabetical order.
> OK
> at^spbs=1 ^SPBS:1,"+999999",145,"Arthur" ^SPBS:2,"+777777",145,"Bill" ^SPBS:3,"+888888",145,"Charlie" OK
> at^spbs=1 ^SPBS:2,"+777777",145,"Bill" ^SPBS:3,"+888888",145,"Charlie" ^SPBS:4,"0304444444",129,"Esther" OK
> at^spbs=1 ^SPBS:3,"+888888",145,"Charlie" ^SPBS:4,"0304444444",129,"Esther" ^SPBS:5,"03033333333",129,"Harry" OK
> at^spbs=2 ^SPBS:2,"+777777",145,"Bill" ^SPBS:3,"+888888",145,"Charlie" ^SPBS:4,"0304444444",129,"Esther" OK

> EXAMPLE 2 | This example shows that when the last index in the sorted list has been reached, the internal counter overflows to the first index.

> at&f | Reset internal counter to 0.
> OK
> at^spbs=2 | Step down one entry starting from (internal counter)=0 - overflow occurs.
> ^SPBS:33,"+49301234567",145,"TomTailor" ^SPBS:1,"+999999",145,"Arthur" ^SPBS:2,"+777777",145,"Bill" OK

> EXAMPLE 3 | Using AT^SPBS with <RealLocReq>=1 in order to obtain the entries' location numbers:

> at^spbs=1,1 ^SPBS:1,"+999999",145,"Arthur",27 ^SPBS:2,"+777777",145,"Bill",6 ^SPBS:3,"+888888",145,"Charlie",15

> The numbers at the end of each line are the memory locations in the phonebook and can be used for dialing or editing phonebook entries:

> at+cpbr=27 | Read out phonebook location 27.
> +CPBR: 27,"+999999",145,"Arthur" | This entry can be edited with AT+CPBW or used for dialing with ATD><mem><n>.