Skip to main content

Prerequisites

Before you begin, set up the device as described in Set up the device for Bluetooth PBAP functions.

Connect the remote device

To connect a remote device in PBAP, run the following command from the obexctl menu:
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:
connect F8:7D:76:9D:9B:6B pbap
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]#

Select a phone book object

To select a phone book object, run the following command from the obexctl menu:
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:
cd pb
Sample output
[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. Connect the DUT and the remote device.
  2. Select the intended phone book.
  3. Pull the intended phone book by running the following command:
    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:
    cp *.vcf contact.vcf
    
    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]#
    
  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.
  2. Select the intended phone book.
  3. Get the size of the intended phone book by running the following command:
    ls -l
    
    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/transfer5
    

Search for a contact

To search for a contact by name or number, do the following:
  1. Connect the DUT and the remote device.
  2. Select the intended phone book.
  3. Search for the contact by running the following command:
    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:
    ls BT
    
    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/transfer7