# Perform Bluetooth MAP client functions

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

You can verify Bluetooth MAP 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 MAP functions](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-map.html#bluez-map__section_d2k_zj4_rcc_navyanka_09-11-24-1053-36-11).

## Connect the remote device

To connect a remote device in MAP, 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 `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 mapCopy to clipboard

**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 successfulCopy to clipboard

## List messages in a folder

To list messages in a folder, do the following:

1. [Connect the
                        DUT and the remote device.](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-map-client-functions.html#bluez-perform-bluetooth-map-client-functions__section_ip1_lyk_rcc_navyanka_09-10-24-2331-32-614)
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/msgCopy to clipboard
3. List the messages in the intended folder by running the following command:

        ls <folder_name>Copy to clipboard

    **Example**

To
                        list the inbox messages, run the following command:

        ls inboxCopy to clipboard

    **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/message288230376151711842Copy to clipboard

## Send a message

To send a message, do the following:

1. [Connect the
                        DUT and the remote device.](https://docs.qualcomm.com/doc/80-70017-13/topic/bluez-perform-bluetooth-map-client-functions.html#bluez-perform-bluetooth-map-client-functions__section_ip1_lyk_rcc_navyanka_09-10-24-2331-32-614)
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 outboxCopy to clipboard
3. Ensure that the message is present in the outbox folder. If
                    the message is not 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:BMSGCopy to clipboard
4. Send the message by running the following command from the
                        `obexctl` menu:

        send <message_filename>Copy to clipboard

    **Parameters**

    `<message_filename>`
                        is the filename of the message to be sent.

    **Example**

To
                        send map\_file.msg, run the following
                        command:

        send map_file.msgCopy to clipboard

    **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/transfer147Copy to clipboard

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

Last Published: Dec 26, 2024

[Previous Topic
Perform Bluetooth MAP server functions](https://docs.qualcomm.com/bundle/publicresource/80-70017-13/topics/bluez-perform-bluetooth-map-server-functions.md) [Next Topic
Verify functionality of Fluoride stack](https://docs.qualcomm.com/bundle/publicresource/80-70017-13/topics/bluetooth_usecases.md)