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