datacommsserver/esockserver/esock_messages/src/mobilitymessagesecom.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2008-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 #include "mobilitymessagesecom.h"
       
    17 #include <comms-infras/es_mobility_apiext.h>
       
    18 
       
    19 using namespace ESock;
       
    20 
       
    21 Meta::SMetaDataECom* CMobilityMsgFactory::NewMessageL(TAny* aParams)
       
    22    {
       
    23    TInt32 type = reinterpret_cast<TInt32>(aParams);
       
    24 
       
    25    switch (type)
       
    26       {
       
    27    case EPreferredCarrierAvailable:
       
    28       return new (ELeave) CPreferredCarrierAvailable;
       
    29       
       
    30    case ENewCarrierActive:
       
    31       return new (ELeave) CNewCarrierActive;
       
    32       
       
    33    default:
       
    34       User::Leave(KErrNotFound);
       
    35       }
       
    36 
       
    37    return NULL;
       
    38    }
       
    39 
       
    40 /*-------------------------------------------------------
       
    41 	Server -> Client messages
       
    42   -------------------------------------------------------*/
       
    43 
       
    44 START_ATTRIBUTE_TABLE( CPreferredCarrierAvailable, KMobilityMessagesImplementationUid, EPreferredCarrierAvailable )
       
    45    REGISTER_ATTRIBUTE( CPreferredCarrierAvailable, iOldAP, TMeta<TAccessPointInfo>)
       
    46    REGISTER_ATTRIBUTE( CPreferredCarrierAvailable, iNewAP, TMeta<TAccessPointInfo>)
       
    47    REGISTER_ATTRIBUTE( CPreferredCarrierAvailable, iIsUpgrade, TMeta<TBool>)
       
    48    REGISTER_ATTRIBUTE( CPreferredCarrierAvailable, iIsSeamless, TMeta<TBool>)
       
    49 END_ATTRIBUTE_TABLE()
       
    50 
       
    51 START_ATTRIBUTE_TABLE( CNewCarrierActive, KMobilityMessagesImplementationUid, ENewCarrierActive )
       
    52    REGISTER_ATTRIBUTE( CNewCarrierActive, iNewAP, TMeta<TAccessPointInfo>)
       
    53    REGISTER_ATTRIBUTE( CNewCarrierActive, iIsSeamless, TMeta<TBool>)
       
    54 END_ATTRIBUTE_TABLE()
       
    55 
       
    56 CPreferredCarrierAvailable::CPreferredCarrierAvailable()
       
    57    {
       
    58    }
       
    59 
       
    60 void CPreferredCarrierAvailable::DispatchL(MMobilityProtocolResp& aProtocol)
       
    61 	{
       
    62 	aProtocol.PreferredCarrierAvailable(iOldAP, iNewAP, iIsUpgrade, iIsSeamless);
       
    63 	}
       
    64 
       
    65 CNewCarrierActive::CNewCarrierActive()
       
    66    {
       
    67    }
       
    68 
       
    69 void CNewCarrierActive::DispatchL(MMobilityProtocolResp& aProtocol)
       
    70 	{
       
    71 	aProtocol.NewCarrierActive(iNewAP, iIsSeamless);
       
    72 	}
       
    73