smf/smfservermodule/smfclient/smfclientsymbian.cpp
author cgandhi
Thu, 23 Sep 2010 17:43:31 +0530
changeset 25 a180113055cb
parent 18 013a02bf2bb0
child 26 83d6a149c755
permissions -rw-r--r--
Music Events are now normal Fetcher APIs added All APIs now return SmfError Canceling Request now supported Music Search now based on category Providerinfo added in DSM Added secondary ID, count, location to SMFAlbum Tags for Artist added Get tracks for album and artist added Added URL to subtitle DSM Bug fixes Detailed debugging logs filtered in server, pluginmgr, transportmgr playlistsOf() method changed in smfclient and plugin interfaces. RVCT B686 compilation issues resolved.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     1
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     2
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     3
 * All rights reserved.
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0" 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     6
 * which accompanies  this distribution, and is available
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     8
 *
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
     9
 * Initial Contributors:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    10
 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    11
 *
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    12
 * Contributors:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    13
 * Manasij Roy, Nalina Hariharan
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    14
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    15
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    16
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    17
#include <e32cmn.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    18
#include <QtGlobal>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    19
#include <e32svr.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    20
#include <e32base.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    21
#include <QByteArray>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    22
#include <qdebug.h>
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    23
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    24
#include "smfclientsymbian.h"
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    25
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    26
// Function Declaration - For starting the server process
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    27
static TInt StartServerL();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    28
static TInt CreateServerProcessL();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    29
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    30
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    31
CSmfClientSymbian* CSmfClientSymbian::NewL(smfObserver* aObserver )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    32
    {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    33
	CSmfClientSymbian* self = NewLC( aObserver );
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    34
    CleanupStack::Pop( self );
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    35
    return( self ) ;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    36
    }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    37
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    38
CSmfClientSymbian* CSmfClientSymbian::NewLC(smfObserver* aObserver )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    39
    {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    40
	CSmfClientSymbian* self = new ( ELeave ) CSmfClientSymbian( aObserver );
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    41
    CleanupStack::PushL( self );
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    42
    self->ConstructL();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    43
    return self;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    44
    }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    45
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    46
CSmfClientSymbian::CSmfClientSymbian(smfObserver* aObserver)
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    47
		: CActive( EPriorityStandard ),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    48
		iObserver(aObserver),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
    49
		iDataPtr(NULL, 0, 0)
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    50
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    51
	CActiveScheduler::Add(this);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    52
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    53
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    54
void CSmfClientSymbian::ConstructL()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    55
    {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    56
    User::LeaveIfError(iSession.connectToServer());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    57
    }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    58
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    59
CSmfClientSymbian::~CSmfClientSymbian()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    60
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    61
	qDebug()<<"~CSmfClientSymbian";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    62
    Cancel(); // Causes call to DoCancel()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    63
    iSession.Close();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    64
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    65
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    66
void CSmfClientSymbian::DoCancel()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    67
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    68
	Cancel();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    69
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    70
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    71
TInt CSmfClientSymbian::RunError(TInt aError)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    72
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    73
	qDebug()<<"Inside CSmfClientSymbian::RunError(), error = "<<aError;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    74
	return KErrNone;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    75
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    76
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    77
void CSmfClientSymbian::RunL()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    78
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    79
	qDebug()<<"Inside CSmfClientSymbian::RunL()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    80
	qDebug()<<"iStatus = "<<iStatus.Int();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    81
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    82
    switch ( iStatus.Int() )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    83
        {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    84
        case KErrCancel:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    85
            // The request was canceled
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    86
        	qDebug()<<"KErrCancel";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    87
            break ;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    88
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    89
        case KErrNotReady:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    90
        	qDebug()<<"KErrNotReady";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    91
        	break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    92
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    93
        default:
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    94
        	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    95
        	qDebug()<<"RunL :- default";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    96
        	//This contains error followed by actual data
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    97
        	QByteArray receivedData(reinterpret_cast<const char*>(iSession.iDataPtr8.Ptr()),iSession.iDataPtr8.Length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    98
        	qDebug()<<"receivedData size = "<<receivedData.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
    99
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   100
        	SmfError errVal;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   101
        	int errInt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   102
        	QByteArray data;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   103
        	QDataStream reader(&receivedData,QIODevice::ReadOnly);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   104
        	reader>>errInt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   105
        	qDebug()<<"errInt = "<<errInt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   106
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   107
        	errVal = (SmfError)errInt;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   108
        	reader>>data;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   109
        	qDebug()<<"data size = "<<data.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   110
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   111
        	SmfRequestTypeID opcode = (SmfRequestTypeID)iSession.getLastRequest();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   112
        	if(iObserver)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   113
        		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   114
				iObserver->resultsAvailable(data,opcode,errVal);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   115
        		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   116
        	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   117
        	break;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   118
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   119
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   120
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   121
// Sync request for server other than getservices
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   122
QByteArray CSmfClientSymbian::sendRequest(QString aInterfaceName, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   123
				 SmfRequestTypeID requestType, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   124
				 TInt aMaxAllocation,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   125
				 QByteArray& aSerializedData)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   126
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   127
	//Gets data synchronously from the server
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   128
    TPtr8 symbianBuf(iSession.sendSyncRequest(aInterfaceName,requestType, aMaxAllocation, aSerializedData));
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   129
    //convert this into bytearray
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   130
    QByteArray receivedData(reinterpret_cast<const char*>(symbianBuf.Ptr()),symbianBuf.Length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   131
    return receivedData;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   132
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   133
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   134
QByteArray CSmfClientSymbian::sendSyncRequest(QString aInterfaceName,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   135
		 SmfRequestTypeID requestType,TInt maxSize,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   136
		 QByteArray& aSerializedData )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   137
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   138
	//This will be a synchronous request
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   139
	//note session is opened in ctor and closed in dtor
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   140
	qDebug()<<"Inside CSmfClientSymbian::sendSyncRequest()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   141
	qDebug()<<"Interface name = "<<aInterfaceName;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   142
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   143
	//Gets data synchronously from the server
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   144
    TPtr8 symbianBuf(iSession.sendSyncRequest(aInterfaceName,requestType,maxSize, aSerializedData));
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   145
    //convert this into bytearray
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   146
    QByteArray receivedData(reinterpret_cast<const char*>(symbianBuf.Ptr()),symbianBuf.Length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   147
    return receivedData;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   148
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   149
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   150
QByteArray CSmfClientSymbian::sendDSMSyncRequest(SmfRequestTypeID requestType,QByteArray& aSerializedData,SmfError& aErr,TInt maxSize)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   151
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   152
	Q_UNUSED(aErr)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   153
			
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   154
	qDebug()<<"CSmfClientSymbian::sendDSMSyncRequest for : "<<requestType;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   155
	SmfError err = SmfNoError;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   156
	//Gets data synchronously from the server
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   157
    TPtr8 symbianBuf(iSession.sendDSMSyncRequest(requestType,aSerializedData,err,maxSize));
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   158
    //convert this into bytearray
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   159
    QByteArray receivedData(reinterpret_cast<const char*>(symbianBuf.Ptr()),symbianBuf.Length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   160
    qDebug()<<"receivedData size="<<receivedData.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   161
    return receivedData;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   162
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   163
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   164
TInt CSmfClientSymbian::sendRequest( QByteArray& aSerializedData, QString aInterfaceName,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   165
		 SmfRequestTypeID requestType, TInt aMaxAllocation)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   166
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   167
	//RSessionBase objects sendreceive is called
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   168
	iSession.sendAsyncRequest(aSerializedData,aInterfaceName,requestType,iStatus,aMaxAllocation);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   169
	SetActive();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   170
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   171
	return KErrNone;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   172
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   173
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   174
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   175
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   176
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   177
RSmfClientSymbianSession::RSmfClientSymbianSession()
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   178
		:iDataPtr8(NULL, 0, 0),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   179
		 iDataPtr16(NULL,0),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   180
		 iPtrProvider(NULL,0),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   181
		 iPtrProvider8(NULL,0),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   182
		 iIntfNamePtr(NULL,0),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   183
		 iIntfNamePtr8(NULL,0),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   184
		 iPtrToXtraInfo(NULL, 0),
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   185
		 iPtrToXtraInfo8(NULL,0),
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   186
		 iPtr8ToSlot0(NULL,0)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   187
    {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   188
    // No implementation required
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   189
    }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   190
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   191
TInt RSmfClientSymbianSession::connectToServer()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   192
    {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   193
    TInt error = ::StartServerL();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   194
    qDebug()<<"StartServerL = "<<error;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   195
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   196
    if ( KErrNone == error )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   197
        {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   198
		error = CreateSession(KSmfServerName,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   199
                               Version(),
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   200
                               4 );	// 4 slots used
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   201
        qDebug()<<"CreateSession = "<<error;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   202
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   203
    return error;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   204
    }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   205
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   206
TPtr8 RSmfClientSymbianSession::sendSyncRequest(QByteArray& aSerializedData, 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   207
		QString aInterfaceName, SmfRequestTypeID aRequestType, TInt maxSize)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   208
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   209
	iLastRequest = aRequestType;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   210
	/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   211
	 * The message body consists of.- 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   212
	 * 1. Serialized data to server SmfProvider+page information+extra information
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   213
	 * 2. Interface name as string ("org.symbian.smf.client.gallery")
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   214
	 * 3. Data pointer to be filled by serialized data(QList<smfProvider>)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   215
	 * 4. Xtra information if any
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   216
	 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   217
	if(iProviderBuf8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   218
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   219
		delete iProviderBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   220
		iProviderBuf8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   221
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   222
	iProviderBuf8 = HBufC8::NewL(aSerializedData.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   223
	iPtrProvider8.Set(iProviderBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   224
	iPtrProvider8.Copy(reinterpret_cast<const TText8*>(aSerializedData.constData()),aSerializedData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   225
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   226
	//convert the QByteArray into TPtr
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   227
	TPtrC8 ptrSlot0(reinterpret_cast<const TText8*>(aSerializedData.constData()),aSerializedData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   228
	qDebug()<<"ptrSlot0 size = "<<ptrSlot0.Size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   229
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   230
	iInterfaceNamebyte.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   231
	//Pass serialized QString for interface name
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   232
	QDataStream intfNameStream(&iInterfaceNamebyte,QIODevice::WriteOnly);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   233
	intfNameStream<<aInterfaceName;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   234
	qDebug()<<"iInterfaceNamebyte size = "<<iInterfaceNamebyte.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   235
	if(iIntfNameBuffer8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   236
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   237
		delete iIntfNameBuffer8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   238
		iIntfNameBuffer8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   239
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   240
	iIntfNameBuffer8 = HBufC8::NewL(iInterfaceNamebyte.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   241
	iIntfNamePtr8.Set(iIntfNameBuffer8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   242
	iIntfNamePtr8.Copy(reinterpret_cast<const TText8*>(iInterfaceNamebyte.constData()),iInterfaceNamebyte.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   243
	qDebug()<<"After iIntfNamePtr8.Copy";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   244
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   245
	if(iBuffer8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   246
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   247
		delete iBuffer8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   248
		iBuffer8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   249
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   250
    iBuffer8 = HBufC8::NewL(maxSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   251
    iDataPtr8.Set(iBuffer8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   252
    qDebug()<<"After iDataPtr8.Set";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   253
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   254
	TIpcArgs args;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   255
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   256
    //filling the slots
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   257
    args.Set(0, &iPtrProvider8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   258
    args.Set(1, &iIntfNamePtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   259
    args.Set(2, &iDataPtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   260
    qDebug()<<"After setting 0,1,2 slots";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   261
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   262
    qDebug()<<"Before handle";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   263
    if (Handle()) 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   264
    	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   265
        qDebug()<<"Before sendreceive";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   266
        //synchronous request
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   267
        TInt sendErr = SendReceive(aRequestType, args);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   268
        if(sendErr)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   269
			qDebug()<<"SendReceive error = "<<sendErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   270
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   271
    return iDataPtr8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   272
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   273
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   274
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   275
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   276
TPtr8 RSmfClientSymbianSession::sendSyncRequest(QString aInterfaceName,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   277
		SmfRequestTypeID aRequestType,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   278
		TInt maxSize,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   279
		QByteArray& aSerializedData)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   280
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   281
	qDebug()<<"Inside RSmfClientSymbianSession::sendSyncRequest()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   282
	qDebug()<<"aInterfaceName = "<<aInterfaceName;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   283
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   284
	iLastRequest = aRequestType;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   285
	/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   286
	 * The message body consists of.- 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   287
	 * slot 0 = SmfProvider + argument flag + argument + etc
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   288
	 * slot 1 = Interface name serialized
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   289
	 * slot 2 = Data pointer to be filled by server
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   290
	 * slot 3 = not used now
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   291
	 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   292
		
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   293
	//Convert the interface name into TPtr
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   294
	//lets pass serialized QString
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   295
	iInterfaceNamebyte.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   296
	QDataStream intfNameStream(&iInterfaceNamebyte,QIODevice::WriteOnly);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   297
	intfNameStream<<aInterfaceName;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   298
    qDebug()<<"iInterfaceNamebyte size = "<<iInterfaceNamebyte.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   299
	if(iIntfNameBuffer8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   300
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   301
		delete iIntfNameBuffer8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   302
		iIntfNameBuffer8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   303
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   304
	iIntfNameBuffer8 = HBufC8::NewL(iInterfaceNamebyte.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   305
	iIntfNamePtr8.Set(iIntfNameBuffer8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   306
	iIntfNamePtr8.Copy(reinterpret_cast<TUint8*>(iInterfaceNamebyte.data()),iInterfaceNamebyte.length());
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   307
    qDebug()<<"iIntfNamePtr8 (1) size = "<<iIntfNamePtr8.Size();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   308
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   309
	if(iBuffer8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   310
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   311
		delete iBuffer8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   312
		iBuffer8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   313
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   314
	qDebug()<<"Allocated for output = "<<maxSize;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   315
    iBuffer8 = HBufC8::NewL(maxSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   316
    iDataPtr8.Set(iBuffer8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   317
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   318
	if(iProviderBuf8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   319
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   320
		delete iProviderBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   321
		iProviderBuf8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   322
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   323
	iProviderBuf8 = HBufC8::NewL(aSerializedData.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   324
	iPtrProvider8.Set(iProviderBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   325
	iPtrProvider8.Copy(reinterpret_cast<const TText8*>(aSerializedData.constData()),aSerializedData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   326
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   327
	//convert the QByteArray into TPtr
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   328
	TPtrC8 ptrSlot0(reinterpret_cast<const TText8*>(aSerializedData.constData()),aSerializedData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   329
	qDebug()<<"ptrSlot0 size = "<<ptrSlot0.Size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   330
        
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   331
    TIpcArgs args;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   332
    args.Set(0, &iPtrProvider8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   333
    args.Set(1, &iIntfNamePtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   334
    args.Set(2, &iDataPtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   335
        
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   336
    qDebug()<<"Before handle";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   337
    if (Handle()) 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   338
    	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   339
        qDebug()<<"Before sendreceive";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   340
        TInt sendErr = SendReceive(aRequestType, args);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   341
        if(sendErr)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   342
			qDebug()<<"SendReceive error = "<<sendErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   343
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   344
    return iDataPtr8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   345
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   346
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   347
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   348
 * Sends sync DSM request to the Smf server
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   349
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   350
TPtr8 RSmfClientSymbianSession::sendDSMSyncRequest(SmfRequestTypeID aRequestType,
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   351
		QByteArray& aSerializedData, SmfError& aErr, TInt maxSize)
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   352
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   353
	/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   354
	 * Slot 0:- Data to be passed to DSM
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   355
	 * Slot 1:- Data returned from DSM
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   356
	 * Slot 2:- Error
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   357
	 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   358
	qDebug()<<"Inside RSmfClientSymbianSession::sendDSMSyncRequest()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   359
	iLastRequest = aRequestType;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   360
	if(iSlot0Buffer8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   361
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   362
		delete iSlot0Buffer8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   363
		iSlot0Buffer8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   364
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   365
	iSlot0Buffer8 = HBufC8::NewL(aSerializedData.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   366
	iPtr8ToSlot0.Set(iSlot0Buffer8->Des());
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   367
	iPtr8ToSlot0.Copy(reinterpret_cast<const TText8*>(aSerializedData.constData()),aSerializedData.length());
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   368
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   369
	if(iBuffer8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   370
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   371
		delete iBuffer8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   372
		iBuffer8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   373
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   374
    iBuffer8 = HBufC8::NewL(maxSize);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   375
    iDataPtr8.Set(iBuffer8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   376
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   377
    TIpcArgs args;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   378
    args.Set(0, &iPtr8ToSlot0);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   379
    args.Set(1, &iDataPtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   380
    iDSMErr.Zero();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   381
    args.Set(2,&iDSMErr);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   382
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   383
    TInt sendErr = SendReceive(aRequestType,args);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   384
    qDebug()<<"DSM SendReceive = "<<sendErr;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   385
    TInt numIndex;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   386
    TLex iLex(iDSMErr);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   387
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   388
    iLex.Val(numIndex);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   389
    aErr = (SmfError)numIndex;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   390
    return iDataPtr8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   391
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   392
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   393
/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   394
 * sendAsyncRequest()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   395
 * Calls SendReceive() after converting into symbian descriptors
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   396
 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   397
void RSmfClientSymbianSession::sendAsyncRequest(QByteArray& aSerializedData,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   398
		QString aInterfaceName,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   399
		SmfRequestTypeID aRequestType,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   400
		TRequestStatus& aStatus,
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   401
		TInt aMaxAllocation )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   402
	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   403
	/**
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   404
	 * The message body consists of.- 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   405
	 * slot 0 = SmfProvider + argument flag + argument + etc
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   406
	 * slot 1 = Interface name serialized
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   407
	 * slot 2 = Data pointer to be filled by server
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   408
	 * slot 3 = not used now
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   409
	 */
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   410
	qDebug()<<"Inside RSmfClientSymbianSession::sendAsyncRequest()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   411
	qDebug()<<"iInterfaceName = "<<aInterfaceName;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   412
	iLastRequest = aRequestType;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   413
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   414
	if(iProviderBuf8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   415
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   416
		delete iProviderBuf8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   417
		iProviderBuf8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   418
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   419
	iProviderBuf8 = HBufC8::NewL(aSerializedData.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   420
	iPtrProvider8.Set(iProviderBuf8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   421
	iPtrProvider8.Copy(reinterpret_cast<const TText8*>(aSerializedData.constData()),aSerializedData.length());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   422
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   423
	//convert the QByteArray into TPtr
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   424
    TPtrC8 ptrSlot0(reinterpret_cast<const TText8*>(aSerializedData.constData()),aSerializedData.length());
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   425
    qDebug()<<"ptrSlot0 size = "<<iPtrProvider8.Size();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   426
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   427
	//Convert the interface name into TPtr
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   428
    //Pass serialized QString for interface name
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   429
	iInterfaceNamebyte.clear();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   430
	QDataStream intfNameStream(&iInterfaceNamebyte,QIODevice::WriteOnly);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   431
	intfNameStream<<aInterfaceName;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   432
	qDebug()<<"iInterfaceNamebyte size = "<<iInterfaceNamebyte.size();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   433
	if(iIntfNameBuffer8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   434
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   435
		delete iIntfNameBuffer8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   436
		iIntfNameBuffer8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   437
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   438
	iIntfNameBuffer8 = HBufC8::NewL(iInterfaceNamebyte.size());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   439
	iIntfNamePtr8.Set(iIntfNameBuffer8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   440
	iIntfNamePtr8.Copy(reinterpret_cast<const TText8*>(iInterfaceNamebyte.constData()),iInterfaceNamebyte.length());
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   441
	qDebug()<<"ptrSlot1 size = "<<iIntfNamePtr8.Size();
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   442
	
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   443
	if(iBuffer8)
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   444
		{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   445
		delete iBuffer8;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   446
		iBuffer8 = NULL;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   447
		}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   448
    iBuffer8 = HBufC8::NewL(aMaxAllocation);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   449
    iDataPtr8.Set(iBuffer8->Des());
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   450
    qDebug()<<"After iDataPtr.Set";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   451
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   452
    TIpcArgs args;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   453
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   454
    //filling the slots
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   455
    args.Set(0, &iPtrProvider8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   456
    args.Set(1, &iIntfNamePtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   457
    args.Set(2, &iDataPtr8);
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   458
    qDebug()<<"After setting 0,1,2 slots";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   459
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   460
    qDebug()<<"Before Handle()";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   461
    if (Handle()) 
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   462
    	{
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   463
        qDebug()<<"Before sendreceive";
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   464
        SendReceive(aRequestType, args, aStatus);
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   465
        qDebug()<<"After sendreceive";
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   466
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   467
	}
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   468
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   469
// -----------------------------------------------------------------------------
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   470
// CreateServerProcessL()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   471
// Creates a server process
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   472
// -----------------------------------------------------------------------------
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   473
//
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   474
static TInt CreateServerProcessL()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   475
    {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   476
    TInt result;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   477
    TUid KSmfServerUID3 = { 0xE5027327 };
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   478
    const TUidType serverUid( KNullUid, KNullUid, KSmfServerUID3 );
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   479
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   480
    RProcess server;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   481
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   482
    result = server.Create( KSmfServerFilename, KNullDesC, serverUid );
25
a180113055cb Music Events are now normal Fetcher APIs added
cgandhi
parents: 18
diff changeset
   483
    qDebug()<<"server.Create() = "<<result;
18
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   484
    if ( result != KErrNone )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   485
        {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   486
        return  result;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   487
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   488
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   489
    server.Resume();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   490
    server.Close();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   491
    return  KErrNone;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   492
    }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   493
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   494
// -----------------------------------------------------------------------------
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   495
// StartServerL()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   496
// Starts the server - Internally creates a server process
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   497
// -----------------------------------------------------------------------------
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   498
//
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   499
static TInt StartServerL()
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   500
    {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   501
    TInt result;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   502
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   503
    TFindServer findSmfServer( KSmfServerFilename );
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   504
    TFullName name;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   505
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   506
    result = findSmfServer.Next( name );
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   507
    if ( result == KErrNone )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   508
        {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   509
        // Server already running
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   510
        return KErrNone;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   511
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   512
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   513
    RSemaphore semaphore;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   514
    result = semaphore.CreateGlobal( KSmfServerSemaphoreName, 0 );
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   515
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   516
    if ( result != KErrNone )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   517
        {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   518
        return  result;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   519
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   520
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   521
    result = CreateServerProcessL();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   522
    qDebug()<<"CreateServerProcessL = "<<result;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   523
    
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   524
    if ( result != KErrNone )
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   525
        {
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   526
        return  result;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   527
        }
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   528
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   529
    semaphore.Wait();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   530
    semaphore.Close();
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   531
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   532
    return KErrNone;
013a02bf2bb0 pushing changes for common libs and trace messages
cgandhi
parents:
diff changeset
   533
    }