> ## 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 MAP client functions

> You can verify Bluetooth MAP client functionality using the commands provided in the main menu of ``obexctl``. Bluetooth MAP client functions allow you to connect to remote device, send a message, and list all messages on the device.

## Prerequisites

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

## Connect the remote device

To connect a remote device in MAP, 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 `map`.

**Example**

To connect to a remote device with `<bt_address>` `22:22:23:DB:F2:4A`, run the following command:

```text theme={null}
connect 22:22:23:DB:F2:4A map
```

**Sample output**

```text theme={null}
#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. <a href="perform-bluetooth-pbap-client-functions#connect-the-remote-device" target="_self">Connect the DUT and the remote device.</a>

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:

   ```text theme={null}
   cd telecom/msg
   ```

3. List the messages in the intended folder by running the following command:

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

   **Example**

   To list the `inbox` messages, run the following command:

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

   **Sample output**

   ```text theme={null}
   [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. <a href="perform-bluetooth-pbap-client-functions#connect-the-remote-device" target="_self">Connect the DUT and the remote device.</a>

2. Change the current directory to the outbox directory.

   **Example**

   To change the directory to `outbox`, run the following command from the `obexctl` menu:

   ```text theme={null}
   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:

   ```text theme={null}
   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:

   ```text theme={null}
   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:

   ```text theme={null}
   send map_file.msg
   ```

   **Sample output**

   ```text theme={null}
   [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
   ```
