equal
deleted
inserted
replaced
43 return self; |
43 return self; |
44 } |
44 } |
45 |
45 |
46 CSmfClientSymbian::CSmfClientSymbian(smfObserver* aObserver) |
46 CSmfClientSymbian::CSmfClientSymbian(smfObserver* aObserver) |
47 : CActive( EPriorityStandard ), |
47 : CActive( EPriorityStandard ), |
48 iObserver(aObserver), |
48 iObserver(aObserver)//, |
49 iDataPtr(NULL, 0, 0) |
49 //iDataPtr(NULL, 0, 0) |
50 { |
50 { |
51 CActiveScheduler::Add(this); |
51 CActiveScheduler::Add(this); |
52 } |
52 } |
53 |
53 |
54 void CSmfClientSymbian::ConstructL() |
54 void CSmfClientSymbian::ConstructL() |
147 return receivedData; |
147 return receivedData; |
148 } |
148 } |
149 |
149 |
150 QByteArray CSmfClientSymbian::sendDSMSyncRequest(SmfRequestTypeID requestType,QByteArray& aSerializedData,SmfError& aErr,TInt maxSize) |
150 QByteArray CSmfClientSymbian::sendDSMSyncRequest(SmfRequestTypeID requestType,QByteArray& aSerializedData,SmfError& aErr,TInt maxSize) |
151 { |
151 { |
152 Q_UNUSED(aErr) |
152 //Q_UNUSED(aErr) |
153 |
153 |
154 qDebug()<<"CSmfClientSymbian::sendDSMSyncRequest for : "<<requestType; |
154 qDebug()<<"CSmfClientSymbian::sendDSMSyncRequest for : "<<requestType; |
155 SmfError err = SmfNoError; |
155 //SmfError err = SmfNoError; |
156 //Gets data synchronously from the server |
156 //Gets data synchronously from the server |
157 TPtr8 symbianBuf(iSession.sendDSMSyncRequest(requestType,aSerializedData,err,maxSize)); |
157 TPtr8 symbianBuf(iSession.sendDSMSyncRequest(requestType,aSerializedData,aErr,maxSize)); |
158 //convert this into bytearray |
158 //convert this into bytearray |
159 QByteArray receivedData(reinterpret_cast<const char*>(symbianBuf.Ptr()),symbianBuf.Length()); |
159 QByteArray receivedData(reinterpret_cast<const char*>(symbianBuf.Ptr()),symbianBuf.Length()); |
160 qDebug()<<"receivedData size="<<receivedData.size(); |
160 qDebug()<<"receivedData size="<<receivedData.size(); |
161 return receivedData; |
161 return receivedData; |
162 } |
162 } |
173 |
173 |
174 |
174 |
175 |
175 |
176 |
176 |
177 RSmfClientSymbianSession::RSmfClientSymbianSession() |
177 RSmfClientSymbianSession::RSmfClientSymbianSession() |
178 :iDataPtr8(NULL, 0, 0), |
178 :iDataPtr8(NULL, 0, 0), iPtrProvider8(NULL,0), |
179 iDataPtr16(NULL,0), |
179 iIntfNamePtr8(NULL,0), iPtr8ToSlot0(NULL,0) |
180 iPtrProvider(NULL,0), |
|
181 iPtrProvider8(NULL,0), |
|
182 iIntfNamePtr(NULL,0), |
|
183 iIntfNamePtr8(NULL,0), |
|
184 iPtrToXtraInfo(NULL, 0), |
|
185 iPtrToXtraInfo8(NULL,0), |
|
186 iPtr8ToSlot0(NULL,0) |
|
187 { |
180 { |
188 // No implementation required |
181 // No implementation required |
189 } |
182 } |
190 |
183 |
191 TInt RSmfClientSymbianSession::connectToServer() |
184 TInt RSmfClientSymbianSession::connectToServer() |
346 |
339 |
347 /** |
340 /** |
348 * Sends sync DSM request to the Smf server |
341 * Sends sync DSM request to the Smf server |
349 */ |
342 */ |
350 TPtr8 RSmfClientSymbianSession::sendDSMSyncRequest(SmfRequestTypeID aRequestType, |
343 TPtr8 RSmfClientSymbianSession::sendDSMSyncRequest(SmfRequestTypeID aRequestType, |
351 QByteArray& aSerializedData, SmfError& aErr, TInt maxSize) |
344 QByteArray& aSerializedData, SmfError &aErr, TInt maxSize) |
352 { |
345 { |
353 /** |
346 /** |
354 * Slot 0:- Data to be passed to DSM |
347 * Slot 0:- Data to be passed to DSM |
355 * Slot 1:- Data returned from DSM |
348 * Slot 1:- Data returned from DSM |
356 * Slot 2:- Error |
349 * Slot 2:- Error |
377 TIpcArgs args; |
370 TIpcArgs args; |
378 args.Set(0, &iPtr8ToSlot0); |
371 args.Set(0, &iPtr8ToSlot0); |
379 args.Set(1, &iDataPtr8); |
372 args.Set(1, &iDataPtr8); |
380 iDSMErr.Zero(); |
373 iDSMErr.Zero(); |
381 args.Set(2,&iDSMErr); |
374 args.Set(2,&iDSMErr); |
382 |
375 |
383 TInt sendErr = SendReceive(aRequestType,args); |
376 TInt sendErr = SendReceive(aRequestType,args); |
384 qDebug()<<"DSM SendReceive = "<<sendErr; |
377 qDebug()<<"DSM SendReceive = "<<sendErr; |
385 TInt numIndex; |
378 TInt numIndex; |
386 TLex iLex(iDSMErr); |
379 TLex iLex(iDSMErr); |
387 |
380 |