author | cgandhi |
Thu, 05 Aug 2010 16:48:48 +0530 | |
changeset 18 | 013a02bf2bb0 |
parent 14 | a469c0e6e7fb |
child 25 | a180113055cb |
permissions | -rw-r--r-- |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
1 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Sasken Communication Technologies Ltd. |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
5 |
* under the terms of the "Eclipse Public License v1.0" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
8 |
* |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
10 |
* Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
11 |
* |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
12 |
* Contributors: |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
13 |
* Manasij Roy, Nalina Hariharan |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
14 |
* |
18 | 15 |
* Description: |
16 |
* SMF Server private implementation for Symbian |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
17 |
* |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
18 |
*/ |
18 | 19 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
20 |
#include <QDataStream> |
18 | 21 |
#include <QDebug> |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
22 |
#include <smfrelationmgr.h> |
18 | 23 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
24 |
#include "smfserversymbian_p.h" |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
25 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
26 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
27 |
SmfServerSymbian* SmfServerSymbian::NewL(CActive::TPriority aActiveObjectPriority,SmfServer* aWrapper) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
28 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
29 |
SmfServerSymbian* self = new(ELeave) SmfServerSymbian(aActiveObjectPriority,aWrapper); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
30 |
CleanupStack::PushL(self); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
31 |
self->ConstructL(); |
18 | 32 |
CleanupStack::Pop(); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
33 |
return self; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
34 |
} |
18 | 35 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
36 |
void SmfServerSymbian::ConstructL() |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
37 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
38 |
} |
18 | 39 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
40 |
SmfServerSymbian::SmfServerSymbian( CActive::TPriority aActiveObjectPriority,SmfServer* aWrapper ) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
41 |
: CPolicyServer(0,myPolicy, ESharableSessions), iWrapper(aWrapper) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
42 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
43 |
Q_UNUSED(aActiveObjectPriority) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
44 |
} |
18 | 45 |
|
46 |
SmfServerSymbian::~SmfServerSymbian() |
|
47 |
{ |
|
48 |
} |
|
49 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
50 |
TInt SmfServerSymbian::addToSessionMap(SmfServerSymbianSession* aSession,const RMessage2& aMsg) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
51 |
{ |
18 | 52 |
qDebug()<<"Inside SmfServerSymbian::addToSessionMap()"; |
53 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
54 |
if(iSessionCount) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
55 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
56 |
//The key generation |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
57 |
TInt key = qrand(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
58 |
//in case qrand generates any duplicate key |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
59 |
while(iMap.Find(key)) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
60 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
61 |
key = qrand(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
62 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
63 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
64 |
CSessionStruct session; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
65 |
session.iMsg = aMsg; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
66 |
session.iSession = aSession; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
67 |
iMap.Insert(key,session); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
68 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
69 |
return key; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
70 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
71 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
72 |
return (-1); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
73 |
} |
18 | 74 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
75 |
TInt SmfServerSymbian::removeFromSessionMap(SmfServerSymbianSession* aSession,RMessage2& aMsg) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
76 |
{ |
18 | 77 |
//To be implemented |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
78 |
Q_UNUSED(aSession) |
18 | 79 |
Q_UNUSED(aMsg) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
80 |
return 0; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
81 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
82 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
83 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
84 |
SmfServer* SmfServerSymbian::wrapper() |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
85 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
86 |
return iWrapper; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
87 |
} |
18 | 88 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
89 |
CSession2* SmfServerSymbian::NewSessionL(const TVersion& aVersion, const RMessage2& /*aMessage*/) const |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
90 |
{ |
18 | 91 |
qDebug()<<"Inside SmfServerSymbian::NewSessionL()"; |
92 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
93 |
Q_UNUSED(aVersion) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
94 |
// Check that the version is OK |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
95 |
// TVersion v( 0, 1, 0 ); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
96 |
// if (!User::QueryVersionSupported( v, aVersion )) |
18 | 97 |
// User::Leave( KErrNotSupported ); |
98 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
99 |
// Create the session. |
18 | 100 |
qDebug()<<"New session created"; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
101 |
return new (ELeave) SmfServerSymbianSession( const_cast<SmfServerSymbian*>(this) ); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
102 |
} |
18 | 103 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
104 |
SmfServerSymbianSession* SmfServerSymbian::findSession(TInt id) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
105 |
{ |
18 | 106 |
qDebug()<<"Inside SmfServerSymbian::findSession()"; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
107 |
CSessionStruct* sessionStruct = iMap.Find(id); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
108 |
if(sessionStruct) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
109 |
{ |
18 | 110 |
qDebug()<<"Session id found"; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
111 |
return sessionStruct->iSession; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
112 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
113 |
else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
114 |
{ |
18 | 115 |
qDebug()<<"Session id not found"; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
116 |
return NULL; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
117 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
118 |
} |
18 | 119 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
120 |
TInt SmfServerSymbian::findAndServiceclient(TInt requestID,QByteArray* parsedData,SmfError error) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
121 |
{ |
18 | 122 |
qDebug()<<"Inside SmfServerSymbian::findAndServiceclient()"; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
123 |
SmfServerSymbianSession* sessionToservice = findSession(requestID); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
124 |
if(sessionToservice) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
125 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
126 |
sessionToservice->resultsAvailable(parsedData,error); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
127 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
128 |
return 0; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
129 |
} |
18 | 130 |
|
131 |
||
132 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
133 |
SmfServerSymbianSession::SmfServerSymbianSession(SmfServerSymbian* aServer): |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
134 |
iServer(aServer),iPtrToBuf(NULL,0) , |
18 | 135 |
iIntfNameSymbian8(NULL,0), iProviderSymbian8(NULL,0), |
136 |
iIntfNameSymbian(NULL,0) ,iXtraDataPtr8(NULL,0), |
|
137 |
iPtrToDataForClient(NULL,0) ,iPtr8DataForDSM(NULL,0),iPtr8DataFromDSM(NULL,0) |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
138 |
{ |
18 | 139 |
qDebug()<<"Inside SmfServerSymbianSession::SmfServerSymbianSession()"; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
140 |
iServer->iSessionCount++; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
141 |
} |
18 | 142 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
143 |
SmfServerSymbianSession::~SmfServerSymbianSession() |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
144 |
{ |
18 | 145 |
qDebug()<<"Inside SmfServerSymbianSession::~SmfServerSymbianSession()"; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
146 |
//cleanup of client resources |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
147 |
iServer->iSessionCount--; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
148 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
149 |
|
18 | 150 |
void SmfServerSymbianSession::clientAuthorizationFinished(bool success) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
151 |
{ |
18 | 152 |
qDebug()<<"Inside SmfServerSymbianSession::clientAuthorizationFinished() = "<<success; |
153 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
154 |
//Client authorization failed |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
155 |
if(!success) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
156 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
157 |
//TODO:- Should use smf wide error instead |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
158 |
iMessage.Complete(KErrPermissionDenied); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
159 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
160 |
else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
161 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
162 |
HandleClientMessageL(iMessage); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
163 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
164 |
} |
18 | 165 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
166 |
void SmfServerSymbianSession::resultsAvailable(QByteArray* parsedData,SmfError error) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
167 |
{ |
18 | 168 |
qDebug()<<"Inside SmfServerSymbianSession::resultsAvailable()"; |
169 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
170 |
//Note:- The order of serialization of parsedData - Error value followed by the data |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
171 |
//parsedData is already serialized by PM |
18 | 172 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
173 |
//We should remove the request from the map as soon its no longer outstanding |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
174 |
iServer->removeFromSessionMap(this,iMessage); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
175 |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
176 |
//Note:- Session must take the ownership of the data being passed to the client session |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
177 |
if(iDataForClient) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
178 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
179 |
delete iDataForClient; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
180 |
iDataForClient = NULL; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
181 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
182 |
iDataForClient = HBufC8::NewL(parsedData->size()); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
183 |
iPtrToDataForClient.Set(iDataForClient->Des()); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
184 |
iPtrToDataForClient.Copy(reinterpret_cast<const TText8*>(parsedData->constData()),parsedData->length()); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
185 |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
186 |
TInt writeErr = iMessage.Write(2,iPtrToDataForClient); |
18 | 187 |
qDebug()<<"iMessage.Write() = "<<writeErr; |
188 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
189 |
//signal completion for the last request |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
190 |
iMessage.Complete(error); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
191 |
} |
18 | 192 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
193 |
void SmfServerSymbianSession::ServiceL(const RMessage2& aMessage) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
194 |
{ |
18 | 195 |
qDebug()<<"Inside SmfServerSymbianSession::ServiceL() = "<<iMessage.Function(); |
196 |
iMessage = aMessage; |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
197 |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
198 |
//construct the client auth id |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
199 |
SmfClientAuthID clientAuthID; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
200 |
clientAuthID.pid = aMessage.SecureId(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
201 |
clientAuthID.session = this; |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
202 |
//TODO:- No client pid checking?No capability? So why symbian client-server? |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
203 |
HandleClientMessageL(iMessage); |
18 | 204 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
205 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
206 |
void SmfServerSymbianSession::HandleClientMessageL(const RMessage2& aMessage) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
207 |
{ |
18 | 208 |
qDebug()<<"Inside SmfServerSymbianSession::HandleClientMessageL() = "<<aMessage.Function(); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
209 |
iLastRequest = aMessage.Function(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
210 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
211 |
/**Note:- Only ESmfGetService needs to be taken care separately as it doesn't involve createrequest for PM |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
212 |
*See SmfRequestTypeID for list of opcodes |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
213 |
* |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
214 |
*Two cases,- |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
215 |
*1.for ESmfGetServices we donno the provider info |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
216 |
*2. for rest of the cases, we know the provider info |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
217 |
*so it seems PM needs to provide two overloaded getPlugins API But for every client intf instanciation |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
218 |
*we would execute the same things twice. |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
219 |
*TODO:- to be changed after GetServices returns SmfProvider+pluginID |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
220 |
* |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
221 |
*/ |
18 | 222 |
if( (SmfGetService == iLastRequest) || |
223 |
(SmfPostGetMaxCharsInPost == iLastRequest) || |
|
224 |
(SmfPostGetMaxItems == iLastRequest) || |
|
225 |
(SmfPostGetSupportedFormats == iLastRequest)|| |
|
226 |
(SmfPostGetAppearanceSupport == iLastRequest) ) |
|
227 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
228 |
{ |
18 | 229 |
HandleSyncServiceL(aMessage); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
230 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
231 |
else if(iLastRequest == SmfRelationCreate || |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
232 |
iLastRequest == SmfRelationAssociate || |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
233 |
iLastRequest == SmfRelationSearchById || |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
234 |
iLastRequest == SmfRelationSearchByContact || |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
235 |
iLastRequest == SmfRelationCount || |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
236 |
iLastRequest == SmfRelationGet || |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
237 |
iLastRequest == SmfRelationGetAll || |
18 | 238 |
iLastRequest == SmfRelationGetAllRelations || |
239 |
iLastRequest == SmfRelationDeleteRelation |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
240 |
) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
241 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
242 |
HandleDSMServiceL(aMessage); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
243 |
} |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
244 |
else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
245 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
246 |
HandleCommonServiceL(aMessage); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
247 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
248 |
} |
18 | 249 |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
250 |
void SmfServerSymbianSession::HandleDSMServiceL(const RMessage2 & aMessage) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
251 |
{ |
18 | 252 |
qDebug()<<"Inside SmfServerSymbianSession::HandleDSMServiceL()"; |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
253 |
//TODO:-If DSM takes care of deserialization and formation of User and social |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
254 |
//profile from the params then switch case can be removed |
18 | 255 |
if(iData8ForDSM) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
256 |
{ |
18 | 257 |
delete iData8ForDSM; |
258 |
iData8ForDSM = NULL; |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
259 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
260 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
261 |
switch(iLastRequest) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
262 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
263 |
case SmfRelationCreate: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
264 |
{ |
18 | 265 |
iData8ForDSM = HBufC8::New(maxSmfRelationIdSize); |
266 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
267 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
268 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
269 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
270 |
case SmfRelationAssociate: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
271 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
272 |
int maxAlloc = 100; |
18 | 273 |
iData8ForDSM = HBufC8::New(maxAlloc); |
274 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
275 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
276 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
277 |
break; |
18 | 278 |
case SmfRelationRemove: |
279 |
{ |
|
280 |
iData8ForDSM = HBufC8::New(100); |
|
281 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
282 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
283 |
break; |
|
284 |
} |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
285 |
case SmfRelationSearchById: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
286 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
287 |
int maxAlloc = MaxSmfContactSize; |
18 | 288 |
iData8ForDSM = HBufC8::New(maxAlloc); |
289 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
290 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
291 |
} |
|
292 |
break; |
|
293 |
case SmfRelationSearchByContact: |
|
294 |
{ |
|
295 |
int maxAlloc = 500; // hard coded in relation manager |
|
296 |
iData8ForDSM = HBufC8::New(maxAlloc); |
|
297 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
298 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
299 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
300 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
301 |
case SmfRelationCount: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
302 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
303 |
int maxAlloc = 100; |
18 | 304 |
iData8ForDSM = HBufC8::New(maxAlloc); |
305 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
306 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
307 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
308 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
309 |
case SmfRelationGet: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
310 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
311 |
int maxAlloc = maxSmfRelationItemSize*maxRelationItems; |
18 | 312 |
iData8ForDSM = HBufC8::New(maxAlloc); |
313 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
314 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
315 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
316 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
317 |
case SmfRelationGetAll: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
318 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
319 |
int maxAlloc = maxSmfRelationItemSize*maxRelationItems; |
18 | 320 |
iData8ForDSM = HBufC8::New(maxAlloc); |
321 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
322 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
323 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
324 |
break; |
18 | 325 |
case SmfRelationGetAllRelations: |
326 |
{ |
|
327 |
int maxAlloc = maxSmfRelationItemSize*maxRelationItems; |
|
328 |
iData8ForDSM = HBufC8::New(maxAlloc); |
|
329 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
330 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
331 |
break; |
|
332 |
} |
|
333 |
case SmfRelationDeleteRelation: |
|
334 |
{ |
|
335 |
int maxAlloc = 100; |
|
336 |
iData8ForDSM = HBufC8::New(maxAlloc); |
|
337 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
338 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
339 |
break; |
|
340 |
} |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
341 |
default: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
342 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
343 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
344 |
//Convert into QByteArray |
18 | 345 |
QByteArray qtdataForDSM(reinterpret_cast<const char*>(iPtr8DataForDSM.Ptr()),iPtr8DataForDSM.Length()) ; |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
346 |
QByteArray qtdataFromDSM; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
347 |
SmfRequestTypeID opcode = (SmfRequestTypeID)iLastRequest; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
348 |
SmfError dsmErr = iServer->wrapper()->sendToDSM(qtdataForDSM,opcode,qtdataFromDSM); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
349 |
if(dsmErr == SmfNoError) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
350 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
351 |
if(qtdataFromDSM.size()) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
352 |
{ |
18 | 353 |
if(iData8FromDSM) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
354 |
{ |
18 | 355 |
delete iData8FromDSM; |
356 |
iData8FromDSM = NULL; |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
357 |
} |
18 | 358 |
iData8FromDSM = HBufC8::NewL(qtdataFromDSM.size()); |
359 |
iPtr8DataFromDSM.Set(iData8FromDSM->Des()); |
|
360 |
iPtr8DataFromDSM.Copy(reinterpret_cast<const TText8*>(qtdataFromDSM.constData()),qtdataFromDSM.length()); |
|
361 |
TInt writeErr = aMessage.Write(1,iPtr8DataFromDSM); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
362 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
363 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
364 |
else |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
365 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
366 |
iDSMErr.Zero(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
367 |
TInt errInt = dsmErr; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
368 |
iDSMErr.AppendNum(errInt); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
369 |
TInt writeErr = aMessage.Write(2,iDSMErr); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
370 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
371 |
} |
18 | 372 |
|
373 |
||
374 |
void SmfServerSymbianSession::HandleSyncServiceL(const RMessage2 & aMessage) |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
375 |
{ |
18 | 376 |
qDebug()<<"Inside SmfServerSymbianSession::HandleSyncServiceL()"; |
377 |
||
378 |
// Following is the data format sent by client |
|
379 |
// 1. SmfProvider +PageInfo flag+ aPageNum + aPerPage (if pageinfoflag is set) + XtraInfo flag(size of xtra data) Serialized |
|
380 |
// 2. Interface name as string ("org.symbian.smf.client.gallery") |
|
381 |
// 3. Data pointer to be filled by serialized data(eg: QList<smfProvider>) |
|
382 |
// 4. Input Data if xtra flag is set |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
383 |
|
18 | 384 |
TInt intfNameSize = aMessage.GetDesLength(1); |
385 |
if(iIntfNameBuf8) |
|
386 |
{ |
|
387 |
delete iIntfNameBuf8; |
|
388 |
iIntfNameBuf8 = NULL; |
|
389 |
} |
|
390 |
iIntfNameBuf8 = HBufC8::NewL(intfNameSize); |
|
391 |
iIntfNameSymbian8.Set(iIntfNameBuf8->Des()); |
|
392 |
||
393 |
//read it into iIntfNameSymbian8 |
|
394 |
aMessage.ReadL(1,iIntfNameSymbian8); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
395 |
|
18 | 396 |
QByteArray intfName(reinterpret_cast<const char*>(iIntfNameSymbian8.Ptr()),iIntfNameSymbian8.Length()) ; |
397 |
QDataStream readIntfNameStream(&intfName,QIODevice::ReadOnly); |
|
398 |
iInterfaceID.clear(); |
|
399 |
readIntfNameStream>>iInterfaceID; |
|
400 |
qDebug()<<"After de-serializing into iInterfaceID = "<<iInterfaceID; |
|
401 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
402 |
//Interface names are diff in client and plugin, replacing *.client.* with *.plugin.* |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
403 |
iInterfaceID.replace(QString(".client"),QString(".plugin")); |
18 | 404 |
|
405 |
// for get services |
|
406 |
if(SmfGetService == aMessage.Function()) |
|
407 |
HandleGetService(aMessage, iInterfaceID); |
|
408 |
||
409 |
// for other services |
|
410 |
else |
|
411 |
{ |
|
412 |
// read provider info |
|
413 |
TInt providerSize = aMessage.GetDesLength(0); |
|
414 |
if(iProviderBuf8) |
|
415 |
{ |
|
416 |
delete iProviderBuf8; |
|
417 |
iProviderBuf8 = NULL; |
|
418 |
} |
|
419 |
iProviderBuf8 = HBufC8::NewL(providerSize); |
|
420 |
iProviderSymbian8.Set(iProviderBuf8->Des()); |
|
421 |
||
422 |
//read it into iProviderSymbian8 |
|
423 |
aMessage.ReadL(0,iProviderSymbian8); |
|
424 |
||
425 |
//convert SmfProvider info from Symbian into bytearray |
|
426 |
QByteArray providerBufQt(reinterpret_cast<const char*>(iProviderSymbian8.Ptr()),iProviderSymbian8.Length()); |
|
427 |
qDebug()<<"providerBufQt.size = "<<providerBufQt.size(); |
|
428 |
||
429 |
//now de-serialize it |
|
430 |
QDataStream readProviderStream(&providerBufQt,QIODevice::ReadOnly); |
|
431 |
SmfProvider provider; |
|
432 |
readProviderStream>>provider; |
|
433 |
QByteArray XtraBufQt; |
|
434 |
readProviderStream>>XtraBufQt; |
|
435 |
||
436 |
//Get the plugin ID who matches provider info for a given intf name |
|
437 |
SmfPluginID pluginID = iServer->wrapper()->getPlugin(iInterfaceID,provider); |
|
438 |
qDebug()<<"pluginID from PM = "<<pluginID; |
|
439 |
||
440 |
//we need to check only this pluginID is authorized |
|
441 |
iPluginIDList.clear(); |
|
442 |
iPluginIDList<<pluginID; |
|
443 |
||
444 |
//iAuthList will contain pluginID for a successfull case |
|
445 |
iAuthList.clear(); |
|
446 |
iServer->wrapper()->getAuthorizedPlugins(iPluginIDList,iAuthList); |
|
447 |
||
448 |
if(iAuthList.contains(pluginID)) |
|
449 |
{ |
|
450 |
//Plugin ID is authorised, service the request |
|
451 |
//Generate request id only if the plugin ID is authorised |
|
452 |
//request PM to get the data |
|
453 |
SmfRequestTypeID opcode = (SmfRequestTypeID)aMessage.Function(); |
|
454 |
resultData.clear(); |
|
455 |
SmfError err = iServer->wrapper()->sendToPluginManager(pluginID,iInterfaceID,opcode,XtraBufQt, resultData); |
|
456 |
||
457 |
if(resultData.size()) |
|
458 |
{ |
|
459 |
TPtrC8 resultPtr8(reinterpret_cast<const TText8*>(resultData.constData()),resultData.length()); |
|
460 |
||
461 |
TInt writeErr = aMessage.Write(2,resultPtr8); |
|
462 |
qDebug()<<"aMessage.Write(2) = "<<writeErr; |
|
463 |
} |
|
464 |
else |
|
465 |
{ |
|
466 |
iErrBuf.Zero(); |
|
467 |
iErrBuf.AppendNum(err); |
|
468 |
iMessage.Write(2,iErrBuf); |
|
469 |
} |
|
470 |
||
471 |
//signal completion |
|
472 |
aMessage.Complete(iLastRequest); |
|
473 |
} |
|
474 |
else |
|
475 |
{ |
|
476 |
SmfError err = SmfNoAuthorizedPlugin; |
|
477 |
iErrBuf.Zero(); |
|
478 |
iErrBuf.AppendNum(err); |
|
479 |
iMessage.Write(2,iErrBuf); |
|
480 |
aMessage.Complete(iLastRequest); |
|
481 |
} |
|
482 |
} |
|
483 |
} |
|
484 |
||
485 |
void SmfServerSymbianSession::HandleGetService(const RMessage2 & aMessage, const SmfInterfaceID& aInterfaceID) |
|
486 |
{ |
|
487 |
qDebug()<<"Inside SmfServerSymbianSession::HandleGetService()"; |
|
488 |
||
489 |
iServer->wrapper()->getPlugins(aInterfaceID,iPluginIDMap); |
|
490 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
491 |
//form the plugin id list from the map |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
492 |
iPluginIDList.clear(); |
18 | 493 |
iPluginIDList = iPluginIDMap.uniqueKeys(); |
494 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
495 |
//iAuthList will be filled by credential manager |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
496 |
iServer->wrapper()->getAuthorizedPlugins(iPluginIDList,iAuthList); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
497 |
|
18 | 498 |
// iPluginIDMap now contains SmfProvider info to return to the client |
499 |
// No need to add this to session map, as we are not requesting PM for this |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
500 |
QMap<SmfPluginID, SmfProvider> tempMap; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
501 |
QMapIterator<SmfPluginID, SmfProvider> i(iPluginIDMap); |
18 | 502 |
while(i.hasNext()) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
503 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
504 |
i.next(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
505 |
if(iAuthList.contains(i.key())) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
506 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
507 |
tempMap.insert(i.key(),i.value()); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
508 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
509 |
} |
18 | 510 |
//now tempMap contains the info to be passed to the client |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
511 |
iPluginIDMap.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
512 |
iPluginIDMap = tempMap; |
18 | 513 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
514 |
//form list of smfprovider from this map,- |
18 | 515 |
QList<SmfProvider> providerList = iPluginIDMap.values(); |
516 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
517 |
//now serialize this list into bytearray |
18 | 518 |
resultData.clear(); |
519 |
QDataStream stream(&resultData,QIODevice::WriteOnly); |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
520 |
stream<<providerList; |
18 | 521 |
qDebug()<<"providerList.count() = "<<providerList.count(); |
522 |
||
523 |
qDebug()<<"Before providerListSymbian"; |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
524 |
//now convert it into TPtr8 |
18 | 525 |
TPtrC8 providerListSymbian(reinterpret_cast<const TText8*>(resultData.constData()),resultData.length()); |
526 |
qDebug()<<"After providerListSymbian"; |
|
527 |
||
528 |
TInt writeErr = aMessage.Write(2,providerListSymbian); |
|
529 |
qDebug()<<"aMessage.Write(2) = "<<writeErr; |
|
530 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
531 |
//signal completion |
18 | 532 |
TInt completion = SmfGetService; |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
533 |
aMessage.Complete(completion); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
534 |
} |
18 | 535 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
536 |
void SmfServerSymbianSession::HandleCommonServiceL(const RMessage2& aMessage) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
537 |
{ |
18 | 538 |
qDebug()<<"Inside SmfServerSymbianSession::HandleCommonServiceL() = "<<aMessage.Function(); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
539 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
540 |
* Note:- client sends message in the following format,- |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
541 |
* Slot 0:- SmfProvider* serialized+Page info flag+page number+per page (if page info flag)+xtra info flag |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
542 |
* Slot 1:- Interface Name buffer |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
543 |
* Slot 2:- Ptr to data block to be filled |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
544 |
* Slot 3 :- Xtra Data if xtra data flag |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
545 |
*/ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
546 |
//TODO:- Use macro instead, shared betn client-server |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
547 |
TInt providerSize = aMessage.GetDesLength(0); |
18 | 548 |
if(iProviderBuf8) |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
549 |
{ |
18 | 550 |
delete iProviderBuf8; |
551 |
iProviderBuf8 = NULL; |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
552 |
} |
18 | 553 |
iProviderBuf8 = HBufC8::NewL(providerSize); |
554 |
iProviderSymbian8.Set(iProviderBuf8->Des()); |
|
555 |
||
556 |
//read it into iProviderSymbian8 |
|
557 |
aMessage.ReadL(0,iProviderSymbian8); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
558 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
559 |
//convert SmfProvider info from Symbian into bytearray |
18 | 560 |
QByteArray providerBufQt(reinterpret_cast<const char*>(iProviderSymbian8.Ptr()),iProviderSymbian8.Length()); |
561 |
qDebug()<<"providerBufQt.size = "<<providerBufQt.size(); |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
562 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
563 |
//now de-serialize it |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
564 |
QDataStream stream(&providerBufQt,QIODevice::ReadOnly); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
565 |
SmfProvider provider; |
18 | 566 |
stream>>provider; |
567 |
QByteArray XtraBufQt; |
|
568 |
stream>>XtraBufQt; |
|
569 |
qDebug()<<"XtraBufQt size = "<<XtraBufQt.size(); |
|
570 |
TInt intfNameSize = aMessage.GetDesLength(1); |
|
571 |
if(iIntfNameBuf8) |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
572 |
{ |
18 | 573 |
delete iIntfNameBuf8; |
574 |
iIntfNameBuf8 = NULL; |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
575 |
} |
18 | 576 |
iIntfNameBuf8 = HBufC8::NewL(intfNameSize); |
577 |
iIntfNameSymbian8.Set(iIntfNameBuf8->Des()); |
|
578 |
||
579 |
//read it into iIntfNameSymbian8 |
|
580 |
aMessage.ReadL(1,iIntfNameSymbian8); |
|
581 |
qDebug()<<"iIntfNameSymbian8.Size = "<<iIntfNameSymbian8.Size(); |
|
582 |
||
583 |
QByteArray bytearray(reinterpret_cast<const char*>(iIntfNameSymbian8.Ptr()),iIntfNameSymbian8.Length()) ; |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
584 |
QDataStream intfNameStream(&bytearray,QIODevice::ReadOnly); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
585 |
iInterfaceID.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
586 |
intfNameStream>>iInterfaceID; |
18 | 587 |
qDebug()<<"Interface Name = "<<iInterfaceID; |
588 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
589 |
//Interface names are diff in client and plugin, replacing *.client.* with *.plugin.* |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
590 |
iInterfaceID.replace(QString(".client"),QString(".plugin")); |
18 | 591 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
592 |
//Get the plugin ID who matches provider info for a given intf name |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
593 |
SmfPluginID pluginID = iServer->wrapper()->getPlugin(iInterfaceID,provider); |
18 | 594 |
qDebug()<<"pluginID from PM = "<<pluginID; |
595 |
||
596 |
//we need to check only this pluginID is authorized? |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
597 |
iPluginIDList.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
598 |
iPluginIDList<<pluginID; |
18 | 599 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
600 |
//iAuthList will contain pluginID for a successfull case |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
601 |
iAuthList.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
602 |
iServer->wrapper()->getAuthorizedPlugins(iPluginIDList,iAuthList); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
603 |
if(iAuthList.contains(pluginID)) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
604 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
605 |
//Plugin ID is authorised, service the request |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
606 |
//Gnerate request id only if the plugin ID is authorised |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
607 |
TInt id = iServer->addToSessionMap(this,aMessage); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
608 |
//request PM to get the data |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
609 |
SmfRequestTypeID opcode = (SmfRequestTypeID)iLastRequest; |
18 | 610 |
|
611 |
iServer->wrapper()->sendToPluginManager(id,pluginID,iInterfaceID,opcode,XtraBufQt); |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
612 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
613 |
else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
614 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
615 |
SmfError err = SmfNoAuthorizedPlugin; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
616 |
iErrBuf.Zero(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
617 |
iErrBuf.AppendNum(err); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
618 |
iMessage.Write(2,iErrBuf); |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
619 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
620 |
} |