# Perform Bluetooth SPP server functions

You can perform SPP server functions using the `spp_server_menu`
options.

Before you begin, set up the device and go to the SPP server menu as described in [Set up device for Bluetooth SPP functions](https://docs.qualcomm.com/doc/80-70018-13/topic/set_up_bluetooth_in_spp.html#context-bgp-lts-s1c).

## Configure DUT in SPP server role

To configure the DUT in an SPP server role, do the following:

1. Start the server connection by running the following command:

start_server
        Copy to clipboard
2. Initiate a connection from the remote device SPP client application.

    **Sample output**

    The following sample output shows that the SPP server connection has been established successfully:

start server
        ACL state:0 change with reason 00 for device: 22:22:85:3d:2e:50
        Device is Connected
        ----------------------
        Device Address       : 22:22:85:3d:2e:50
        Connection Direction : Server
        Copy to clipboard

## Send a file in the server role

To send a file in the server role, do the following:

1. Set the remote device in Receive mode in the SPP application, if applicable.
2. Create a test file with some sample data and place the file in the `/etc/bluetooth` directory of the DUT.

    For example, create a test file `bt_stack.conf`.
3. Send the test file to the remote device by running the following command:

send_file <directory_with_file_name>
        Copy to clipboard

    **Parameters**

    `<directory_with_file_name>` is the complete file path with the filename.

    **Example**

    To send the test file `bt_stack.conf` at `/etc/bluetooth`, run the following command:

send_file /etc/bluetooth/bt_stack.conf
        Copy to clipboard

    **Sample output**

send_file /etc/bluetooth/bt_stack.conf
        File Transfer Complete
        ----------------------
        Device Address : 22:22:85:3d:2e:50
        File Name      : /etc/bluetooth/bt_stack.conf
        Copy to clipboard

Note

If an issue occurs, disconnect the operation from the SPP client application on the remote device, and stop the SPP server in the DUT by running the following command:

stop_server
        Copy to clipboard
4. Verify the status of file reception on the remote application.

## Receive a file in server role

To receive a file in the server role, do the following:

1. Set the DUT in Receive mode.
2. Receive a file from the remote device by running the following command:

recv_file <directory_with_file_name>
        Copy to clipboard

    **Parameters**

    `<directory_with_file_name>` is the complete file path with the filename.

Note

To receive a file, use the `/etc/bluetooth` directory only.

    **Example**

    To receive `fileName.txt` at `/etc/bluetooth` from the remote device, run the following command:

recv_file /etc/bluetooth/fileName.txt
        Copy to clipboard
3. Send the file from the remote device SPP server application.
4. Verify the received file as follows:

    1. Open the command prompt window.
    2. Pull the received file by running the following command:

scp -r root@<IP_address>:<source_file_path> <destination_file_path>
            Copy to clipboard

        To pull a file to the current file path, enter the `<destination_file_path>` as `.` in the command.

Note

When prompted for a password, enter `oelinux123` to authenticate the file transfer through the Secure Copy Protocol (SCP).

        **Example**

        The IP address of the device is `10.92.160.222`. To pull `fileName.txt` from `/etc/bluetooth`, run the following command:

scp -r root@10.92.160.222:/etc/bluetooth/fileName.txt .
            Copy to clipboard
    3. Open the received file and verify the data.
5. Disconnect operation from the remote device SPP client application, and stop the SPP server in DUT by running the following command:

stop_server
        Copy to clipboard

Note

All devices of a particular development kit have the same default MAC address.

Last Published: Apr 02, 2025

[Previous Topic
Serial Port Profile](https://docs.qualcomm.com/bundle/publicresource/80-70018-13/topics/set_up_bluetooth_in_spp.md) [Next Topic
Perform Bluetooth SPP client functions](https://docs.qualcomm.com/bundle/publicresource/80-70018-13/topics/perform_bluetooth_functions_in_spp_client.md)