servicediscoveryandcontrol/pnp/inc/rpnpservicepublisher.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef __RPNPPSERVICEPUBLISHER_H__
       
    18 #define __RPNPPSERVICEPUBLISHER_H__
       
    19 
       
    20 #include <e32base.h>
       
    21 
       
    22 class RControlChannel;
       
    23 class CPnPServicePublisherBase;
       
    24 class RPnPParameterBundle;
       
    25 
       
    26 
       
    27 /**
       
    28 A generic class which provides the functionality, to be implemented by a service point to service the remote clients.
       
    29 @publishedPartner
       
    30 @prototype
       
    31 */
       
    32 class RPnPServicePublisher
       
    33    {
       
    34 	public:
       
    35 	/**
       
    36 	Default constructor
       
    37 	*/
       
    38 	IMPORT_C RPnPServicePublisher ( );
       
    39 
       
    40 	/**
       
    41 	Resolves the access point.
       
    42 	@param aTierID implementation UID. Identifies technology for which service discovery is requested.
       
    43 	@return KErrNone if successful. Returns system wide error codes on failure
       
    44 	*/
       
    45 	IMPORT_C TInt Open (TUint aTierId );
       
    46 
       
    47 	/**
       
    48 	Publishes service notifications to remote clients. The technology specific service information
       
    49 	is packed in aServiceInfo.
       
    50 	Note that a service point will only publish a single device or service.Consequently only one
       
    51 	parameter set must be sent in the bundle.Also once published,the service point must be closed
       
    52 	before another publish is done.
       
    53 	
       
    54 
       
    55 	When the responses are received, MPnPObserver::OnPnPEventL is called for each response and calling clients
       
    56 	must provide the implementation to handle the responses.
       
    57 
       
    58 	In case of corrupted uris or value fields or low memory conditions, MPnPObserver::OnPnPError is called
       
    59 	synchronously which must be handled by the client
       
    60 
       
    61 	@param Parameter bundle containing service information.		
       
    62 	*/
       
    63 	IMPORT_C void Publish ( const RPnPParameterBundle& aServiceInfo );
       
    64 
       
    65 	/**
       
    66 	Sends service notification to remote clients who've subscribed to the service/device
       
    67 
       
    68 	No responses are received in MPnPObserver::OnPnPEventL and MPnPObserver::OnPnPError is also not called
       
    69 	@param Parameter bundle contains the technology specific information.	
       
    70 	*/
       
    71 	IMPORT_C void SendNotify ( const  RPnPParameterBundle & aServiceInfo );
       
    72 
       
    73 	/**	  
       
    74 	 It enables to send and receive messages.
       
    75 	 @return KErrNone if successful. Returns system wide error codes on failure.	 
       
    76 	 */
       
    77 	IMPORT_C TInt InitiateControl ( RControlChannel& aControlChannel );
       
    78 
       
    79 	/**
       
    80 	Close technology specific session.
       
    81 	*/
       
    82 	IMPORT_C void Close ( );
       
    83 
       
    84 	private:
       
    85 		 CPnPServicePublisherBase* iPnPServicePublisherImpl;		 
       
    86     };
       
    87 
       
    88 #endif /*__RPNPPSERVICEPUBLISHER_H__*/