Create an
instance of the CLlcpProvider
class, which provides
services to listen to LLCP related events and creates connection objects
between the local and remote devices.
Add an LLCP-link listener and a connection-oriented-request listener to listen to the LLCP-link status, as shown in the following code snippet:
Example:
// CMyOwnLlcpApplication::Start() // ----------------------------------------------------------------------------- // void CMyOwnLlcpApplication::Start() { if ( !iStarted ) { // Adding an LLCP link listener iLlcp->AddLlcpLinkListenerL( *this ); // Adding a listener to SSAP 35. If any connection-oriented transport // messages is sent to SSAP 35, this listener will handle them. iLlcp->StartListeningConnOrientedRequestL( *this, KInterestingSsap ); iStarted = ETrue; } } // ----------------------------------------------------------------------------- // End of CMyOwnLlcpApplication::Start()
The CMyOwnLlcpApplication
object waits for
notifications after the LLCP link between the local and the remote
devices is established. CMyOwnLlcpApplication
is
also notified when connection-oriented requests with SSAP 35 (Source Service Access Point) are received.
Remove all
listeners from the CLlcpProvider
instance.
Example:
// CMyOwnLlcpApplication::Stop() // ----------------------------------------------------------------------------- // void CMyOwnLlcpApplication::Stop() { if ( iStarted ) { // Stopping listening to LLCP link iLlcp->RemoveLlcpLinkListener(); // Stopping listening to SSAP 35. iLlcp->StopListeningConnOrientedRequest( KInterestingSsap ); iStarted = EFalse; Cleanup(); } } // ----------------------------------------------------------------------------- // End of CMyOwnLlcpApplication::Stop()
The following diagram illustrates how to prepare and use the LLCP stack:
Figure: Sequence diagram for preparing to use LLCP stack