apply FSL(Flora Software License)
[platform/core/messaging/msg-service.git] / proxy / MsgHandleTransport.cpp
1  /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.0 (the "License");
5   * you may not use this file except in compliance with the License.
6   * You may obtain a copy of the License at
7   *
8   *    http://www.tizenopensource.org/license
9   *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16
17 #include <time.h>
18 #include <errno.h>
19
20 #include "MsgDebug.h"
21 #include "MsgCppTypes.h"
22 #include "MsgException.h"
23 #include "MsgProxyListener.h"
24 #include "MsgHandle.h"
25
26
27 /*==================================================================================================
28                                      IMPLEMENTATION OF MsgHandle - Transport Member Functions
29 ==================================================================================================*/
30 MSG_ERROR_T MsgHandle::submitReq(MSG_REQUEST_S* pReq)
31 {
32         MSG_BEGIN();
33
34         if (pReq == NULL)
35                 THROW(MsgException::INVALID_PARAM, "pReq is NULL");
36
37         MSG_REQUEST_INFO_S reqInfo = {0};
38         char trId[MMS_TR_ID_LEN+1] = {0};
39
40         MSG_MESSAGE_S *reqmsg = (MSG_MESSAGE_S*) pReq->msg;
41
42         if (reqmsg->msgType.subType != MSG_SENDREQ_JAVA_MMS) {
43                 // In case MMS read report, get address value later.
44                 if(reqmsg->msgType.subType != MSG_READREPLY_MMS) {
45                         if ((reqmsg->nAddressCnt == 0) || (reqmsg->nAddressCnt > MAX_TO_ADDRESS_CNT)) {
46                                 MSG_DEBUG("Recipient address count error [%d]", reqmsg->nAddressCnt );
47                                 return MSG_ERR_INVALID_MESSAGE;
48                         }
49                 }
50
51                 /* Begin: Setting default values for submit request */
52         //      pReq->msg.msgId = 0;    // Set Request ID: internal use
53         //      pReq->msg.folderId = MSG_OUTBOX_ID;     // Set Folder ID
54                 if (reqmsg->msgType.subType == MSG_RETRIEVE_MMS) {
55                         reqmsg->networkStatus = MSG_NETWORK_RETRIEVING;
56                 } else {
57                         reqmsg->networkStatus = MSG_NETWORK_SENDING;
58                 }
59
60                 reqmsg->bRead = false;
61                 reqmsg->bProtected = false;
62                 reqmsg->priority = MSG_MESSAGE_PRIORITY_NORMAL;
63                 reqmsg->direction = MSG_DIRECTION_TYPE_MO;
64                 reqmsg->storageId = MSG_STORAGE_PHONE;
65
66                 time_t curTime = time(NULL);
67
68                 if (curTime < 0)
69                         THROW(MsgException::INVALID_RESULT, "time error : %s", strerror(errno));
70
71                 reqmsg->displayTime = curTime;
72                 /* End : Setting default values for submit request */
73         } else {
74                 //in case of JAVA MMS msg, parse mms transaction id from pMmsData
75                 reqmsg->networkStatus = MSG_NETWORK_SENDING;
76                 strncpy(trId, (char*)reqmsg->pMmsData+3,MMS_TR_ID_LEN);
77                 MSG_DEBUG("JavaMMS transaction Id:%s ",trId);
78         }
79
80         // Convert MSG_MESSAGE_S to MSG_MESSAGE_INFO_S
81         convertMsgStruct(reqmsg, &(reqInfo.msgInfo));
82
83         convertSendOptStruct(&(pReq->sendOpt), &(reqInfo.sendOptInfo), reqmsg->msgType);
84
85         reqInfo.reqId = 0;
86
87         /* Register proxy info used for receiving sent status */
88         MSG_PROXY_INFO_S chInfo = {0};
89
90         chInfo.listenerFd = MsgProxyListener::instance()->getRemoteFd();
91
92         chInfo.handleAddr = (unsigned int) this;
93
94         /* Allocate Memory to Command Data */
95         int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_REQUEST_INFO_S) + sizeof(MSG_PROXY_INFO_S);
96
97         // In case of JAVA MMS msg, add trId
98         if (reqmsg->msgType.subType == MSG_SENDREQ_JAVA_MMS)
99                 cmdSize += sizeof(trId);
100
101         char cmdBuf[cmdSize];
102         bzero(cmdBuf, cmdSize);
103
104         MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
105
106         // Set Command Parameters
107         pCmd->cmdType = MSG_CMD_SUBMIT_REQ;
108
109         // Copy Cookie
110         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
111
112         // Copy Command Data
113         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &reqInfo, sizeof(MSG_REQUEST_INFO_S));
114         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_REQUEST_INFO_S)), &chInfo, sizeof(MSG_PROXY_INFO_S));
115
116         // In case of JAVA MMS msg, add trId
117         if (reqmsg->msgType.subType == MSG_SENDREQ_JAVA_MMS)
118                 memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_REQUEST_INFO_S)+sizeof(MSG_PROXY_INFO_S)), &trId, sizeof(trId));
119
120         // Send Command to Messaging FW
121         char* pEventData = NULL;
122         AutoPtr<char> eventBuf(&pEventData);
123
124         write((char*)pCmd, cmdSize, &pEventData);
125
126         // Get Return Data
127         MSG_EVENT_S* pEvent = (MSG_EVENT_S*) pEventData;
128
129         int* pReqId = (int*) pEvent->data;
130         pReq->reqId = *pReqId;
131         MSG_DEBUG("SENT_REQ_ID: %d", pReq->reqId);
132
133         if (pEvent->eventType != MSG_EVENT_SUBMIT_REQ)
134         {
135                 THROW(MsgException::INVALID_RESULT, "Event Data Error");
136         }
137
138         MSG_END();
139
140         return pEvent->result;
141 }
142
143
144 MSG_ERROR_T MsgHandle::cancelReq(MSG_REQUEST_ID_T reqId)
145 {
146         // Allocate Memory to Command Data
147         int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_REQUEST_ID_T);
148
149         char cmdBuf[cmdSize];
150         bzero(cmdBuf, cmdSize);
151
152         MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
153
154         // Set Command Parameters
155         pCmd->cmdType = MSG_CMD_CANCEL_REQ;
156
157         // Copy Cookie
158         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
159
160         // Copy Command Data
161         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &reqId, sizeof(MSG_REQUEST_ID_T));
162
163         // Send Command to Messaging FW
164         char* pEventData = NULL;
165         AutoPtr<char> eventBuf(&pEventData);
166
167
168         write((char*)pCmd, cmdSize, &pEventData);
169
170         // Get Return Data
171         MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
172
173         if (pEvent->eventType != MSG_EVENT_CANCEL_REQ)
174         {
175                 THROW(MsgException::INVALID_RESULT, "Event Data Error");
176         }
177
178         return pEvent->result;
179 }
180
181
182 MSG_ERROR_T MsgHandle::regSentStatusCallback(msg_sent_status_cb onStatusChanged, void *pUserParam)
183 {
184         if (!onStatusChanged)
185                 THROW(MsgException::INVALID_PARAM, "onStatusChanged is null");
186
187         MsgProxyListener* eventListener = MsgProxyListener::instance();
188
189         eventListener->start();
190
191         if (eventListener->regSentStatusEventCB(this, onStatusChanged, pUserParam) == false) // callback was already registered, just return SUCCESS
192                 return MSG_SUCCESS;
193
194         // Allocate Memory to Command Data
195         int cmdSize = sizeof(MSG_CMD_S) + sizeof(int); // cmd type, listenerFd
196         char cmdBuf[cmdSize];
197         bzero(cmdBuf, cmdSize);
198         MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
199
200         // Set Command Parameters
201         pCmd->cmdType = MSG_CMD_REG_SENT_STATUS_CB;
202
203         // Copy Cookie
204         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
205
206         int listenerFd = eventListener->getRemoteFd(); // fd that is reserved to the "listener thread" by msgfw daemon
207
208         MSG_DEBUG("remote fd %d", listenerFd);
209
210         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &listenerFd, sizeof(listenerFd));
211
212         MSG_DEBUG("reg status [%d : %s], %d", pCmd->cmdType, MsgDbgCmdStr(pCmd->cmdType), listenerFd);
213
214         // Send Command to Messaging FW
215         char* pEventData = NULL;
216         AutoPtr<char> eventBuf(&pEventData);
217
218         write((char*)pCmd, cmdSize, &pEventData);
219
220         // Get Return Data
221         MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
222
223         if (pEvent->eventType != MSG_EVENT_REG_SENT_STATUS_CB)
224         {
225                 THROW(MsgException::INVALID_PARAM, "Event Data Error");
226         }
227
228         return pEvent->result;
229 }
230
231
232 MSG_ERROR_T MsgHandle::regSmsMessageCallback(msg_sms_incoming_cb onMsgIncoming, unsigned short port, void *pUserParam)
233 {
234         if( (!onMsgIncoming) )
235                 THROW(MsgException::INVALID_PARAM, "Param %p", onMsgIncoming);
236
237         MsgProxyListener* eventListener = MsgProxyListener::instance();
238
239         eventListener->start();
240
241         if (eventListener->regMessageIncomingEventCB(this, onMsgIncoming, port, pUserParam) == false) // callback was already registered, just return SUCCESS
242                 return MSG_SUCCESS;
243
244         // Allocate Memory to Command Data
245         int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CMD_REG_INCOMING_MSG_CB_S); //sizeof(int) + sizeof; // cmd type, listener fd
246
247         char cmdBuf[cmdSize];
248         bzero(cmdBuf, cmdSize);
249
250         MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
251
252         // Set Command Parameters
253         pCmd->cmdType = MSG_CMD_REG_INCOMING_MSG_CB;
254
255         // Copy Cookie
256         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
257
258         MSG_CMD_REG_INCOMING_MSG_CB_S cmdParam = {0};
259
260         cmdParam.listenerFd = eventListener->getRemoteFd(); // fd that is reserved to the "listener thread" by msgfw daemon
261         cmdParam.msgType = MSG_SMS_TYPE;
262         cmdParam.port = port;
263
264         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &cmdParam, sizeof(cmdParam));
265
266         MSG_DEBUG("reg new msg [%s], fd %d, port %d", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd, cmdParam.port);
267
268         // Send Command to Messaging FW
269         char* pEventData = NULL;
270         AutoPtr<char> eventBuf(&pEventData);
271
272
273         write((char*)pCmd, cmdSize, &pEventData);
274
275         // Get Return Data
276         MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
277
278         if (pEvent->eventType != MSG_EVENT_REG_INCOMING_MSG_CB)
279         {
280                 THROW(MsgException::INVALID_RESULT, "Event Data Error");
281         }
282
283         return pEvent->result;
284 }
285
286
287 MSG_ERROR_T MsgHandle::regMmsConfMessageCallback(msg_mms_conf_msg_incoming_cb onMMSConfMsgIncoming, const char *pAppId, void *pUserParam)
288 {
289         if( (!onMMSConfMsgIncoming) )
290                 THROW(MsgException::INVALID_PARAM, "Param %p", onMMSConfMsgIncoming);
291
292         MsgProxyListener* eventListener = MsgProxyListener::instance();
293
294         eventListener->start();
295
296         if (eventListener->regMMSConfMessageIncomingEventCB(this, onMMSConfMsgIncoming, pAppId, pUserParam) == false) // callback was already registered, just return SUCCESS
297                 return MSG_SUCCESS;
298
299         // Allocate Memory to Command Data
300         int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB_S);
301
302         char cmdBuf[cmdSize];
303         bzero(cmdBuf, cmdSize);
304
305         MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
306
307         // Set Command Parameters
308         pCmd->cmdType = MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB;
309
310         // Copy Cookie
311         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
312
313         MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB_S cmdParam = {0};
314
315         cmdParam.listenerFd = eventListener->getRemoteFd(); // fd that is reserved to the "listener thread" by msgfw daemon
316         cmdParam.msgType = MSG_MMS_TYPE;
317
318         if (pAppId)
319                 strncpy(cmdParam.appId, pAppId, MAX_MMS_JAVA_APPID_LEN);
320
321         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &cmdParam, sizeof(cmdParam));
322
323         MSG_DEBUG("reg new msg [%s], fd:%d, appId:%s", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd,  (pAppId)? cmdParam.appId:"NULL" );
324
325         // Send Command to Messaging FW
326         char* pEventData = NULL;
327         AutoPtr<char> eventBuf(&pEventData);
328
329
330         write((char*)pCmd, cmdSize, &pEventData);
331
332         // Get Return Data
333         MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
334
335         if (pEvent->eventType != MSG_EVENT_REG_INCOMING_MMS_CONF_MSG_CB)
336         {
337                 THROW(MsgException::INVALID_RESULT, "Event Data Error");
338         }
339
340         return pEvent->result;
341 }
342
343
344 MSG_ERROR_T MsgHandle::regSyncMLMessageCallback(msg_syncml_msg_incoming_cb onSyncMLMsgIncoming, void *pUserParam)
345 {
346         if( (!onSyncMLMsgIncoming) )
347                 THROW(MsgException::INVALID_PARAM, "Param %p", onSyncMLMsgIncoming);
348
349         MsgProxyListener* eventListener = MsgProxyListener::instance();
350
351         eventListener->start();
352
353         if (eventListener->regSyncMLMessageIncomingEventCB(this, onSyncMLMsgIncoming, pUserParam) == false) // callback was already registered, just return SUCCESS
354                 return MSG_SUCCESS;
355
356         // Allocate Memory to Command Data
357         int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CMD_REG_INCOMING_SYNCML_MSG_CB_S); //sizeof(int) + sizeof; // cmd type, listener fd
358
359         char cmdBuf[cmdSize];
360         bzero(cmdBuf, cmdSize);
361
362         MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
363
364         // Set Command Parameters
365         pCmd->cmdType = MSG_CMD_REG_INCOMING_SYNCML_MSG_CB;
366
367         // Copy Cookie
368         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
369
370         MSG_CMD_REG_INCOMING_SYNCML_MSG_CB_S cmdParam = {0};
371
372         cmdParam.listenerFd = eventListener->getRemoteFd(); // fd that is reserved to the "listener thread" by msgfw daemon
373         cmdParam.msgType = MSG_SMS_TYPE;
374
375         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &cmdParam, sizeof(cmdParam));
376
377         MSG_DEBUG("reg new msg [%s], fd %d", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd);
378
379         // Send Command to Messaging FW
380         char* pEventData = NULL;
381         AutoPtr<char> eventBuf(&pEventData);
382
383         write((char*)pCmd, cmdSize, &pEventData);
384
385         // Get Return Data
386         MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
387
388         if (pEvent->eventType != MSG_EVENT_REG_INCOMING_SYNCML_MSG_CB)
389         {
390                 THROW(MsgException::INVALID_RESULT, "Event Data Error");
391         }
392
393         return pEvent->result;
394 }
395
396
397 MSG_ERROR_T MsgHandle::regLBSMessageCallback(msg_lbs_msg_incoming_cb onLBSMsgIncoming, void *pUserParam)
398 {
399         if( (!onLBSMsgIncoming) )
400                 THROW(MsgException::INVALID_PARAM, "Param %p", onLBSMsgIncoming);
401
402         MsgProxyListener* eventListener = MsgProxyListener::instance();
403
404         eventListener->start();
405
406         if (eventListener->regLBSMessageIncomingEventCB(this, onLBSMsgIncoming, pUserParam) == false) // callback was already registered, just return SUCCESS
407                 return MSG_SUCCESS;
408
409         // Allocate Memory to Command Data
410         int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CMD_REG_INCOMING_LBS_MSG_CB_S); //sizeof(int) + sizeof; // cmd type, listener fd
411         char cmdBuf[cmdSize];
412         bzero(cmdBuf, cmdSize);
413         MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
414
415         // Set Command Parameters
416         pCmd->cmdType = MSG_CMD_REG_INCOMING_LBS_MSG_CB;
417
418         // Copy Cookie
419         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
420
421         MSG_CMD_REG_INCOMING_LBS_MSG_CB_S cmdParam = {0};
422
423         cmdParam.listenerFd = eventListener->getRemoteFd(); // fd that is reserved to the "listener thread" by msgfw daemon
424         cmdParam.msgType = MSG_SMS_TYPE;
425
426         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &cmdParam, sizeof(cmdParam));
427
428         MSG_DEBUG("reg new msg [%s], fd %d", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd);
429
430         // Send Command to Messaging FW
431         char* pEventData = NULL;
432         AutoPtr<char> eventBuf(&pEventData);
433
434
435         write((char*)pCmd, cmdSize, &pEventData);
436
437         // Get Return Data
438         MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
439
440         if (pEvent->eventType != MSG_EVENT_REG_INCOMING_LBS_MSG_CB)
441         {
442                 THROW(MsgException::INVALID_RESULT, "Event Data Error");
443         }
444
445         return pEvent->result;
446 }
447
448
449 MSG_ERROR_T MsgHandle::regSyncMLMessageOperationCallback(msg_syncml_msg_operation_cb onSyncMLMsgOperation, void *pUserParam)
450 {
451         if( (!onSyncMLMsgOperation) )
452                 THROW(MsgException::INVALID_PARAM, "Param %p", onSyncMLMsgOperation);
453
454         MsgProxyListener* eventListener = MsgProxyListener::instance();
455
456         eventListener->start();
457
458         if (eventListener->regSyncMLMessageOperationEventCB(this, onSyncMLMsgOperation, pUserParam) == false) // callback was already registered, just return SUCCESS
459                 return MSG_SUCCESS;
460
461         // Allocate Memory to Command Data
462         int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CMD_REG_SYNCML_MSG_OPERATION_CB_S); //sizeof(int) + sizeof; // cmd type, listener fd
463
464         char cmdBuf[cmdSize];
465         bzero(cmdBuf, cmdSize);
466
467         MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
468
469         // Set Command Parameters
470         pCmd->cmdType = MSG_CMD_REG_SYNCML_MSG_OPERATION_CB;
471
472         // Copy Cookie
473         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
474
475         MSG_CMD_REG_SYNCML_MSG_OPERATION_CB_S cmdParam = {0};
476
477         cmdParam.listenerFd = eventListener->getRemoteFd(); // fd that is reserved to the "listener thread" by msgfw daemon
478         cmdParam.msgType = MSG_SMS_TYPE;
479
480         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &cmdParam, sizeof(cmdParam));
481
482         MSG_DEBUG("register syncML msg operation callback [%s], fd %d", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd);
483
484         // Send Command to Messaging FW
485         char* pEventData = NULL;
486         AutoPtr<char> eventBuf(&pEventData);
487
488
489         write((char*)pCmd, cmdSize, &pEventData);
490
491         // Get Return Data
492         MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
493
494         if (pEvent->eventType != MSG_EVENT_REG_SYNCML_MSG_OPERATION_CB)
495         {
496                 THROW(MsgException::INVALID_RESULT, "Event Data Error");
497         }
498
499         return pEvent->result;
500 }
501
502
503 MSG_ERROR_T MsgHandle::operateSyncMLMessage(MSG_MESSAGE_ID_T msgId)
504 {
505         if( msgId < 1)
506                 THROW(MsgException::INVALID_PARAM, "Param msgId %d", msgId);
507
508         // Allocate Memory to Command Data
509         int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_MESSAGE_ID_T);
510
511         char cmdBuf[cmdSize];
512         bzero(cmdBuf, cmdSize);
513         MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
514
515         // Set Command Parameters
516         pCmd->cmdType = MSG_CMD_SYNCML_OPERATION;
517
518         // Copy Cookie
519         memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
520
521         // Copy Command Data
522         memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &msgId, sizeof(MSG_MESSAGE_ID_T));
523
524         // Send Command to Messaging FW
525         char* pEventData = NULL;
526         AutoPtr<char> eventBuf(&pEventData);
527
528
529         write((char*)pCmd, cmdSize, &pEventData);
530
531         // Get Return Data
532         MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
533
534         if (pEvent->eventType != MSG_EVENT_SYNCML_OPERATION)
535         {
536                 THROW(MsgException::INVALID_RESULT, "Event Data Error");
537         }
538
539         return pEvent->result;
540 }
541