author | cgandhi |
Mon, 11 Oct 2010 21:59:54 +0530 | |
changeset 26 | 83d6a149c755 |
parent 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 |
|
25 | 24 |
#include "smfpluginmanager.h" |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
25 |
#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
|
26 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
27 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
28 |
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
|
29 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
30 |
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
|
31 |
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
|
32 |
self->ConstructL(); |
18 | 33 |
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
|
34 |
return self; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
35 |
} |
18 | 36 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
37 |
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
|
38 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
39 |
} |
18 | 40 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
41 |
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
|
42 |
: 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
|
43 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
44 |
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
|
45 |
} |
18 | 46 |
|
47 |
SmfServerSymbian::~SmfServerSymbian() |
|
48 |
{ |
|
49 |
} |
|
50 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
51 |
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
|
52 |
{ |
18 | 53 |
qDebug()<<"Inside SmfServerSymbian::addToSessionMap()"; |
54 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
55 |
if(iSessionCount) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
56 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
57 |
//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
|
58 |
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
|
59 |
//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
|
60 |
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
|
61 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
62 |
key = qrand(); |
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 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
65 |
CSessionStruct session; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
66 |
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
|
67 |
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
|
68 |
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
|
69 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
70 |
return key; |
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 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
73 |
return (-1); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
74 |
} |
18 | 75 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
76 |
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
|
77 |
{ |
18 | 78 |
//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
|
79 |
Q_UNUSED(aSession) |
18 | 80 |
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
|
81 |
return 0; |
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 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
85 |
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
|
86 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
87 |
return iWrapper; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
88 |
} |
18 | 89 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
90 |
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
|
91 |
{ |
18 | 92 |
qDebug()<<"Inside SmfServerSymbian::NewSessionL()"; |
93 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
94 |
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
|
95 |
// 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
|
96 |
// 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
|
97 |
// if (!User::QueryVersionSupported( v, aVersion )) |
18 | 98 |
// User::Leave( KErrNotSupported ); |
99 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
100 |
// Create the session. |
18 | 101 |
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
|
102 |
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
|
103 |
} |
18 | 104 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
105 |
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
|
106 |
{ |
18 | 107 |
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
|
108 |
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
|
109 |
if(sessionStruct) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
110 |
{ |
18 | 111 |
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
|
112 |
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
|
113 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
114 |
else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
115 |
{ |
18 | 116 |
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
|
117 |
return NULL; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
118 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
119 |
} |
18 | 120 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
121 |
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
|
122 |
{ |
18 | 123 |
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
|
124 |
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
|
125 |
if(sessionToservice) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
126 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
127 |
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
|
128 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
129 |
return 0; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
130 |
} |
18 | 131 |
|
132 |
||
133 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
134 |
SmfServerSymbianSession::SmfServerSymbianSession(SmfServerSymbian* aServer): |
26 | 135 |
iServer(aServer), iIntfNameSymbian8(NULL,0), |
136 |
iProviderSymbian8(NULL,0), iXtraDataPtr8(NULL,0), |
|
137 |
iPtr8DataForDSM(NULL,0), iPtr8DataFromDSM(NULL,0), |
|
138 |
iPtrToDataForClient(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
|
139 |
{ |
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 |
|
26 | 150 |
#ifdef Q_FOR_FUTURE |
18 | 151 |
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
|
152 |
{ |
18 | 153 |
qDebug()<<"Inside SmfServerSymbianSession::clientAuthorizationFinished() = "<<success; |
154 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
155 |
//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
|
156 |
if(!success) |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
157 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
158 |
//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
|
159 |
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
|
160 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
161 |
else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
162 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
163 |
HandleClientMessageL(iMessage); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
164 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
165 |
} |
26 | 166 |
#endif |
18 | 167 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
168 |
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
|
169 |
{ |
18 | 170 |
qDebug()<<"Inside SmfServerSymbianSession::resultsAvailable()"; |
171 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
172 |
//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
|
173 |
//parsedData is already serialized by PM |
18 | 174 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
175 |
//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
|
176 |
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
|
177 |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
178 |
//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
|
179 |
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
|
180 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
181 |
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
|
182 |
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
|
183 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
184 |
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
|
185 |
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
|
186 |
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
|
187 |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
188 |
TInt writeErr = iMessage.Write(2,iPtrToDataForClient); |
18 | 189 |
qDebug()<<"iMessage.Write() = "<<writeErr; |
190 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
191 |
//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
|
192 |
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
|
193 |
} |
18 | 194 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
195 |
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
|
196 |
{ |
18 | 197 |
qDebug()<<"Inside SmfServerSymbianSession::ServiceL() = "<<iMessage.Function(); |
198 |
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
|
199 |
|
26 | 200 |
|
201 |
#ifdef Q_FOR_FUTURE |
|
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 |
//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
|
203 |
SmfClientAuthID clientAuthID; |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
204 |
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
|
205 |
clientAuthID.session = this; |
26 | 206 |
#endif |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
207 |
//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
|
208 |
HandleClientMessageL(iMessage); |
18 | 209 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
210 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
211 |
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
|
212 |
{ |
18 | 213 |
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
|
214 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
215 |
/**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
|
216 |
*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
|
217 |
* |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
218 |
*Two cases,- |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
219 |
*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
|
220 |
*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
|
221 |
*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
|
222 |
*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
|
223 |
*TODO:- to be changed after GetServices returns SmfProvider+pluginID |
26 | 224 |
* |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
225 |
*/ |
25 | 226 |
if( (SmfGetService == aMessage.Function()) || |
227 |
(SmfPostGetMaxCharsInPost == aMessage.Function()) || |
|
228 |
(SmfPostGetMaxItems == aMessage.Function()) || |
|
229 |
(SmfPostGetSupportedFormats == aMessage.Function())|| |
|
230 |
(SmfPostGetAppearanceSupport == aMessage.Function())) |
|
18 | 231 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
232 |
{ |
18 | 233 |
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
|
234 |
} |
25 | 235 |
else if (SmfCancelRequest == aMessage.Function()) |
236 |
{ |
|
237 |
HandleCancelRequest(aMessage); |
|
238 |
} |
|
239 |
else if(aMessage.Function() == SmfRelationCreate || |
|
240 |
aMessage.Function() == SmfRelationAssociate || |
|
241 |
aMessage.Function() == SmfRelationSearchById || |
|
242 |
aMessage.Function() == SmfRelationSearchByContact || |
|
243 |
aMessage.Function() == SmfRelationCount || |
|
244 |
aMessage.Function() == SmfRelationGet || |
|
245 |
aMessage.Function() == SmfRelationGetAll || |
|
246 |
aMessage.Function() == SmfRelationGetAllRelations || |
|
247 |
aMessage.Function() == SmfRelationDeleteRelation || |
|
248 |
aMessage.Function() == SmfRelationRemove |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
249 |
) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
250 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
251 |
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
|
252 |
} |
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
253 |
else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
254 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
255 |
HandleCommonServiceL(aMessage); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
256 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
257 |
} |
18 | 258 |
|
25 | 259 |
void SmfServerSymbianSession::HandleCancelRequest(const RMessage2 & aMessage) |
260 |
{ |
|
261 |
SmfError err = SmfNoError; |
|
262 |
// iLastRequest contains the last operations opcode, cwhich is to be cancelled. |
|
263 |
bool ret = SmfPluginManager::getInstance(iServer->wrapper())->cancelRequest(iLastRequest); |
|
264 |
||
265 |
iErrBuf.Zero(); |
|
266 |
iErrBuf.AppendNum(err); |
|
267 |
iMessage.Write(2,iErrBuf); |
|
268 |
aMessage.Complete(iLastRequest); |
|
269 |
||
270 |
} |
|
271 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
272 |
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
|
273 |
{ |
18 | 274 |
qDebug()<<"Inside SmfServerSymbianSession::HandleDSMServiceL()"; |
25 | 275 |
iLastRequest = aMessage.Function(); |
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 |
//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
|
277 |
//profile from the params then switch case can be removed |
18 | 278 |
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
|
279 |
{ |
18 | 280 |
delete iData8ForDSM; |
281 |
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
|
282 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
283 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
284 |
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
|
285 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
286 |
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
|
287 |
{ |
18 | 288 |
iData8ForDSM = HBufC8::New(maxSmfRelationIdSize); |
289 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
290 |
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
|
291 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
292 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
293 |
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
|
294 |
{ |
25 | 295 |
int maxAlloc = 1000; |
18 | 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; |
18 | 301 |
case SmfRelationRemove: |
302 |
{ |
|
303 |
iData8ForDSM = HBufC8::New(100); |
|
304 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
305 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
306 |
break; |
|
307 |
} |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
308 |
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
|
309 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
310 |
int maxAlloc = MaxSmfContactSize; |
18 | 311 |
iData8ForDSM = HBufC8::New(maxAlloc); |
312 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
313 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
314 |
} |
|
315 |
break; |
|
316 |
case SmfRelationSearchByContact: |
|
317 |
{ |
|
318 |
int maxAlloc = 500; // hard coded in relation manager |
|
319 |
iData8ForDSM = HBufC8::New(maxAlloc); |
|
320 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
321 |
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
|
322 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
323 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
324 |
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
|
325 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
326 |
int maxAlloc = 100; |
18 | 327 |
iData8ForDSM = HBufC8::New(maxAlloc); |
328 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
329 |
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
|
330 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
331 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
332 |
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
|
333 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
334 |
int maxAlloc = maxSmfRelationItemSize*maxRelationItems; |
18 | 335 |
iData8ForDSM = HBufC8::New(maxAlloc); |
336 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
337 |
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
|
338 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
339 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
340 |
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
|
341 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
342 |
int maxAlloc = maxSmfRelationItemSize*maxRelationItems; |
18 | 343 |
iData8ForDSM = HBufC8::New(maxAlloc); |
344 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
345 |
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
|
346 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
347 |
break; |
18 | 348 |
case SmfRelationGetAllRelations: |
349 |
{ |
|
350 |
int maxAlloc = maxSmfRelationItemSize*maxRelationItems; |
|
351 |
iData8ForDSM = HBufC8::New(maxAlloc); |
|
352 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
353 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
354 |
break; |
|
355 |
} |
|
356 |
case SmfRelationDeleteRelation: |
|
357 |
{ |
|
358 |
int maxAlloc = 100; |
|
359 |
iData8ForDSM = HBufC8::New(maxAlloc); |
|
360 |
iPtr8DataForDSM.Set(iData8ForDSM->Des()); |
|
361 |
TInt readerr0 = aMessage.Read(0,iPtr8DataForDSM); |
|
362 |
break; |
|
363 |
} |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
364 |
default: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
365 |
break; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
366 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
367 |
//Convert into QByteArray |
18 | 368 |
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
|
369 |
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
|
370 |
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
|
371 |
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
|
372 |
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
|
373 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
374 |
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
|
375 |
{ |
18 | 376 |
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
|
377 |
{ |
18 | 378 |
delete iData8FromDSM; |
379 |
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
|
380 |
} |
25 | 381 |
int siz = qtdataFromDSM.size(); |
382 |
qDebug()<<"Size of Data to be sent back thru DSM Create : "<<siz; |
|
18 | 383 |
iData8FromDSM = HBufC8::NewL(qtdataFromDSM.size()); |
384 |
iPtr8DataFromDSM.Set(iData8FromDSM->Des()); |
|
385 |
iPtr8DataFromDSM.Copy(reinterpret_cast<const TText8*>(qtdataFromDSM.constData()),qtdataFromDSM.length()); |
|
386 |
TInt writeErr = aMessage.Write(1,iPtr8DataFromDSM); |
|
26 | 387 |
iDSMErr.Zero(); |
388 |
TInt errInt = dsmErr; |
|
389 |
iDSMErr.AppendNum(errInt); |
|
390 |
writeErr = aMessage.Write(2,iDSMErr); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
391 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
392 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
393 |
else |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
394 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
395 |
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
|
396 |
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
|
397 |
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
|
398 |
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
|
399 |
} |
25 | 400 |
aMessage.Complete(iLastRequest); |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
401 |
} |
18 | 402 |
|
403 |
||
404 |
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
|
405 |
{ |
18 | 406 |
qDebug()<<"Inside SmfServerSymbianSession::HandleSyncServiceL()"; |
407 |
||
25 | 408 |
iLastRequest = aMessage.Function(); |
409 |
||
18 | 410 |
// Following is the data format sent by client |
411 |
// 1. SmfProvider +PageInfo flag+ aPageNum + aPerPage (if pageinfoflag is set) + XtraInfo flag(size of xtra data) Serialized |
|
412 |
// 2. Interface name as string ("org.symbian.smf.client.gallery") |
|
413 |
// 3. Data pointer to be filled by serialized data(eg: QList<smfProvider>) |
|
414 |
// 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
|
415 |
|
18 | 416 |
TInt intfNameSize = aMessage.GetDesLength(1); |
417 |
if(iIntfNameBuf8) |
|
418 |
{ |
|
419 |
delete iIntfNameBuf8; |
|
420 |
iIntfNameBuf8 = NULL; |
|
421 |
} |
|
422 |
iIntfNameBuf8 = HBufC8::NewL(intfNameSize); |
|
423 |
iIntfNameSymbian8.Set(iIntfNameBuf8->Des()); |
|
424 |
||
425 |
//read it into iIntfNameSymbian8 |
|
426 |
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
|
427 |
|
18 | 428 |
QByteArray intfName(reinterpret_cast<const char*>(iIntfNameSymbian8.Ptr()),iIntfNameSymbian8.Length()) ; |
429 |
QDataStream readIntfNameStream(&intfName,QIODevice::ReadOnly); |
|
430 |
iInterfaceID.clear(); |
|
431 |
readIntfNameStream>>iInterfaceID; |
|
432 |
qDebug()<<"After de-serializing into iInterfaceID = "<<iInterfaceID; |
|
433 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
434 |
//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
|
435 |
iInterfaceID.replace(QString(".client"),QString(".plugin")); |
18 | 436 |
|
437 |
// for get services |
|
438 |
if(SmfGetService == aMessage.Function()) |
|
439 |
HandleGetService(aMessage, iInterfaceID); |
|
440 |
||
441 |
// for other services |
|
442 |
else |
|
443 |
{ |
|
444 |
// read provider info |
|
445 |
TInt providerSize = aMessage.GetDesLength(0); |
|
446 |
if(iProviderBuf8) |
|
447 |
{ |
|
448 |
delete iProviderBuf8; |
|
449 |
iProviderBuf8 = NULL; |
|
450 |
} |
|
451 |
iProviderBuf8 = HBufC8::NewL(providerSize); |
|
452 |
iProviderSymbian8.Set(iProviderBuf8->Des()); |
|
453 |
||
454 |
//read it into iProviderSymbian8 |
|
455 |
aMessage.ReadL(0,iProviderSymbian8); |
|
456 |
||
457 |
//convert SmfProvider info from Symbian into bytearray |
|
458 |
QByteArray providerBufQt(reinterpret_cast<const char*>(iProviderSymbian8.Ptr()),iProviderSymbian8.Length()); |
|
459 |
qDebug()<<"providerBufQt.size = "<<providerBufQt.size(); |
|
460 |
||
461 |
//now de-serialize it |
|
462 |
QDataStream readProviderStream(&providerBufQt,QIODevice::ReadOnly); |
|
463 |
SmfProvider provider; |
|
464 |
readProviderStream>>provider; |
|
465 |
QByteArray XtraBufQt; |
|
466 |
readProviderStream>>XtraBufQt; |
|
467 |
||
468 |
//Get the plugin ID who matches provider info for a given intf name |
|
469 |
SmfPluginID pluginID = iServer->wrapper()->getPlugin(iInterfaceID,provider); |
|
470 |
qDebug()<<"pluginID from PM = "<<pluginID; |
|
471 |
||
472 |
//we need to check only this pluginID is authorized |
|
473 |
iPluginIDList.clear(); |
|
474 |
iPluginIDList<<pluginID; |
|
475 |
||
476 |
//iAuthList will contain pluginID for a successfull case |
|
477 |
iAuthList.clear(); |
|
478 |
iServer->wrapper()->getAuthorizedPlugins(iPluginIDList,iAuthList); |
|
479 |
||
480 |
if(iAuthList.contains(pluginID)) |
|
481 |
{ |
|
482 |
//Plugin ID is authorised, service the request |
|
483 |
//Generate request id only if the plugin ID is authorised |
|
484 |
//request PM to get the data |
|
485 |
SmfRequestTypeID opcode = (SmfRequestTypeID)aMessage.Function(); |
|
486 |
resultData.clear(); |
|
487 |
SmfError err = iServer->wrapper()->sendToPluginManager(pluginID,iInterfaceID,opcode,XtraBufQt, resultData); |
|
488 |
||
489 |
if(resultData.size()) |
|
490 |
{ |
|
491 |
TPtrC8 resultPtr8(reinterpret_cast<const TText8*>(resultData.constData()),resultData.length()); |
|
492 |
||
493 |
TInt writeErr = aMessage.Write(2,resultPtr8); |
|
494 |
qDebug()<<"aMessage.Write(2) = "<<writeErr; |
|
495 |
} |
|
496 |
else |
|
497 |
{ |
|
498 |
iErrBuf.Zero(); |
|
499 |
iErrBuf.AppendNum(err); |
|
500 |
iMessage.Write(2,iErrBuf); |
|
501 |
} |
|
502 |
||
503 |
//signal completion |
|
504 |
aMessage.Complete(iLastRequest); |
|
505 |
} |
|
506 |
else |
|
507 |
{ |
|
508 |
SmfError err = SmfNoAuthorizedPlugin; |
|
509 |
iErrBuf.Zero(); |
|
510 |
iErrBuf.AppendNum(err); |
|
511 |
iMessage.Write(2,iErrBuf); |
|
512 |
aMessage.Complete(iLastRequest); |
|
513 |
} |
|
514 |
} |
|
515 |
} |
|
516 |
||
517 |
void SmfServerSymbianSession::HandleGetService(const RMessage2 & aMessage, const SmfInterfaceID& aInterfaceID) |
|
518 |
{ |
|
519 |
qDebug()<<"Inside SmfServerSymbianSession::HandleGetService()"; |
|
520 |
||
521 |
iServer->wrapper()->getPlugins(aInterfaceID,iPluginIDMap); |
|
522 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
523 |
//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
|
524 |
iPluginIDList.clear(); |
18 | 525 |
iPluginIDList = iPluginIDMap.uniqueKeys(); |
526 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
527 |
//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
|
528 |
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
|
529 |
|
18 | 530 |
// iPluginIDMap now contains SmfProvider info to return to the client |
531 |
// 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
|
532 |
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
|
533 |
QMapIterator<SmfPluginID, SmfProvider> i(iPluginIDMap); |
18 | 534 |
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
|
535 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
536 |
i.next(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
537 |
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
|
538 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
539 |
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
|
540 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
541 |
} |
18 | 542 |
//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
|
543 |
iPluginIDMap.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
544 |
iPluginIDMap = tempMap; |
18 | 545 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
546 |
//form list of smfprovider from this map,- |
18 | 547 |
QList<SmfProvider> providerList = iPluginIDMap.values(); |
548 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
549 |
//now serialize this list into bytearray |
18 | 550 |
resultData.clear(); |
551 |
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
|
552 |
stream<<providerList; |
18 | 553 |
qDebug()<<"providerList.count() = "<<providerList.count(); |
554 |
||
555 |
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
|
556 |
//now convert it into TPtr8 |
18 | 557 |
TPtrC8 providerListSymbian(reinterpret_cast<const TText8*>(resultData.constData()),resultData.length()); |
558 |
qDebug()<<"After providerListSymbian"; |
|
559 |
||
560 |
TInt writeErr = aMessage.Write(2,providerListSymbian); |
|
561 |
qDebug()<<"aMessage.Write(2) = "<<writeErr; |
|
562 |
||
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
563 |
//signal completion |
18 | 564 |
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
|
565 |
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
|
566 |
} |
18 | 567 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
568 |
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
|
569 |
{ |
18 | 570 |
qDebug()<<"Inside SmfServerSymbianSession::HandleCommonServiceL() = "<<aMessage.Function(); |
25 | 571 |
iLastRequest = 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
|
572 |
/** |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
573 |
* 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
|
574 |
* 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
|
575 |
* 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
|
576 |
* 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
|
577 |
* 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
|
578 |
*/ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
579 |
//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
|
580 |
TInt providerSize = aMessage.GetDesLength(0); |
18 | 581 |
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
|
582 |
{ |
18 | 583 |
delete iProviderBuf8; |
584 |
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
|
585 |
} |
18 | 586 |
iProviderBuf8 = HBufC8::NewL(providerSize); |
587 |
iProviderSymbian8.Set(iProviderBuf8->Des()); |
|
25 | 588 |
qDebug()<<"data info (0) size = "<<iProviderSymbian8.Size(); |
18 | 589 |
|
590 |
//read it into iProviderSymbian8 |
|
591 |
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
|
592 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
593 |
//convert SmfProvider info from Symbian into bytearray |
18 | 594 |
QByteArray providerBufQt(reinterpret_cast<const char*>(iProviderSymbian8.Ptr()),iProviderSymbian8.Length()); |
595 |
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
|
596 |
|
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
597 |
//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
|
598 |
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
|
599 |
SmfProvider provider; |
18 | 600 |
stream>>provider; |
601 |
QByteArray XtraBufQt; |
|
602 |
stream>>XtraBufQt; |
|
603 |
qDebug()<<"XtraBufQt size = "<<XtraBufQt.size(); |
|
604 |
TInt intfNameSize = aMessage.GetDesLength(1); |
|
605 |
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
|
606 |
{ |
18 | 607 |
delete iIntfNameBuf8; |
608 |
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
|
609 |
} |
18 | 610 |
iIntfNameBuf8 = HBufC8::NewL(intfNameSize); |
611 |
iIntfNameSymbian8.Set(iIntfNameBuf8->Des()); |
|
612 |
||
613 |
//read it into iIntfNameSymbian8 |
|
614 |
aMessage.ReadL(1,iIntfNameSymbian8); |
|
25 | 615 |
qDebug()<<"iIntfNameSymbian8 (1) .Size = "<<iIntfNameSymbian8.Size(); |
18 | 616 |
|
617 |
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
|
618 |
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
|
619 |
iInterfaceID.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
620 |
intfNameStream>>iInterfaceID; |
18 | 621 |
qDebug()<<"Interface Name = "<<iInterfaceID; |
622 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
623 |
//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
|
624 |
iInterfaceID.replace(QString(".client"),QString(".plugin")); |
18 | 625 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
626 |
//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
|
627 |
SmfPluginID pluginID = iServer->wrapper()->getPlugin(iInterfaceID,provider); |
18 | 628 |
qDebug()<<"pluginID from PM = "<<pluginID; |
629 |
||
630 |
//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
|
631 |
iPluginIDList.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
632 |
iPluginIDList<<pluginID; |
18 | 633 |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
634 |
//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
|
635 |
iAuthList.clear(); |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
636 |
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
|
637 |
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
|
638 |
{ |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
639 |
//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
|
640 |
//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
|
641 |
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
|
642 |
//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
|
643 |
SmfRequestTypeID opcode = (SmfRequestTypeID)iLastRequest; |
18 | 644 |
|
25 | 645 |
SmfError err = iServer->wrapper()->sendToPluginManager(id,pluginID,iInterfaceID,opcode,XtraBufQt); |
646 |
if(SmfNoError != err) |
|
647 |
{ |
|
648 |
iErrBuf.Zero(); |
|
649 |
iErrBuf.AppendNum(err); |
|
650 |
iMessage.Write(2,iErrBuf); |
|
651 |
||
652 |
//signal completion for the last request |
|
653 |
iMessage.Complete(err); |
|
654 |
} |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
655 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
656 |
else |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
657 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
10
diff
changeset
|
658 |
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
|
659 |
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
|
660 |
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
|
661 |
iMessage.Write(2,iErrBuf); |
25 | 662 |
|
663 |
//signal completion for the last request |
|
664 |
iMessage.Complete(err); |
|
7
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
665 |
} |
be09cf1f39dd
Updating the source code for plugin manager, transport manager, smfserver and smf client.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
666 |
} |