locationmanager/geoconverter/src/cgeoconverter.cpp
changeset 45 a93990e5815e
parent 36 aa5a574040a4
child 52 40db28bb26b8
equal deleted inserted replaced
36:aa5a574040a4 45:a93990e5815e
    29     {
    29     {
    30     LOG("CGeoConverter::NewL");
    30     LOG("CGeoConverter::NewL");
    31     CGeoConverter* self = new( ELeave ) CGeoConverter( aObserver );
    31     CGeoConverter* self = new( ELeave ) CGeoConverter( aObserver );
    32     CleanupStack::PushL( self );
    32     CleanupStack::PushL( self );
    33     self->ConstructL();
    33     self->ConstructL();
    34     CleanupStack::Pop();
    34     CleanupStack::Pop(); // self
    35     return self;
    35     return self;
    36     }
    36     }
    37 
    37 
    38 // --------------------------------------------------------------------------
    38 // --------------------------------------------------------------------------
    39 // CGeoConverter::CGeoConverter()
    39 // CGeoConverter::CGeoConverter()
   133     LOG("CGeoConverter::ConvertL, begin");
   133     LOG("CGeoConverter::ConvertL, begin");
   134 #ifdef LOC_GEOTAGGING_CELLID    
   134 #ifdef LOC_GEOTAGGING_CELLID    
   135     
   135     
   136     //Set mobile country code
   136     //Set mobile country code
   137     TLex lexer( aNetworkInfo.iCountryCode );
   137     TLex lexer( aNetworkInfo.iCountryCode );
   138     TUint countryCode;
   138     TUint countryCode = 0;
   139     
   139     
   140     User::LeaveIfError( lexer.Val( countryCode, EDecimal) );
   140     User::LeaveIfError( lexer.Val( countryCode, EDecimal) );
   141     //Set mobile network code
   141     //Set mobile network code
   142     lexer = aNetworkInfo.iNetworkId;
   142     lexer = aNetworkInfo.iNetworkId;
   143     TUint networkCode;
   143     TUint networkCode = 0;
   144     User::LeaveIfError( lexer.Val( networkCode, EDecimal) );
   144     User::LeaveIfError( lexer.Val( networkCode, EDecimal) );
   145     LOG1("Network mode - %d", aNetworkInfo.iMode);
   145     LOG1("Network mode - %d", aNetworkInfo.iMode);
   146     CLbsAreaInfoBase* areaInfoBase = NULL;
   146     CLbsAreaInfoBase* areaInfoBase = NULL;
   147     switch(aNetworkInfo.iAccess)
   147     switch(aNetworkInfo.iAccess)
   148         {
   148         {
   183             }
   183             }
   184             break;
   184             break;
   185         default:
   185         default:
   186             LOG("Unknown network mode");
   186             LOG("Unknown network mode");
   187             User::Leave(KErrNotSupported);
   187             User::Leave(KErrNotSupported);
   188             break;
       
   189         }
   188         }
   190     //Add the cell information to the location info class. This class
   189     //Add the cell information to the location info class. This class
   191     //would be sent to the Location Monitor server that would perform the
   190     //would be sent to the Location Monitor server that would perform the
   192     //requested conversion and update the position estimate
   191     //requested conversion and update the position estimate
   193     if(areaInfoBase != NULL) // self check
   192     if(areaInfoBase != NULL) // self check
   194         {
   193         {
       
   194         // reset previous one.. to clear the local info.
       
   195         iLocInfo->ResetAreaInfo(CLbsLocationInfo::ELbsAreaInfoAll);
   195         iLocInfo->AddAreaInfoL( areaInfoBase ); 
   196         iLocInfo->AddAreaInfoL( areaInfoBase ); 
       
   197         //ownership is transferred.
       
   198         iWcdmaCellInfo = NULL;
       
   199         iGsmCellInfo = NULL;
   196         //Request conversion of GSM cell information to corresponding coordinate information
   200         //Request conversion of GSM cell information to corresponding coordinate information
   197         iLocConverter->ConvertLocationInfoL( *iLocInfo, ELbsConversionSilent, 
   201         iLocConverter->ConvertLocationInfoL( *iLocInfo, ELbsConversionSilent, 
   198                                                 ELbsConversionOutputPosition  );
   202                                                 ELbsConversionOutputPosition  );
   199         }
   203         }
   200 #endif    
   204 #endif