Important: Before you run this example, make sure to program the SoftDevice .
The Object Transfer Service (OTS) server application is a peripheral role example that implements an Object Transfer Service server. For more information about the Object Transfer service implementation, see Experimental: Object Transfer Service Server .
When the application device connects to a peer, they establish L2CAP channel reserved for OTS. The OTS client will request to write an object. The request is done by writing to the Object Action Control Point (0x2AC5) over GATT. If the write is accepted by the server, the data will be transfered over the L2CAP channel established earlier. An event is triggered on the server-side application when the write is complete.
- Note
- This application is not power optimized!
Setup
You can find the source code and the project file of the example in the following folder:
<InstallFolder>\examples\ble_peripheral\experimental\ble_app_ots
Button assignments: BSP BLE Button Assignments
Testing
Two boards are needed to perform this test:
- Client board : nRF5 development board containing the SoftDevice and the Experimental: Object Transfer Service client Example .
- Server board : nRF5 development board containing the SoftDevice.
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
- Compile and program the application on the Server board. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
- Verify that the second device is set up as the Client board. Observe that the BSP_INDICATE_CONNECTED state is indicated. The connection will also be confirmed on UART.
- Verify that the features of the server are printed on UART of the client application. (Similar to the example UART output ).
- Observe in the UART output that the L2CAP channel has been established.
- Press Button 1 on the Client to transfer an object. On the server application side UART, verify that the object is printed. (01 02 03 04 ... 61 62 63)
- Press Button 2 on the Client to read the object that was transferred in the previous step. On the client application side UART, verify that the object is printed. (01 02 03 04 ... 61 62 63)