34 { |
34 { |
35 // ============================== MEMBER FUNCTIONS ============================ |
35 // ============================== MEMBER FUNCTIONS ============================ |
36 |
36 |
37 /*! |
37 /*! |
38 \class RApaIPCSession |
38 \class RApaIPCSession |
39 |
39 \brief Symbian class encapsulating RMessage2 interface |
40 Symbian class encapsulating RMessage2 interface |
|
41 */ |
40 */ |
42 |
41 |
43 /*! |
42 /*! |
44 Send a message |
43 Send a message. |
45 @param aFunction function code |
44 \param aFunction Function code. |
46 @return message completion code |
45 \return message Completion code. |
47 */ |
46 */ |
48 TInt RApaIPCSession::SendReceiveL(TInt aFunction) const |
47 TInt RApaIPCSession::SendReceiveL(TInt aFunction) const |
49 { |
48 { |
50 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceiveL(1)"); |
49 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceiveL(1)"); |
51 return User::LeaveIfError(RSessionBase::SendReceive(aFunction)); |
50 return User::LeaveIfError(RSessionBase::SendReceive(aFunction)); |
52 } |
51 } |
53 |
52 |
54 /*! |
53 /*! |
55 Send a message |
54 Send a message. |
56 @param aFunction function code |
55 \param aFunction Function code. |
57 @param aArgs parameter to server |
56 \param aArgs Parameter to server. |
58 @return message completion code |
57 \return Message completion code. |
59 */ |
58 */ |
60 TInt RApaIPCSession::SendReceiveL(TInt aFunction, const TIpcArgs& aArgs) const |
59 TInt RApaIPCSession::SendReceiveL(TInt aFunction, const TIpcArgs& aArgs) const |
61 { |
60 { |
62 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceiveL(2)"); |
61 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceiveL(2)"); |
63 return User::LeaveIfError(RSessionBase::SendReceive(aFunction,aArgs)); |
62 return User::LeaveIfError(RSessionBase::SendReceive(aFunction,aArgs)); |
64 } |
63 } |
65 |
64 |
66 /*! |
65 /*! |
67 Send message asynchronously |
66 Send message asynchronously. |
68 @param aFunction function code |
67 \param aFunction Function code. |
69 @param aStatus the request status object used to contain the |
68 \param aStatus The request status object used to contain the |
70 completion status of the request |
69 completion status of the request. |
71 */ |
70 */ |
72 EXPORT_C void RApaIPCSession::SendReceive(TInt aFunction, |
71 EXPORT_C void RApaIPCSession::SendReceive(TInt aFunction, |
73 TRequestStatus& aStatus) const |
72 TRequestStatus& aStatus) const |
74 { |
73 { |
75 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceive(1)"); |
74 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceive(1)"); |
76 RSessionBase::SendReceive(aFunction,aStatus); |
75 RSessionBase::SendReceive(aFunction,aStatus); |
77 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceive(1) done"); |
76 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceive(1) done"); |
78 } |
77 } |
79 |
78 |
80 /*! |
79 /*! |
81 Send message asynchronously |
80 Send message asynchronously. |
82 @param aFunction function code |
81 \param aFunction Function code. |
83 @param aArgs parameter to server |
82 \param aArgs Parameter to server. |
84 @param aStatus the request status object used to contain the |
83 \param aStatus The request status object used to contain the |
85 completion status of the request |
84 completion status of the request. |
86 */ |
85 */ |
87 void RApaIPCSession::SendReceive(TInt aFunction, |
86 void RApaIPCSession::SendReceive(TInt aFunction, |
88 const TIpcArgs& aArgs, |
87 const TIpcArgs& aArgs, |
89 TRequestStatus& aStatus) const |
88 TRequestStatus& aStatus) const |
90 { |
89 { |
92 RSessionBase::SendReceive(aFunction,aArgs,aStatus); |
91 RSessionBase::SendReceive(aFunction,aArgs,aStatus); |
93 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceive(2) done"); |
92 XQSERVICE_DEBUG_PRINT("RApaIPCSession::SendReceive(2) done"); |
94 } |
93 } |
95 |
94 |
96 /*! |
95 /*! |
97 Connect to server |
96 Connect to server. |
98 @param aServer server name |
97 \param aServer Server name. |
99 @param aVersion version of the server |
98 \param aVersion Version of the server. |
100 @return KErrNone success, otherwise system error code |
99 \return KErrNone on success, otherwise system error code. |
101 */ |
100 */ |
102 TInt RApaIPCSession::Connect(const TDesC& aServer, |
101 TInt RApaIPCSession::Connect(const TDesC& aServer, |
103 const TVersion& aVersion) |
102 const TVersion& aVersion) |
104 { |
103 { |
105 QString server = QString::fromUtf16(aServer.Ptr(), aServer.Length()); |
104 QString server = QString::fromUtf16(aServer.Ptr(), aServer.Length()); |
107 iVersion = aVersion; |
106 iVersion = aVersion; |
108 return CreateSession(aServer, aVersion, 10); |
107 return CreateSession(aServer, aVersion, 10); |
109 } |
108 } |
110 |
109 |
111 /*! |
110 /*! |
112 Get version info |
111 Get version info. |
113 @return version info |
112 \return Version info. |
114 */ |
113 */ |
115 TVersion RApaIPCSession::Version() const |
114 TVersion RApaIPCSession::Version() const |
116 { |
115 { |
117 XQSERVICE_DEBUG_PRINT("RApaIPCSession::Version"); |
116 XQSERVICE_DEBUG_PRINT("RApaIPCSession::Version"); |
118 return iVersion; |
117 return iVersion; |
119 } |
118 } |
120 |
119 |
121 |
120 /*! |
|
121 Get service uid. |
|
122 \return Service uid. |
|
123 */ |
122 TUid RApaIPCSession::ServiceUid() const |
124 TUid RApaIPCSession::ServiceUid() const |
123 { |
125 { |
124 XQSERVICE_DEBUG_PRINT("RApaIPCSession::ServiceUid"); |
126 XQSERVICE_DEBUG_PRINT("RApaIPCSession::ServiceUid"); |
125 return iUid; |
127 return iUid; |
126 } |
128 } |
127 |
129 |
|
130 /*! |
|
131 Set service uid. |
|
132 \param uid Service uid to set. |
|
133 */ |
128 void RApaIPCSession::setServiceUid(TInt uid) |
134 void RApaIPCSession::setServiceUid(TInt uid) |
129 { |
135 { |
130 XQSERVICE_DEBUG_PRINT("RApaIPCSession::setServiceUid %x", uid); |
136 XQSERVICE_DEBUG_PRINT("RApaIPCSession::setServiceUid %x", uid); |
131 iUid.iUid = uid; |
137 iUid.iUid = uid; |
132 } |
138 } |