Skip to main content

Prerequisites

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

Connect the remote device

To connect a remote device in MAP, 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 map.
Example To connect to a remote device with <bt_address> 22:22:23:DB:F2:4A, run the following command:
connect 22:22:23:DB:F2:4A map
Sample output
#connect 22:22:23:DB:F2:4A map
Attempting to connect to 22:22:23:DB:F2:4A
[NEW] Session /org/bluez/obex/client/session23 [default]
[NEW] MessageAccess /org/bluez/obex/client/session23
[NEW] Transfer /org/bluez/obex/client/session23/transfer149
Connection successful

List messages in a folder

To list messages in a folder, do the following:
  1. Connect the DUT and the remote device.
  2. Change the current directory to the intended directory. Example If the message folder is at telecom/msg, run the following command from the obexctl menu:
    cd telecom/msg
    
  3. List the messages in the intended folder by running the following command:
    ls <folder_name>
    
    Example To list the inbox messages, run the following command:
    ls inbox
    
    Sample output
    [22:22:23:DB:F2:4A]# ls inbox
    Attempting to ListMessages
    [NEW] Transfer /org/bluez/obex/client/session22/transfer141
    [CHG] Transfer /org/bluez/obex/client/session22/transfer141 Status: complete
    [NEW] Message /org/bluez/obex/client/session22/message288230376151711846
    [NEW] Message /org/bluez/obex/client/session22/message288230376151711844
    [NEW] Message /org/bluez/obex/client/session22/message288230376151711842
    

Send a message

To send a message, do the following:
  1. Connect the DUT and the remote device.
  2. Change the current directory to the outbox directory. Example To change the directory to outbox, run the following command from the obexctl menu:
    cd outbox
    
  3. Ensure that the message is present in the outbox folder. If the message isn’t present, create one. Example You can create a BMSG file called map_file.msg with the following content:
    BEGIN:BMSG
    VERSION:1.0
    STATUS:UNREAD
    TYPE:SMS_GSM
    FOLDER:outbox
    NOTIFICATION:1
    BEGIN:VCARD
    VERSION:2.1
    N:QCOM-BTD
    END:VCARD
    BEGIN:BENV
    BEGIN:VCARD
    VERSION:2.1
    N:null;;;;
    TEL:123-456-7890
    END:VCARD
    BEGIN:BBODY
    CHARSET:UTF-8
    LENGTH:50
    BEGIN:MSG
    Hello from client side
    END:MSG
    END:BBODY
    END:BENV
    END:BMSG
    
  4. Send the message by running the following command from the obexctl menu:
    send <message_filename>
    
    Parameters <message_filename> is the filename of the message you intend to send. Example To send map_file.msg, run the following command:
    send map_file.msg
    
    Sample output
    [22:22:23:DB:F2:4A]# send map_file.msg
    Attempting to send map_file.msg to /org/bluez/obex/client/session22
    [NEW] Transfer /org/bluez/obex/client/session22/transfer147
    Transfer /org/bluez/obex/client/session22/transfer147
       Status: queued
       Name :
       Size: 322
       Filename: map_file.msg
       Session: /org/bluez/obex/client/session22
    [CHG] Transfer /org/bluez/obex/client/session22/transfer147 Status: complete
    [DEL] Transfer /org/bluez/obex/client/session22/transfer147