> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Perform Bluetooth PBAP client functions

> You can verify Bluetooth PBAP client functionality using the commands provided in the main menu of ``obexctl``. Bluetooth PBAP client functions include connecting to a remote device and selecting a phone book object. You can pull an entire phone book, retrieve the phone book size, and search for a specific contact using PBAP client functions.

## Prerequisites

Before you begin, set up the device as described in <a href="verify-pbap-functions#set-up-the-device-for-bluetooth-pbap-functions" target="_self">Set up the device for Bluetooth PBAP functions</a>.

## Connect the remote device

To connect a remote device in PBAP, run the following command from the `obexctl` menu:

```text theme={null}
connect <bt_address> <profile_name>
```

**Parameters**

* `<bt_address>` is the Bluetooth address of the remote device.

* `<profile_name>` is `pbap`.

**Example**

To connect to a remote device with `<bt_address>` `F8:7D:76:9D:9B:6B`, run the following command:

```text theme={null}
connect F8:7D:76:9D:9B:6B pbap
```

**Sample output**

```text theme={null}
[obex]# connect F8:7D:76:9D:9B:6B pbap
Attempting to connect to F8:7D:76:9D:9B:6B
[NEW] Session /org/bluez/obex/client/session1 [default]
[NEW] PhonebookAccess /org/bluez/obex/client/session1
Connection successful
[F8:7D:76:9D:9B:6B]#
```

## Select a phone book object

To select a phone book object, run the following command from the `obexctl` menu:

```text theme={null}
cd <phonebook_object>
```

**Parameters**

`<phonebook_object>` can be:

* `pb` for the phone book.

* `ich` for the incoming call history.

* `och` for the outgoing call history.

* `mch` for the missed call history.

* `cch` for the history of incoming, outgoing, and missed calls.

* `spd` for the speed dial contacts.

* `fav` for the favorite contacts.

**Example**

To select the entire phone book, run the following command from the `obexctl` menu:

```text theme={null}
cd pb
```

**Sample output**

```text theme={null}
[F8:7D:76:9D:9B:6B]# cd pb
Attempting to Select to pb
Select successful
[F8:7D:76:9D:9B:6B]#
```

## Pull a phone book

To pull a phone book, do the following:

1. <a href="#connect-the-remote-device" target="_self">Connect the DUT and the remote device.</a>

2. <a href="#select-a-phone-book-object" target="_self">Select the intended phone book.</a>

3. Pull the intended phone book by running the following command:

   ```text theme={null}
   cp <source file> <destination file>
   ```

   The file is stored at the root directory or at the `/var/bluetooth/` directory.

   **Parameters**

   * `<source file>` is the phone book you intend to pull.

   * `<destination file>` is the file into which you must pull the phone book.

   **Example**

   To pull `*.vcf` to `contact.vcf`, run the following command:

   ```text theme={null}
   cp *.vcf contact.vcf
   ```

   **Sample output**

   ```text theme={null}
   [F8:7D:76:9D:9B:6B]# cp *. vcf contact.vcf
   Attempting to PullAll
   [NEW] Transfer /org/bluez/obex/client/session2/transfer22
   PullAll successful
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Status: active
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 23976 (@23KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 79920 (@55KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 130536 (@50KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 175824 (@45KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 229184 (@53KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 281052 (@51KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 336330 (@55KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 382284 (@45KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 478188 (095KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 615384 (@137KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 691974 (@76KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 740592 (@48KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 786546 (@45KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 829836 (@43KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 877122 (047KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 925074 (047KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 972360 (@47KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 1082250 (@109KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 1206126 (@123KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 1337328 (@131KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Transferred: 1347984 (@10KB/s)
   [CHG] Transfer /org/bluez/obex/client/session2/transfer22 Status: complete
   [DEL] Transfer /org/bluez/obex/client/session2/transfer22
   [F8:7D:76:9D:9B:6B]#
   ```

4. Open and verify the phone book.

## Get phone book size

To get the size of a phone book, do the following:

1. <a href="#connect-the-remote-device" target="_self">Connect the DUT and the remote device.</a>

2. <a href="#select-a-phone-book-object" target="_self">Select the intended phone book.</a>

3. Get the size of the intended phone book by running the following command:

   ```text theme={null}
   ls -l
   ```

   **Sample output**

   ```text theme={null}
   Attempting to GetSize
            [NEW] Transfer /org/bluez/obex/client/session1/transfer4
            [CHG] Transfer /org/bluez/obex/client/session1/transfer4 Status: complete
                  Size: 0x0006
            Attempting to List
            [DEL] Transfer /org/bluez/obex/client/session1/transfer4
            [NEW] Transfer /org/bluez/obex/client/session1/transfer5
            [CHG] Transfer /org/bluez/obex/client/session1/transfer5 Status: complete
            0.vcf: MyContact1
            1.vcf: MyContact2
            2.vcf: MyContact3
            3.vcf: MyContact4
            4.vcf: MyContact5
            5.vcf: MyContact6
         [DEL] Transfer /org/bluez/obex/client/session1/transfer5
   ```

## Search for a contact

To search for a contact by name or number, do the following:

1. <a href="#connect-the-remote-device" target="_self">Connect the DUT and the remote device.</a>

2. <a href="#select-a-phone-book-object" target="_self">Select the intended phone book.</a>

3. Search for the contact by running the following command:

   ```text theme={null}
   ls <name_or_number>
   ```

   The contact file appears.

   **Parameters**

   `<name_or_number>` is the contact name or number.

   **Example**

   To search for a contact called `BT` in a phone book, run the following command:

   ```text theme={null}
   ls BT
   ```

   **Sample output**

   ```text theme={null}
   # ls BT
         Attempting to Search
      [NEW] Transfer /org/bluez/obex/client/session1/transfer7
      [CHG] Transfer /org/bluez/obex/client/session1/transfer7 Status: complete
         4.vcf: MyContact5
      [DEL] Transfer /org/bluez/obex/client/session1/transfer7
   ```
