supl/locationsuplfw/terminalinitiationapi/src/epos_suplterminalinternal.cpp
branchRCL_3
changeset 19 02ba3f1733c6
equal deleted inserted replaced
18:d746aee05493 19:02ba3f1733c6
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Client-Server communication
       
    15 *
       
    16 */
       
    17 #include <s32mem.h>
       
    18 #include <e32std.h>
       
    19 
       
    20 #include "epos_suplterminalinternal.h"
       
    21 #include "epos_suplterminalipc.h"
       
    22 #include "epos_suplterminalerrors.h"
       
    23 #include "epos_suplterminalptrholder.h"
       
    24 
       
    25 //-----------------------------------------------------------------------------
       
    26 // RSuplTerminalInternal
       
    27 //-----------------------------------------------------------------------------
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // RSuplTerminalInternal::RSuplTerminalInternal()
       
    31 // C++ default constructor can NOT contain any code, that might leave.
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 EXPORT_C RSuplTerminalInternal::RSuplTerminalInternal()
       
    35   : iConversionRequestIssued( EFalse )
       
    36    	{
       
    37 	}
       
    38 
       
    39 // ---------------------------------------------------------
       
    40 // RSuplTerminalInternal::ConvertAreaInfoToCoordinates
       
    41 //
       
    42 // (other items were commented in a header).
       
    43 // ---------------------------------------------------------
       
    44 //
       
    45 EXPORT_C void RSuplTerminalInternal::ConvertAreaInfoToCoordinates( TRequestStatus& aStatus, 
       
    46                                                                    TGeoCellInfo& aGeoCellInfo )
       
    47     {  
       
    48     __ASSERT_ALWAYS(SubSessionHandle(), 
       
    49                     User::Panic(KSuplClientFault, ESuplServerBadHandle));
       
    50     
       
    51     // Currently only SUPL 1.0 supports cell to geo-coordinates conversion.
       
    52     if( iSuplService != ESUPL_1_0 )
       
    53         {
       
    54         TRequestStatus *status = &aStatus; 
       
    55         User::RequestComplete(status,KErrNotSupported); 
       
    56         return;
       
    57         }
       
    58         
       
    59     // Fill the values of data member
       
    60     iGeoCellInfo.iMNC = aGeoCellInfo.iMNC;
       
    61     iGeoCellInfo.iMCC = aGeoCellInfo.iMCC;
       
    62     iGeoCellInfo.iCid = aGeoCellInfo.iCid;
       
    63     iGeoCellInfo.iLac = aGeoCellInfo.iLac;
       
    64     iGeoCellInfo.iConnectionPrompt = aGeoCellInfo.iConnectionPrompt;
       
    65     iGeoCellInfo.iWlanOnly = aGeoCellInfo.iWlanOnly; //OCC
       
    66     iGeoCellInfo.iGeoCellType = aGeoCellInfo.iGeoCellType;
       
    67    
       
    68     iPtrHolder->Ptr(0).Set(
       
    69         reinterpret_cast<TUint8*>(&iGeoCellInfo),
       
    70         sizeof(iGeoCellInfo),sizeof(iGeoCellInfo));
       
    71 
       
    72     TIpcArgs args;
       
    73 
       
    74     args.Set(0,&iPtrHolder->Ptr(0));
       
    75     iConversionRequestIssued = ETrue;
       
    76     SendReceive(ESuplTerminalSubssnLocationConversion, args, aStatus);  
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------
       
    80 // RSuplTerminalInternal::CancelLocationConversion
       
    81 //
       
    82 // (other items were commented in a header).
       
    83 // ---------------------------------------------------------
       
    84 //
       
    85 EXPORT_C void RSuplTerminalInternal::CancelLocationConversion()
       
    86     {  
       
    87     __ASSERT_ALWAYS(SubSessionHandle(), 
       
    88             User::Panic(KSuplClientFault, ESuplServerBadHandle));   
       
    89     if( iConversionRequestIssued )
       
    90         {
       
    91         iConversionRequestIssued = EFalse; 
       
    92         SendReceive(ESuplTerminalSubssnCancelLocationConversion); 
       
    93         }    
       
    94     }
       
    95 // end of file