servicediscoveryandcontrol/pnp/test/upnp/Client/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 #include <cpnpservicepublisherbase.h>
       
    20 
       
    21 /**
       
    22 A generic class which provides the functionality, to be implemented by a service point to service the remote clients.
       
    23 @publishedPartner
       
    24 @prototype
       
    25 */
       
    26 class RPnPServicePublisher
       
    27 {
       
    28 	public:
       
    29 	/**
       
    30 	Default constructor
       
    31 	*/
       
    32 	IMPORT_C RPnPServicePublisher ( );
       
    33 
       
    34 	/**
       
    35 	Resolves the access point.
       
    36 	@param aTierID implementation UID. Identifies technology for which service discovery is requested.
       
    37 	@return KErrNone if successful. Returns system wide error codes on failure
       
    38 	*/
       
    39 	IMPORT_C TInt Open (TUint aTierId );
       
    40 
       
    41 	/**
       
    42 	Publishes service notifications to remote clients. The technology specific service information
       
    43 	is packed in aServiceInfo.
       
    44 	Note that a service point will only publish a single device or service.Consequently only one
       
    45 	parameter set must be sent in the bundle.Also once published,the service point must be closed
       
    46 	before another publish is done.
       
    47 	
       
    48 	The uris for device or service publish must conform to the schema specified in UPnP Device Architecture 1.0
       
    49 
       
    50 	When the responses are received, MPnPObserver::OnPnPEventL is called for each response and calling clients
       
    51 	must provide the implementation to handle the responses.
       
    52 
       
    53 	In case of corrupted uris or value fields or low memory conditions, MPnPObserver::OnPnPError is called
       
    54 	synchronously which must be handled by the client
       
    55 
       
    56 	In UPnP implementation the publish notifications are sent to SSDP multicast address on UDP channel.
       
    57 	@param Parameter bundle containing service information.
       
    58 	
       
    59 	@panic 1 The RPnPServiceDiscovery::Open() has not been called
       
    60 	@panic 2 Invalid observer object supplied. It may be null or corrupted
       
    61 	@panic 3 More than one family supplied in bundle
       
    62 	@panic 4 Invalid family
       
    63 	@panic 5 No parameter set used
       
    64 	*/
       
    65 	IMPORT_C void Publish ( const RPnPParameterBundle& aServiceInfo );
       
    66 
       
    67 	/**
       
    68 	Sends service notification to remote clients who've subscribed to the service/device
       
    69 
       
    70 	No responses are received in MPnPObserver::OnPnPEventL and MPnPObserver::OnPnPError is also not called
       
    71 	@param Parameter bundle contains the technology specific information.
       
    72 	
       
    73 	@panic 1 The RPnPServiceDiscovery::Open() has not been called
       
    74 	@panic 3 More than one family supplied in bundle
       
    75 	@panic 4 Invalid family
       
    76 	@panic 5 No parameter set used
       
    77 	*/
       
    78 	IMPORT_C void SendNotify ( const  RPnPParameterBundle & aServiceInfo );
       
    79 
       
    80 	/**
       
    81 	 Starts the Connection and attaches the sub-connection to it.This also
       
    82 	 creates the socket and enables it to send and receive messages.
       
    83 	 @return KErrNone if successful. Returns system wide error codes on failure
       
    84 	 */
       
    85 	IMPORT_C TInt InitiateControl ( RControlChannel& aControlChannel );
       
    86 
       
    87 	/**
       
    88 	Close technology specific session.
       
    89 	In UPnP it sends SSDP::ByeBye notifications to SSDP multicast adress.
       
    90 	*/
       
    91 	IMPORT_C void Close ( );
       
    92 
       
    93 	private:
       
    94 		 CPnPServicePublisherBase* iUPnPServicePublisherImpl;
       
    95 		 
       
    96 };
       
    97 
       
    98 #endif //__RPNPPSERVICEPUBLISHER_H__