|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 #include "mobilitymessages.h" |
|
22 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
23 #include <comms-infras/mobilitymessages_internal.h> |
|
24 #include <comms-infras/ss_mobility_apiext_internal.h> |
|
25 #endif |
|
26 |
|
27 #include <comms-infras/es_mobility_apiext.h> // MMobilityProtocolResp |
|
28 #include <comms-infras/ss_mobility_apiext.h> // MMobilityProtocolReq |
|
29 #include <elements/responsemsg.h> // CResponseMsg |
|
30 |
|
31 using namespace ESock; |
|
32 using namespace Elements; |
|
33 using namespace NetInterfaces; |
|
34 |
|
35 enum TMobilityRequestMessages |
|
36 { |
|
37 EMigrateToPreferredCarrier = 0, |
|
38 EIgnorePreferredCarrier, |
|
39 ENewCarrierAccepted, |
|
40 ENewCarrierRejected, |
|
41 EMobilityMessageSubscription, |
|
42 EMobilityMessageSubscriptionCancel, |
|
43 }; |
|
44 |
|
45 /*------------------------------------------------------- |
|
46 Client -> Server messages |
|
47 -------------------------------------------------------*/ |
|
48 |
|
49 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TMigrateToPreferredCarrier, KMobilityRequestMessagesImplementationUid, EMigrateToPreferredCarrier ) |
|
50 END_ATTRIBUTE_TABLE() |
|
51 |
|
52 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TIgnorePreferredCarrier, KMobilityRequestMessagesImplementationUid, EIgnorePreferredCarrier ) |
|
53 REGISTER_ATTRIBUTE( TIgnorePreferredCarrier, iReason, TMetaNumber) |
|
54 END_ATTRIBUTE_TABLE() |
|
55 |
|
56 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TNewCarrierAccepted, KMobilityRequestMessagesImplementationUid, ENewCarrierAccepted ) |
|
57 END_ATTRIBUTE_TABLE() |
|
58 |
|
59 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TNewCarrierRejected, KMobilityRequestMessagesImplementationUid, ENewCarrierRejected ) |
|
60 END_ATTRIBUTE_TABLE() |
|
61 |
|
62 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TMobilitySubscriptionMsg, KMobilityRequestMessagesImplementationUid, EMobilityMessageSubscription ) |
|
63 END_ATTRIBUTE_TABLE() |
|
64 |
|
65 EXPORT_START_ATTRIBUTE_TABLE_AND_FN( TMobilitySubscriptionCancelMsg, KMobilityRequestMessagesImplementationUid, EMobilityMessageSubscriptionCancel ) |
|
66 END_ATTRIBUTE_TABLE() |
|
67 |
|
68 EXPORT_C void TMigrateToPreferredCarrier::DispatchL(TInterfaceControl& aIntfCtl, const TSubSessionUniqueId& aSubSessionUniqueId, RResponseMsg& aResponseMsg) |
|
69 { |
|
70 AMobilityProtocolReq* i = reinterpret_cast<AMobilityProtocolReq*>(aIntfCtl.FetchInterfaceL(EMobilityApiExt)); |
|
71 i->MigrateToPreferredCarrier(aSubSessionUniqueId); |
|
72 aResponseMsg.Complete(KErrNone); |
|
73 } |
|
74 |
|
75 EXPORT_C void TIgnorePreferredCarrier::DispatchL(TInterfaceControl& aIntfCtl, const TSubSessionUniqueId& aSubSessionUniqueId, RResponseMsg& aResponseMsg) |
|
76 { |
|
77 AMobilityProtocolReq* i = reinterpret_cast<AMobilityProtocolReq*>(aIntfCtl.FetchInterfaceL(EMobilityApiExt)); |
|
78 i->IgnorePreferredCarrier(aSubSessionUniqueId); |
|
79 aResponseMsg.Complete(KErrNone); |
|
80 } |
|
81 |
|
82 EXPORT_C void TNewCarrierAccepted::DispatchL(TInterfaceControl& aIntfCtl, const TSubSessionUniqueId& aSubSessionUniqueId, RResponseMsg& aResponseMsg) |
|
83 { |
|
84 AMobilityProtocolReq* i = reinterpret_cast<AMobilityProtocolReq*>(aIntfCtl.FetchInterfaceL(EMobilityApiExt)); |
|
85 i->NewCarrierAccepted(aSubSessionUniqueId); |
|
86 aResponseMsg.Complete(KErrNone); |
|
87 } |
|
88 |
|
89 EXPORT_C void TNewCarrierRejected::DispatchL(TInterfaceControl& aIntfCtl, const TSubSessionUniqueId& aSubSessionUniqueId, RResponseMsg& aResponseMsg) |
|
90 { |
|
91 AMobilityProtocolReq* i = reinterpret_cast<AMobilityProtocolReq*>(aIntfCtl.FetchInterfaceL(EMobilityApiExt)); |
|
92 i->NewCarrierRejected(aSubSessionUniqueId); |
|
93 aResponseMsg.Complete(KErrNone); |
|
94 } |
|
95 |
|
96 EXPORT_C void TMobilitySubscriptionMsg::DispatchL(TInterfaceControl& aIntfCtl, const TSubSessionUniqueId& aSubSessionUniqueId, RResponseMsg& aResponseMsg) |
|
97 { |
|
98 AMobilityProtocolReq* i = reinterpret_cast<AMobilityProtocolReq*>(aIntfCtl.FetchInterfaceL(EMobilityApiExt)); |
|
99 i->SubscribeForMessage(aSubSessionUniqueId, CCommsMobilitySrvIpcResponder::NewL(aResponseMsg)); |
|
100 }; |
|
101 |
|
102 EXPORT_C void TMobilitySubscriptionCancelMsg::DispatchL(TInterfaceControl& aIntfCtl, const TSubSessionUniqueId& aSubSessionUniqueId, RResponseMsg& aResponseMsg) |
|
103 { |
|
104 AMobilityProtocolReq* i = reinterpret_cast<AMobilityProtocolReq*>(aIntfCtl.FetchInterfaceL(EMobilityApiExt)); |
|
105 i->CancelSubscription(aSubSessionUniqueId); |
|
106 aResponseMsg.Complete(KErrNone); |
|
107 }; |
|
108 |
|
109 DEFINE_MVIP_CTR(TMigrateToPreferredCarrier); |
|
110 DEFINE_MVIP_CTR(TIgnorePreferredCarrier); |
|
111 DEFINE_MVIP_CTR(TNewCarrierAccepted); |
|
112 DEFINE_MVIP_CTR(TNewCarrierRejected); |
|
113 DEFINE_MVIP_CTR(TMobilitySubscriptionMsg); |
|
114 DEFINE_MVIP_CTR(TMobilitySubscriptionCancelMsg); |
|
115 |
|
116 const TImplementationProxy MobilityReqMsgImplementationTable[] = |
|
117 { |
|
118 //NOTE: Entries must be sorted for the binary search to work efficiently! |
|
119 MVIP_CTR_ENTRY(EMigrateToPreferredCarrier, TMigrateToPreferredCarrier), |
|
120 MVIP_CTR_ENTRY(EIgnorePreferredCarrier, TIgnorePreferredCarrier), |
|
121 MVIP_CTR_ENTRY(ENewCarrierAccepted, TNewCarrierAccepted), |
|
122 MVIP_CTR_ENTRY(ENewCarrierRejected, TNewCarrierRejected), |
|
123 MVIP_CTR_ENTRY(EMobilityMessageSubscription, TMobilitySubscriptionMsg), |
|
124 MVIP_CTR_ENTRY(EMobilityMessageSubscriptionCancel, TMobilitySubscriptionCancelMsg), |
|
125 }; |
|
126 |
|
127 EXPORT_C CMobilityMsgPluginInfo* CMobilityMsgPluginInfo::NewL(TAny* /* aParams */) |
|
128 { |
|
129 return new(ELeave) CMobilityMsgPluginInfo(); |
|
130 } |
|
131 |
|
132 EXPORT_C const TImplementationProxy* CMobilityMsgPluginInfo::ImplementationProxy() const |
|
133 { |
|
134 return MobilityReqMsgImplementationTable; |
|
135 } |
|
136 |
|
137 EXPORT_C TInt CMobilityMsgPluginInfo::ImplementationProxyTableSize() const |
|
138 { |
|
139 return sizeof(MobilityReqMsgImplementationTable) / sizeof(MobilityReqMsgImplementationTable[0]); |
|
140 } |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |