nRF5 SDK v15.0.0
IPSP Acceptor Example
This information applies to the following SoftDevice: S132

This example works closely with the IPSP Initiator Example.

The BLE IPSP Acceptor and the BLE IPSP Initiator Examples demonstrate the usage of the L2CAP connection oriented channel, referred to as the LE Credit Mode in the Bluetooth specification. Here, the Acceptor plays the BLE Peripheral role and the Initiator plays the BLE Central role.

The Acceptor advertises until a BLE connection is established. On BLE connection establishment, it waits for the L2CAP channel connection request on the IPSP PSM 35. The Initiator then provides the user with a trigger to initiate both the BLE connection and the L2CAP channel connection by using Buttons 1 and 2, respectively.

On successful channel establishment, which is indicated by BLE_IPSP_EVT_CHANNEL_CONNECTED with a success result, the Acceptor will start sending a packet of MTU size with a specific pattern. Once the Initiator echoes the packet back, the Acceptor sends a new packet with a new pattern. The size of the packet is reduced on every transmission until packet size zero is reached. On reaching zero, the packet size is reset to MTU size.

This transmission continues until channel disconnection or until the Initiator no longer echoes the packet back.

LED assignments:

Setup

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ble_peripheral\ble_app_ipsp_acceptor

Testing

  1. Compile and program the IPSP Initiator Example.
  2. Compile and program the IPSP Acceptor example.
  3. Start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
    • Baud rate: 115.200
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: None
  4. Notice that LED 1 on the Acceptor board is lit.
  5. Press Button 1 on the Initiator board to establish a GAP connection.
  6. Notice that LED 2 on both boards is lit and that LED 1 on the Acceptor board is off.
  7. Press Button 2 on the Initiator board to establish an IPSP connection.
  8. Observe in the terminal software that packets are transmitted between boards.
  9. Press Button 4 on the Initiator board to disconnect the IPSP connection.
  10. Press Button 3 on the Initiator board to disconnect te GAP connection.

Documentation feedback | Developer Zone | Subscribe | Updated