# Perform Bluetooth PBAP client functions

Source: [https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-pbap-client-functions.html](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-pbap-client-functions.html)

You can verify Bluetooth PBAP client functionality using the commands provided in the
        main menu of obexctl.

Before you begin, set up the device as described in [Set up device for Bluetooth PBAP functions](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-pbap.html#bluez-pbap__section_h2k_3dh_rcc_navyanka_09-10-24-1056-45-735).

## Connect the remote device

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

    connect <bt_address> <profile_name>Copy to clipboard

**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:

    connect F8:7D:76:9D:9B:6B pbapCopy to clipboard

**Sample output**

[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]#Copy to clipboard

## Select a phone book object

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

    cd <phonebook_object>Copy to clipboard

**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:

    cd pbCopy to clipboard

**Sample output**

[F8:7D:76:9D:9B:6B]# cd pb
    Attempting to Select to pb
    Select successful
    [F8:7D:76:9D:9B:6B]#Copy to clipboard

## Pull a phone book

To pull a phone book, do the following:

1. [Connect the
                        DUT and the remote device.](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-pbap-client-functions.html#bluez-perform-bluetooth-pbap-client-functions__section_ip1_lyk_rcc_navyanka_09-10-24-2331-32-614)
2. [Select the intended phone book.](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-pbap-client-functions.html#bluez-perform-bluetooth-pbap-client-functions__section_xnb_dzk_rcc_navyanka_09-10-24-2336-49-621)
3. Pull the intended phone book by running the following command:

        cp <source file> <destination file>Copy to clipboard

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

    **Parameters**

    - `<source file>` is the phone book to be pulled.
    - `<destination file>` is the file into which the phone
                            book must be pulled.

    **Example**

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

        cp *.vcf contact.vcfCopy to clipboard

    **Sample                            output**

[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]#Copy to clipboard
4. Open and verify the phone book.

## Get phone book size

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

1. [Connect the
                        DUT and the remote device.](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-pbap-client-functions.html#bluez-perform-bluetooth-pbap-client-functions__section_ip1_lyk_rcc_navyanka_09-10-24-2331-32-614)
2. [Select the
                        intended phone book.](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-pbap-client-functions.html#bluez-perform-bluetooth-pbap-client-functions__section_xnb_dzk_rcc_navyanka_09-10-24-2336-49-621)
3. Get the size of the intended phone book by running the following command:

        ls -lCopy to clipboard

    **Sample                            output**

         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/transfer5Copy to clipboard

## Search for a contact

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

1. [Connect the
                        DUT and the remote device.](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-pbap-client-functions.html#bluez-perform-bluetooth-pbap-client-functions__section_ip1_lyk_rcc_navyanka_09-10-24-2331-32-614)
2. [Select the
                        intended phone book.](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-pbap-client-functions.html#bluez-perform-bluetooth-pbap-client-functions__section_xnb_dzk_rcc_navyanka_09-10-24-2336-49-621)
3. Search for the contact by running the following
                        command:

        ls <name_or_number>Copy to clipboard

    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:

        ls BTCopy to clipboard

    **Sample                            output**

# 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/transfer7Copy to clipboard

**Parent Topic:** [Phone Book Access Profile](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-pbap.html)

Last Published: Dec 26, 2024

[Previous Topic
Perform Bluetooth PBAP server functions](https://docs.qualcomm.com/bundle/publicresource/80-70017-13/topics/bluez-perform-bluetooth-pbap-server-functions.md) [Next Topic
Message Access Profile](https://docs.qualcomm.com/bundle/publicresource/80-70017-13/topics/bluez-map.md)