Transferring and Receiving the "Hello World!" ASCII Text Using the LLCP Stack (Connection-Oriented)

This section describes how to utilize the LLCP stack to perform a connection-oriented transfer and receipt of the "Hello World!" ASCII text, to and from a remote device.

Context

COwnLlcpConnection is a wrapper for the MLlcpConnOrientedTransporter interface, which is used to transfer and receive data to and from a remote device.

Note: In this "Hello World!" example, one COwnLlcpConnection object is restricted to either transferring data or receiving data. To transfer data and receive data simultaneously, two COwnLlcpConnection objects are required.

CMyOwnLlcpApplication is an example class, which can send and receive the "Hello World!" ASCII text to and from a remote device. CMyOwnLlcpApplication uses two COwnLlcpConnection objects to transfer and receive data. iLocalConnection and iRemoteConnection member variables are used to transfer and receive data, respectively. MLlcpReceiveCb is an internal interface for COwnLlcpConnection.

MLlcpEventUpdater provides an interface for the application framework to get notifications from CMyOwnLlcpApplication.

Refer to the connorientedtransporterexample.h header file for more information. The following class diagram illustrates the relationship between the interfaces:

Figure: Class diagram of LLCP connection-oriented transport example

Prerequisites

Before you begin, refer to the following header files and NFC libraries:

  • llcpprovider.h
  • llcpconnorientedtransporter.h
  • llcpconnorientedlistener.h
  • llcplinklistener.h
  • nfc.lib
  • llcp.lib

Related information