Revision: 200943 PDK_3.0.d
authorMikko Sunikka <mikko.sunikka@nokia.com>
Fri, 06 Nov 2009 13:05:00 +0200
changeset 19 8d692d9f828f
parent 16 44bb89c96acb
child 22 76eb2bdc9c63
child 23 50974a8b132e
Revision: 200943 Kit: 200945
package_definition.xml
serviceproviders/sapi_location/inc/locationcb.h
serviceproviders/sapi_location/inc/locationinterface.h
serviceproviders/sapi_location/locationservice/inc/locationservice.h
serviceproviders/sapi_location/locationservice/src/locationcoreimp.cpp
serviceproviders/sapi_location/locationservice/src/locationservice.cpp
serviceproviders/sapi_location/src/locationcallBack.cpp
serviceproviders/sapi_location/src/locationinterface.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Fri Nov 06 13:05:00 2009 +0200
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+  <package id="serviceapi" name="Service API" levels="os mw1 mw2 app">
+  	<!-- should break up this collection into something meaningful -->
+    <collection id="serviceproviders" name="Service Providers" level="mw1">
+      <component id="sapi_applicationmanager" name="Application Manager SAPI" filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_applicationmanager/group"/>
+			<!-- should test bld.inf be #included? -->
+        <!-- <unit bldFile="serviceproviders/sapi_applicationmanager/tsrc/dev/cruntimetest/group"/> -->
+      </component>
+      <component id="sapi_calendar" name="Calendar SAPI" filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_calendar/group"/>
+			<!-- should test bld.inf be #included? -->
+        <!-- <unit bldFile="serviceproviders/sapi_calendar/tsrc/testing/tcalprovider_combined/group"/> -->
+      </component>
+      <component id="sapi_contacts_vpbk" name="Contacts Phonebook SAPI"  filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_contacts_vpbk/group"/>
+      </component>
+      <component id="sapi_landmarks" name="Landmarks SAPI" filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_landmarks/group"/>
+			<!-- should test bld.infs be #included? -->
+        <!-- <unit bldFile="serviceproviders/sapi_landmarks/tsrc/testing/tlandmarkstest/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_landmarks/tsrc/dev/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_landmarks/tsrc/testing/tlandmarksprovidertest/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_landmarks/tsrc/dev/landmarks_inputparams/group"/> -->
+      </component>
+      <component id="sapi_location" name="Location SAPI"  filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_location/group"/>
+			<!-- should test bld.infs be #included? -->
+        <!-- <unit bldFile="serviceproviders/sapi_location/tsrc/testing/performance/pgetloc/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_location/tsrc/testing/performance/pgetlocopts/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_location/tsrc/testing/performance/pgetlocasync/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_location/tsrc/testing/performance/pgetbearing/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_location/tsrc/dev/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_location/tsrc/testing/performance/pgetdistance/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_location/tsrc/testing/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_location/tsrc/testing/performance/pmove/group"/> -->
+      </component>
+      <component id="sapi_logging" name="Logging SAPI"  filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_logging/group"/>
+        <!-- <unit bldFile="serviceproviders/sapi_logging/tsrc/dev/group"/> -->
+      </component>
+      <component id="sapi_mediamanagement" name="Media Management SAPI" filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_mediamanagement/group"/>
+			<!-- should test bld.infs be #included? -->
+        <!-- <unit bldFile="serviceproviders/sapi_mediamanagement/tsrc/dev/taiwmediamgmttest/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_mediamanagement/tsrc/testing/performance/runtime_perf/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_mediamanagement/tsrc/testing/performance/s60_perf/group"/> -->
+      </component>
+      <component id="sapi_messaging" name="Messaging SAPI" filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_messaging/group"/>
+			<!-- should test bld.infs be #included? -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/notify/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/status/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/delete/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/getlist/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/s60_getlist/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/s60_asyncsend/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/s60_notify/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/send/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/s60_status/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/tmessagingprovidertest/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/s60_delete/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/s60_send/group"/> -->
+        <!-- <unit bldFile="serviceproviders/sapi_messaging/tsrc/testing/performance/asyncsend/group"/> -->
+      </component>
+      <component id="sapi_sensor" name="Sensor SAPI" filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_sensor/group"/>
+      </component>
+      <component id="sapi_sysinfo" name="Sysinfo SAPI" filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_sysinfo/group"/>
+      </component>
+      <component id="sapi_serviceregistry" name="Service Registry SAPI" filter="s60" class="plugin">
+        <unit bldFile="serviceproviders/sapi_serviceregistry/group"/>
+			<!-- should test bld.infs be #included? -->
+        <!-- <unit bldFile="serviceproviders/sapi_serviceregistry/tsrc/dev/group"/> -->
+      </component>
+    </collection>
+    <collection id="serviceapi_info" name="Service API Info" level="app">
+      <component id="serviceproviders_build" filter="s60" name="Service API Build">
+      	<!--  can the exports be distributed? -->
+        <unit bldFile="serviceproviders/group"/>
+      </component>
+      <component id="serviceapi_test" filter="s60" name="Service API Test" purpose="development">
+		<!-- Does this need to exist? -->
+        <!-- <unit bldFile="tsrc/group"/> -->
+      </component>
+    </collection>
+  </package>
+</SystemDefinition>
--- a/serviceproviders/sapi_location/inc/locationcb.h	Mon Oct 26 08:20:53 2009 +0200
+++ b/serviceproviders/sapi_location/inc/locationcb.h	Fri Nov 06 13:05:00 2009 +0200
@@ -68,7 +68,7 @@
      
      LocationInterfaceCB( MLiwNotifyCallback* aCallBack , 
      					  const CLiwGenericParamList* aInParmList ,	
-     				      TPositionModuleInfo* aModuleInfo,
+     				      //TPositionModuleInfo* aModuleInfo,
      				      TInt32 aTransactionId = 0 ) ;
      				      
     
@@ -88,7 +88,7 @@
 
     static LocationInterfaceCB * NewL( MLiwNotifyCallback* aCallBack , 
     									 const CLiwGenericParamList* aInParmList, 
-    									 TPositionModuleInfo* aModuleInfo ,
+    									 //TPositionModuleInfo* aModuleInfo ,
     									 TInt32 aTransactionId = 0)  ;
 
     /**
--- a/serviceproviders/sapi_location/inc/locationinterface.h	Mon Oct 26 08:20:53 2009 +0200
+++ b/serviceproviders/sapi_location/inc/locationinterface.h	Fri Nov 06 13:05:00 2009 +0200
@@ -26,7 +26,6 @@
 
 
 // CONSTANTS
-const TInt KMaxSupportedFields = 25 ;
 
 
 
@@ -271,7 +270,6 @@
      * Positioning module used for location estimation
      */	            
     	            
-    TInt SetSupportedFields() ;  
 
     /**
      * Internal utility function which gets all location information which module supports
@@ -296,27 +294,13 @@
     
 
     /**
-     * Member variable which holds all the Generic position  information
-     */
-
-    HPositionGenericInfo *iGenericPosInfo ;
-
-    /**
-     * Class member which contains module information which is used for location esitmation
-     */
-    TPositionModuleInfo   iModuleInfo ;
-    /**
      * Class member which is used to obtain updates of Last Known Position
      */
     TPosition iPosition;
-
     /**
-     * Class member which contains all the field ids of all the supported Hposition info fields
-     */ 
-
-    TPositionFieldId iFieldList[KMaxSupportedFields] ;
-
-
+     * Generic position class
+     */
+    HPositionGenericInfo *iGenericPosition;
 
     };
 
--- a/serviceproviders/sapi_location/locationservice/inc/locationservice.h	Mon Oct 26 08:20:53 2009 +0200
+++ b/serviceproviders/sapi_location/locationservice/inc/locationservice.h	Fri Nov 06 13:05:00 2009 +0200
@@ -40,6 +40,7 @@
 _LIT8(KVerAccuracy,"VerticalAccuracy");
 
 _LIT(KUnknown,"Unknown");
+const TInt KMaxSupportedFields = 25 ;
 
 /**
  * Default Update options
@@ -57,6 +58,7 @@
 const TInt KSMaxAge = 0;
 const TInt KGetLocationReq = 0 ;
 const TInt KTraceReq   = 1 ;
+const TInt errServiceNotReady = 1006;
 
 /**
  * Enums required for mathoperations
@@ -279,6 +281,8 @@
 	      */
 	     
 	     void GetHighAccuracyModuleL(TPositionModuleId* aModId);
+         TInt SetSupportedFields() ; 
+         TInt SetRequestingField();
 
 
 
@@ -319,6 +323,20 @@
 	     * Module indtifier used by location server for getting location information
 	     */
 	    TPositionModuleId iModuleId ; 
+	    /**
+         * Member variable which holds all the Generic position  information
+         */
+
+        HPositionGenericInfo *iGenericPosInfo ;
+        /**
+         * Class member which contains all the field ids of all the supported Hposition info fields
+         */ 
+
+        TPositionFieldId iFieldList[KMaxSupportedFields] ;
+        /**
+        * Class member which contains module information which is used for location esitmation
+        */
+       TPositionModuleInfo   iModuleInfo ;
 
     };
 
--- a/serviceproviders/sapi_location/locationservice/src/locationcoreimp.cpp	Mon Oct 26 08:20:53 2009 +0200
+++ b/serviceproviders/sapi_location/locationservice/src/locationcoreimp.cpp	Fri Nov 06 13:05:00 2009 +0200
@@ -65,7 +65,7 @@
         User :: LeaveIfError((this->iPositioner).Open(aPositionServer)) ; 
         }
 
-    CleanupClosePushL(iPositioner);
+    //CleanupClosePushL(iPositioner);
     //Set the identity of this particular requestor
     User::LeaveIfError( (this->iPositioner).SetRequestor( 
             CRequestor::ERequestorService,
@@ -75,14 +75,14 @@
     this->iPosInfoBase = &(this->iPositionInfo);
     this->iRequestType = aRequestType;
     this->iGenericPosInfo = HPositionGenericInfo :: NewL();
-    CleanupStack :: PushL(this->iGenericPosInfo);
+    //CleanupStack :: PushL(this->iGenericPosInfo);
 
     if(aList)
         {
         User :: LeaveIfError((this->iGenericPosInfo)->SetRequestedFields(aList));
         }
 
-    CleanupStack ::Pop(this->iGenericPosInfo );
+    //CleanupStack ::Pop(this->iGenericPosInfo );
     CleanupStack::Pop(&iPositioner);
     }
 /**
@@ -197,7 +197,10 @@
     }
 
     iPositioner.NotifyPositionUpdate( *iGenericPosInfo, iStatus );
-    SetActive() ;
+    if (!IsActive())
+        {
+        SetActive();
+        }
     return KErrNone ;
     }
 
@@ -234,7 +237,10 @@
 					if(!this->IsStatusComplete())
 					{
 						iPositioner.NotifyPositionUpdate( *iGenericPosInfo, iStatus );
-						SetActive();
+						if (!IsActive())
+                            {
+                            SetActive();
+                            }
 					}
 					 	
 				}
@@ -254,7 +260,10 @@
                         {
                         iPositioner.NotifyPositionUpdate( *iGenericPosInfo,
                                 iStatus);
-                        SetActive();
+                        if (!IsActive())
+                            {
+                            SetActive();
+                            }
                         }
 
                     }
--- a/serviceproviders/sapi_location/locationservice/src/locationservice.cpp	Mon Oct 26 08:20:53 2009 +0200
+++ b/serviceproviders/sapi_location/locationservice/src/locationservice.cpp	Fri Nov 06 13:05:00 2009 +0200
@@ -31,6 +31,7 @@
  
  
 EXPORT_C CLocationService :: CLocationService()
+						  :iGenericPosInfo(NULL)
     {
 	//No Implementation Required Here
     }
@@ -60,6 +61,7 @@
         }
     iPosServer.Close();
     iRegTable.Close();
+    delete iGenericPosInfo;
 
     }
  
@@ -89,12 +91,18 @@
 void CLocationService::ConstructL()
     {
     User :: LeaveIfError(iPosServer.Connect());
-    CleanupClosePushL(iPosServer);
+    //CleanupClosePushL(iPosServer);
+    iGenericPosInfo = HPositionGenericInfo::NewL() ;
+
+    if ( !iGenericPosInfo )
+        {
+        User::Leave( KErrNoMemory ) ;
+        }
     
     //Get the module id of the default module available
-    User :: LeaveIfError(iPosServer.GetDefaultModuleId(iModuleId));
+    //User :: LeaveIfError(iPosServer.GetDefaultModuleId(iModuleId));
 
-    CleanupStack::Pop(&iPosServer);
+    //CleanupStack::Pop(&iPosServer);
     }
 
 /**
@@ -111,7 +119,7 @@
     //Flags used for indicating if a particular module is found
     TInt termInternalFlag = 0;   
     TInt termFlag = 0 ,assisFlag = 0 ,networkFlag = 0,unknownFlag = 0;
-    TInt err;
+    //TInt err;
     
     User::LeaveIfError(iPosServer.GetNumModules(numOfModules));
         
@@ -171,26 +179,43 @@
  */
 
 EXPORT_C void  CLocationService :: GetLocationL( TPositionInfoBase* aInfoBase ,
-        const TPositionUpdateOptions* aUpdateOpts,TBool aEnableHighAcc )
+                                                 const TPositionUpdateOptions* aUpdateOpts,
+                                                 TBool aEnableHighAcc )
     {
+    //Check if atleast one of the module is enabled
+    TInt modError = iPosServer.GetDefaultModuleId(iModuleId);
+    if (modError)
+        {
+        User::Leave(errServiceNotReady);
+        }
     // Open subsession to the position server
     TPositionModuleId ModuleId;
-    TInt error;
+    //TInt error;
     if(aEnableHighAcc)
         {
         GetHighAccuracyModuleL(&ModuleId);
        
         User::LeaveIfError(iPositioner.Open(iPosServer,ModuleId));
         
+        iModuleId = ModuleId;
         }
     else
         {
         User::LeaveIfError(iPositioner.Open(iPosServer));
+        User::LeaveIfError(iPosServer.GetDefaultModuleId(iModuleId));
         }
 
     
-    CleanupClosePushL(iPositioner);
-
+    //CleanupClosePushL(iPositioner);
+    TInt errorInprocessing = KErrNone;
+    errorInprocessing = SetRequestingField();
+    if(errorInprocessing)
+        {
+        iPositioner.Close();
+        User::Leave(errorInprocessing);
+        }
+   // (static_cast<HPositionGenericInfo*>(aInfoBase))->ClearRequestedFields() ;
+    (static_cast<HPositionGenericInfo*>(aInfoBase))->SetRequestedFields(iFieldList) ;
     //setting identity for this requestor
     User::LeaveIfError( iPositioner.SetRequestor( CRequestor::ERequestorService,
             CRequestor::EFormatApplication,
@@ -200,7 +225,14 @@
 
     if(aUpdateOpts)
         {
-        User::LeaveIfError(iPositioner.SetUpdateOptions(*aUpdateOpts));
+        TInt errorInprocessing = iPositioner.SetUpdateOptions(*aUpdateOpts);
+        
+        if(errorInprocessing)
+           {
+           iPositioner.Close();
+           User::Leave(errorInprocessing);
+           }
+        
         }
 
     else
@@ -227,7 +259,8 @@
 
     iPositioner.NotifyPositionUpdate( *aInfoBase, status );
     User :: WaitForRequest(status) ;
-    CleanupStack::PopAndDestroy(&iPositioner);
+    //CleanupStack::PopAndDestroy(&iPositioner);
+    iPositioner.Close();
     
     User::LeaveIfError(status.Int());
     }
@@ -237,7 +270,8 @@
  * positioning moulde, currently this methods only supports info of default module indentifier
  */
 
- EXPORT_C TInt CLocationService :: GetModuleInfo( TPositionModuleInfoBase& aModuleInfo )   const
+EXPORT_C TInt CLocationService :: GetModuleInfo( 
+        TPositionModuleInfoBase& aModuleInfo ) const
     {
     return  iPosServer.GetModuleInfoById(iModuleId , aModuleInfo) ;
 
@@ -252,27 +286,35 @@
  */
 EXPORT_C void CLocationService :: GetLocationL( MLocationCallBack* aCallBackObj ,
         TInt aLocationInfoCategory,
-        TPositionFieldIdList aFieldList ,
+        TPositionFieldIdList/* aFieldList*/ ,
         const TPositionUpdateOptions* aUpateOptions,
         TBool aEnableHighAcc 
 )
     {  
+    TInt modError = iPosServer.GetDefaultModuleId(iModuleId);
+    if (modError)
+        {
+        User::Leave(errServiceNotReady);
+        }
     TPositionModuleId ModuleId;
     if(aEnableHighAcc)
         {
         GetHighAccuracyModuleL(&ModuleId);
+        iModuleId = ModuleId;
         
         }
     else
         {
         //Indicates that when opening the subsession ,moudleId need not be specified
         ModuleId.iUid = 0;       
+        User::LeaveIfError(iPosServer.GetDefaultModuleId(iModuleId));
         }
 
     TInt err = KErrGeneral;
+    User::LeaveIfError(SetSupportedFields());
 
     CGetLoc* activeGetLoc = CGetLoc :: NewL(iPosServer ,
-            aFieldList ,
+            iFieldList ,
             KGetLocationRequest,
             aLocationInfoCategory,
             ModuleId) ;
@@ -300,10 +342,15 @@
 
 EXPORT_C void CLocationService :: TraceL( MLocationCallBack* aCallBackObj ,
         TInt aLocationInfoCategory,
-        TPositionFieldIdList aFiledList ,
+        TPositionFieldIdList/* aFiledList*/ ,
         const TPositionUpdateOptions* aUpateOptions,
         TBool aEnableHighAcc )
     {
+    TInt modError = iPosServer.GetDefaultModuleId(iModuleId);
+    if (modError)
+        {
+        User::Leave(errServiceNotReady);
+        }
     TPositionModuleId ModuleId;
     if(aEnableHighAcc)
         {
@@ -312,15 +359,17 @@
             {
             User::Leave(KErrGeneral);
             }
+        iModuleId = ModuleId;
         }
     else
         {
         //Indicates that when opening the subsession ,moudleId need not be specified
         ModuleId.iUid = 0;          
+        User::LeaveIfError(iPosServer.GetDefaultModuleId(iModuleId));
         }
     
     CGetLoc* activeTrace = CGetLoc :: NewL(iPosServer ,
-            aFiledList ,
+            iFieldList ,
             KTraceRequest,
             aLocationInfoCategory,
             ModuleId) ;
@@ -501,3 +550,127 @@
 
     return KErrNotFound;
     }
+TInt CLocationService :: SetSupportedFields()
+    {
+    
+    TUint fieldIter = 0 ;
+    //get positioning module information
+    TInt infoerr = GetModuleInfo(iModuleInfo);
+    if (infoerr)
+        {
+        return infoerr;
+        }
+
+    TPositionModuleInfo :: TCapabilities  currCapability  = iModuleInfo.Capabilities() ;
+
+    if(currCapability & TPositionModuleInfo :: ECapabilitySpeed) //set horizontal,vertical speeds along with errros 
+        {   
+        iFieldList[fieldIter++] = EPositionFieldHorizontalSpeed ;
+        
+        iFieldList[fieldIter++] = EPositionFieldHorizontalSpeedError ;
+        iFieldList[fieldIter++] = EPositionFieldVerticalSpeed ;
+        iFieldList[fieldIter++] = EPositionFieldVerticalSpeedError ;
+        }
+
+    if(currCapability & TPositionModuleInfo :: ECapabilitySatellite) //Set satellite info fields if positioning module supports
+        {                                                               //
+        
+        iFieldList[fieldIter++] = EPositionFieldSatelliteNumInView ;
+        iFieldList[fieldIter++] = EPositionFieldSatelliteNumUsed ;
+        iFieldList[fieldIter++] = EPositionFieldSatelliteTime ;
+        iFieldList[fieldIter++] = EPositionFieldSatelliteHorizontalDoP ;
+        iFieldList[fieldIter++] = EPositionFieldSatelliteVerticalDoP ;
+        
+        }
+
+    if(currCapability & TPositionModuleInfo :: ECapabilityDirection) //Set Direction info fields if positioning module supports
+        {
+        
+        iFieldList[fieldIter++] = EPositionFieldTrueCourse ;
+        iFieldList[fieldIter++] = EPositionFieldTrueCourseError ;
+        iFieldList[fieldIter++] = EPositionFieldMagneticCourse ;
+        iFieldList[fieldIter++] = EPositionFieldMagneticCourseError ;
+        
+        }
+    
+
+    if(currCapability & TPositionModuleInfo :: ECapabilityCompass) //Set NMEA fields if positioning module supports 
+        {
+            
+        iFieldList[fieldIter++] = EPositionFieldHeading ;
+        iFieldList[fieldIter++] = EPositionFieldHeadingError ;
+        iFieldList[fieldIter++] = EPositionFieldMagneticHeading ;
+        iFieldList[fieldIter++] = EPositionFieldMagneticHeadingError ;
+        
+        }
+    
+    
+   iFieldList[fieldIter] = EPositionFieldNone  ;   //Field Termination 
+   iGenericPosInfo->ClearRequestedFields() ;
+   iGenericPosInfo->SetRequestedFields(iFieldList) ;
+  
+  
+   return KErrNone ;
+   }
+TInt CLocationService :: SetRequestingField()
+    {
+    
+    TUint fieldIter = 0 ;
+    //get positioning module information
+    TInt infoerr = GetModuleInfo(iModuleInfo);
+    if (infoerr)
+        {
+        return infoerr;
+        }
+
+    TPositionModuleInfo :: TCapabilities  currCapability  = iModuleInfo.Capabilities() ;
+
+    if(currCapability & TPositionModuleInfo :: ECapabilitySpeed) //set horizontal,vertical speeds along with errros 
+        {   
+        iFieldList[fieldIter++] = EPositionFieldHorizontalSpeed ;
+        
+        iFieldList[fieldIter++] = EPositionFieldHorizontalSpeedError ;
+        iFieldList[fieldIter++] = EPositionFieldVerticalSpeed ;
+        iFieldList[fieldIter++] = EPositionFieldVerticalSpeedError ;
+        }
+
+    if(currCapability & TPositionModuleInfo :: ECapabilitySatellite) //Set satellite info fields if positioning module supports
+        {                                                               //
+        
+        iFieldList[fieldIter++] = EPositionFieldSatelliteNumInView ;
+        iFieldList[fieldIter++] = EPositionFieldSatelliteNumUsed ;
+        iFieldList[fieldIter++] = EPositionFieldSatelliteTime ;
+        iFieldList[fieldIter++] = EPositionFieldSatelliteHorizontalDoP ;
+        iFieldList[fieldIter++] = EPositionFieldSatelliteVerticalDoP ;
+        
+        }
+
+    if(currCapability & TPositionModuleInfo :: ECapabilityDirection) //Set Direction info fields if positioning module supports
+        {
+        
+        iFieldList[fieldIter++] = EPositionFieldTrueCourse ;
+        iFieldList[fieldIter++] = EPositionFieldTrueCourseError ;
+        iFieldList[fieldIter++] = EPositionFieldMagneticCourse ;
+        iFieldList[fieldIter++] = EPositionFieldMagneticCourseError ;
+        
+        }
+    
+
+    if(currCapability & TPositionModuleInfo :: ECapabilityCompass) //Set NMEA fields if positioning module supports 
+        {
+            
+        iFieldList[fieldIter++] = EPositionFieldHeading ;
+        iFieldList[fieldIter++] = EPositionFieldHeadingError ;
+        iFieldList[fieldIter++] = EPositionFieldMagneticHeading ;
+        iFieldList[fieldIter++] = EPositionFieldMagneticHeadingError ;
+        
+        }
+    
+    
+   iFieldList[fieldIter] = EPositionFieldNone  ;   //Field Termination 
+   
+  
+  
+   return KErrNone ;
+   }
+
--- a/serviceproviders/sapi_location/src/locationcallBack.cpp	Mon Oct 26 08:20:53 2009 +0200
+++ b/serviceproviders/sapi_location/src/locationcallBack.cpp	Fri Nov 06 13:05:00 2009 +0200
@@ -43,11 +43,11 @@
  
 LocationInterfaceCB :: LocationInterfaceCB( MLiwNotifyCallback* aCallBack ,
 										const CLiwGenericParamList* aInParmList ,	
-     				      				TPositionModuleInfo* aPositionModuleInfo ,
+     				      				//TPositionModuleInfo* aPositionModuleInfo ,
      				      				TInt32 aTransactionId ) : iCallBack(aCallBack), 
      				      										 iTransactionId(aTransactionId)
     {
-    iModuleInfo = aPositionModuleInfo	;
+    //iModuleInfo = aPositionModuleInfo	;
     
     //Extract the location info category from inputparamlist
     TInt index = 0;
@@ -85,11 +85,11 @@
  
 LocationInterfaceCB *LocationInterfaceCB :: NewL(MLiwNotifyCallback* aCallBack  ,
 												const CLiwGenericParamList* aInParmList ,  
-												TPositionModuleInfo* aPositionModuleInfo,
+												//TPositionModuleInfo* aPositionModuleInfo,
 												TInt32 aTransactionid  ) 
     {
     LocationInterfaceCB *self = new(ELeave) LocationInterfaceCB(aCallBack , aInParmList ,
-    															aPositionModuleInfo, aTransactionid) ;
+    															/*aPositionModuleInfo,*/ aTransactionid) ;
     CleanupStack::PushL(self);
 
     //Store the outparam and in param list
@@ -194,12 +194,11 @@
         result->InsertL(KVerAccuracy, TLiwVariant((TReal)Val1)) ;
         }
     
-    TPositionModuleInfo :: TCapabilities  currCapability  = iModuleInfo->Capabilities() ;
+    //TPositionModuleInfo :: TCapabilities  currCapability  = iModuleInfo->Capabilities() ;
     
     if ( iLocinfoCategory == EGenericInfo )
 	    {
-	    if(currCapability & TPositionModuleInfo :: ECapabilitySpeed) //Populate output param with speed info
-        {
+	   
         TReal32 speedinfo = 0 ;
 
         if(!aGenericInfo->GetValue(EPositionFieldHorizontalSpeed , speedinfo) ) //Extract speed 
@@ -215,11 +214,8 @@
 
 
 
-        }   //End of EcapabilitySpeed 
 
 
-	    if(currCapability & TPositionModuleInfo :: ECapabilitySatellite) //Extract satellitinfo if any and append it
-	        {																//as part of out parm list
 	        TInt8 satinfo  = 0;
 
 	        if(!aGenericInfo->GetValue(EPositionFieldSatelliteNumInView , satinfo))
@@ -232,10 +228,8 @@
 		        }
 
 
-	        }
+	                                                                   
 
-	    if(currCapability & TPositionModuleInfo :: ECapabilityDirection) //Extract direction info if any and append it 
-	        {                                                               // as part of out parm list
 	        TReal32 direcinfo = 0;
 
 	        if(!aGenericInfo->GetValue(EPositionFieldTrueCourse , direcinfo) )
@@ -264,17 +258,13 @@
 	            	
 	            }
 
-	        }
-
-
-	    if(currCapability & TPositionModuleInfo :: ECapabilityCompass) //Extract compass info if any and append it 
-	        {                                                               // as part of out parm list
+	       
 	        TReal32 compassinfo ;
 
 	        if(!aGenericInfo->GetValue(EPositionFieldHeading , compassinfo) )
 	            {
 	            result->InsertL(KPositionFieldHeading,TLiwVariant((TReal)compassinfo));
-	            ;
+           
 	            }
 
 
@@ -300,7 +290,6 @@
 
 
 
-	        }
 
 	    /*if( currCapability & TPositionModuleInfo :: ECapabilityNmea ) //Extract Nmea info if any and append it 	
 	        {                                                             //as part of out param list  
--- a/serviceproviders/sapi_location/src/locationinterface.cpp	Mon Oct 26 08:20:53 2009 +0200
+++ b/serviceproviders/sapi_location/src/locationinterface.cpp	Fri Nov 06 13:05:00 2009 +0200
@@ -51,7 +51,7 @@
  	 	 delete iHandleCB[iter] ;
  	 	}
  	 iHandleCB.Close();
-	 delete iGenericPosInfo ;
+	 delete iGenericPosition ;
  
  	
     }
@@ -66,16 +66,16 @@
     }
 void CLocationInterface::ConstructL()
     {
-    iGenericPosInfo = HPositionGenericInfo::NewL() ;
+    iGenericPosition = HPositionGenericInfo::NewL() ;
 
-    if ( !iGenericPosInfo )
+    if ( !iGenericPosition )
         {
         User::Leave( KErrNoMemory ) ;
         }
 
     iLocationService = CLocationService::NewL() ;
-    User::LeaveIfError( iLocationService->GetModuleInfo( iModuleInfo ) );
-    User::LeaveIfError( this->SetSupportedFields() );
+    //User::LeaveIfError( iLocationService->GetModuleInfo( iModuleInfo ) );
+    //User::LeaveIfError( this->SetSupportedFields() );
     }
 
 
@@ -148,6 +148,11 @@
 				sapiErr = SErrMissingArgument;
 				break;
 			}
+		case SErrServiceNotReady:
+		    {
+                sapiErr = SErrServiceNotReady;
+		        break;
+			}
 		default:
 			{
 				sapiErr = SErrGeneralError;
@@ -245,7 +250,7 @@
         User::LeaveIfError(iLocationService->GetLastKnownLoc(iPosition)) ;            
         TUint category1 = EBasicInfo;
 
-        iGenericPosInfo->SetPosition(iPosition);
+        iGenericPosition->SetPosition(iPosition);
         GetLocationInfo(aOutParamList, category1) ;
 
         }
@@ -434,13 +439,13 @@
                 }
             LocationInterfaceCB* callback =
             LocationInterfaceCB::NewL(aCallback,
-                    &aInParamList, &iModuleInfo, transid) ;
+                    &aInParamList, /*&iModuleInfo,*/ transid) ;
 
             CleanupStack :: PushL(callback) ;                   
             callback->SetRequestType(KGetLocationCB) ;
             
             iLocationService->GetLocationL(callback ,category,
-                    iFieldList,updateoptions,enableHighAcc) ;	                    
+                    NULL,updateoptions,enableHighAcc) ;	                    
             //Store the allocatioed address 
             iHandleCB.Append(callback);
             //Append Transcationid to out list
@@ -581,7 +586,7 @@
                     }
                 }
 
-            iLocationService->GetLocationL(iGenericPosInfo,
+            iLocationService->GetLocationL(iGenericPosition,
                     updateOptions,enableHighAcc) ;
             GetLocationInfo(aOutParamList,category) ; 
             
@@ -782,12 +787,12 @@
 
         LocationInterfaceCB* callback =
         LocationInterfaceCB::NewL(aCallback,
-                &aOutParamList, &iModuleInfo, transid) ;
+                &aOutParamList,/* &iModuleInfo,*/ transid) ;
         CleanupStack :: PushL(callback) ;
         callback->SetRequestType(KTraceCB) ;
 
 
-        iLocationService->TraceL( callback, catergory,iFieldList, 
+        iLocationService->TraceL( callback, catergory,NULL, 
                 updateOption,enableHighAcc );
         iHandleCB.Append(callback);
         aOutParamList.AppendL(TLiwGenericParam(KTransactionId,
@@ -1272,71 +1277,6 @@
  * positioning module used
  */ 
 
-TInt CLocationInterface :: SetSupportedFields()
-    {
-	//Extract all the information Accuracy, timestamp, satellite and course info and append 
-	// to out parmlist
-
-	
-	
-	TUint fieldIter = 0 ;
-
-	TPositionModuleInfo :: TCapabilities  currCapability  = iModuleInfo.Capabilities() ;
-
-	if(currCapability & TPositionModuleInfo :: ECapabilitySpeed) //set horizontal,vertical speeds along with errros 
-        {   
-        iFieldList[fieldIter++] = EPositionFieldHorizontalSpeed ;
-        iFieldList[fieldIter++] = EPositionFieldHorizontalSpeedError ;
-        iFieldList[fieldIter++] = EPositionFieldVerticalSpeed ;
-        iFieldList[fieldIter++] = EPositionFieldVerticalSpeedError ;
-        }
-
-	if(currCapability & TPositionModuleInfo :: ECapabilitySatellite) //Set satellite info fields if positioning module supports
-	    {                                                               //
-		
-		iFieldList[fieldIter++] = EPositionFieldSatelliteNumInView ;
-		iFieldList[fieldIter++] = EPositionFieldSatelliteNumUsed ;
-        iFieldList[fieldIter++] = EPositionFieldSatelliteTime ;
-        iFieldList[fieldIter++] = EPositionFieldSatelliteHorizontalDoP ;
-        iFieldList[fieldIter++] = EPositionFieldSatelliteVerticalDoP ;
-        
-	    }
-
-	if(currCapability & TPositionModuleInfo :: ECapabilityDirection) //Set Direction info fields if positioning module supports
-    	{
-		
-		iFieldList[fieldIter++] = EPositionFieldTrueCourse ;
-		iFieldList[fieldIter++] = EPositionFieldTrueCourseError ;
-		iFieldList[fieldIter++] = EPositionFieldMagneticCourse ;
-		iFieldList[fieldIter++] = EPositionFieldMagneticCourseError ;
-		
-    	}
-    
-
-	if(currCapability & TPositionModuleInfo :: ECapabilityCompass) //Set NMEA fields if positioning module supports 
-    	{
-			
-		iFieldList[fieldIter++] = EPositionFieldHeading ;
-		iFieldList[fieldIter++] = EPositionFieldHeadingError ;
-		iFieldList[fieldIter++] = EPositionFieldMagneticHeading ;
-		iFieldList[fieldIter++] = EPositionFieldMagneticHeadingError ;
-		
-    	}
-	
-	/*if(currCapability & TPositionModuleInfo :: ECapabilityNmea)
-    	{
-		
-		iFieldList[fieldIter++] = EPositionFieldNMEASentences ;
-		iFieldList[fieldIter++] = EPositionFieldNMEASentencesStart ;
-		
-    	}*/
-	iFieldList[fieldIter] = EPositionFieldNone  ;   //Field Termination 
-   iGenericPosInfo->ClearRequestedFields() ;
-   iGenericPosInfo->SetRequestedFields(iFieldList) ;
-  
-  
-  return KErrNone ;
-    }
 
 /**
  * CLocationInterface :: GetLocationInfo an internal utility funtionin, gets all the location information 
@@ -1347,7 +1287,7 @@
 void CLocationInterface :: GetLocationInfo( CLiwGenericParamList& aOutParamList,TInt aPosInfoCategory)
     {
     TPosition pos ;
-    iGenericPosInfo->GetPosition(pos) ; //Now populate outparam list with latitude, longitude and altitude data
+    iGenericPosition->GetPosition(pos) ; //Now populate outparam list with latitude, longitude and altitude data
 
     CLiwDefaultMap *Result = CLiwDefaultMap::NewL() ; 
     
@@ -1382,22 +1322,21 @@
     TLiwVariant MapVariant(Result) ;
      
    
-     TPositionModuleInfo :: TCapabilities  currCapability  = iModuleInfo.Capabilities() ;
+     //TPositionModuleInfo :: TCapabilities  currCapability  = iModuleInfo.Capabilities() ;
 
 	 if ( aPosInfoCategory == EGenericPositionInfo )
 	     {
-	     if(currCapability & TPositionModuleInfo :: ECapabilitySpeed) //Populate output param with speed info
-		    {
+	     
 		    TReal32 speedinfo = 0 ;
 
-		    if(!iGenericPosInfo->GetValue(EPositionFieldHorizontalSpeed , speedinfo))  //Extract speed 
+        if(!iGenericPosition->GetValue(EPositionFieldHorizontalSpeed , speedinfo))  //Extract speed 
 		    	{
 		    	 Result->InsertL(KPositionFieldHorizontalSpeed ,TLiwVariant((TReal) speedinfo)) ;
 		    	}
 
 
 
-		    if(!iGenericPosInfo->GetValue(EPositionFieldHorizontalSpeedError , speedinfo) )
+        if(!iGenericPosition->GetValue(EPositionFieldHorizontalSpeedError , speedinfo) )
 		        {
 		        Result->InsertL(KPositionFieldHorizontalSpeedError ,TLiwVariant((TReal) speedinfo)) ;
 		        }
@@ -1414,104 +1353,80 @@
 		        }*/
 
 
-		    }   //End of EcapabilitySpeed 
 
 
-		 if(currCapability & TPositionModuleInfo :: ECapabilitySatellite) //Extract satellitinfo if any and append it
-		    {																//as part of out parm list
-		    TInt8 satinfo  = 0;
+        TInt8 satinfo  = 0;
 
-		    if(!iGenericPosInfo->GetValue(EPositionFieldSatelliteNumInView , satinfo))
-		        {
-		        Result->InsertL(KPositionFieldSatelliteNumInView ,TLiwVariant((TReal) satinfo)) ;
-		        }
-			if(!iGenericPosInfo->GetValue(EPositionFieldSatelliteNumUsed , satinfo))
-		        {
-		        Result->InsertL(KPositionFieldSatelliteNumUsed ,TLiwVariant((TReal) satinfo)) ;
-		        }
-		    } //End of ECapabilitySatellite
+        if(!iGenericPosition->GetValue(EPositionFieldSatelliteNumInView , satinfo))
+            {
+            Result->InsertL(KPositionFieldSatelliteNumInView ,TLiwVariant((TReal) satinfo)) ;
+            }
+        if(!iGenericPosition->GetValue(EPositionFieldSatelliteNumUsed , satinfo))
+            {
+            Result->InsertL(KPositionFieldSatelliteNumUsed ,TLiwVariant((TReal) satinfo)) ;
+            }
+		   
 
-		 if(currCapability & TPositionModuleInfo :: ECapabilityDirection) //Extract direction info if any and append it 
-		 {                                                               // as part of out parm list
+		 
 		 TReal32 direcinfo = 0;
 
 
-		 if(!iGenericPosInfo->GetValue(EPositionFieldTrueCourse , direcinfo) )
+		 if(!iGenericPosition->GetValue(EPositionFieldTrueCourse , direcinfo) )
 		   {
 		   Result->InsertL(KPositionFieldTrueCourse ,TLiwVariant((TReal) direcinfo)) ;
 		   }
 
 
-		 if(!iGenericPosInfo->GetValue(EPositionFieldTrueCourseError , direcinfo) )
+		 if(!iGenericPosition->GetValue(EPositionFieldTrueCourseError , direcinfo) )
 		   {
 		   Result->InsertL(KPositionFieldTrueCourseError ,TLiwVariant((TReal) direcinfo)) ;
 		   }
 
 
-		 if(!iGenericPosInfo->GetValue(EPositionFieldMagneticCourseError , direcinfo) )
+		 if(!iGenericPosition->GetValue(EPositionFieldMagneticCourseError , direcinfo) )
 		    {
 		    Result->InsertL(KPositionFieldMagneticCourseError ,TLiwVariant((TReal) direcinfo)) ;
 		    }
 
 
-		 if(!iGenericPosInfo->GetValue(EPositionFieldMagneticCourse , direcinfo) )
+		 if(!iGenericPosition->GetValue(EPositionFieldMagneticCourse , direcinfo) )
 		    {
 		    Result->InsertL(KPositionFieldMagneticCourse ,TLiwVariant((TReal) direcinfo)) ;
 		    }
-		 } // End of ECapabilityDirection
+		
 
 
-		if(currCapability & TPositionModuleInfo :: ECapabilityCompass) //Extract compass info if any and append it 
-	    	{                                                               // as part of out parm list
-	    	TReal32 compassinfo ;
+		
+        TReal32 compassinfo ;
 
-	    	
-	    	if(!iGenericPosInfo->GetValue(EPositionFieldHeading , compassinfo) )
-	        	{
-	        	Result->InsertL(KPositionFieldHeading ,TLiwVariant((TReal) compassinfo)) ;	
-	        	}
+        
+        if(!iGenericPosition->GetValue(EPositionFieldHeading , compassinfo) )
+            {
+            Result->InsertL(KPositionFieldHeading ,TLiwVariant((TReal) compassinfo)) ;	
+            }
 
 
-	    	if(!iGenericPosInfo->GetValue(EPositionFieldHeadingError , compassinfo) )
-	        	{
-	        	Result->InsertL(KPositionFieldHeadingError ,TLiwVariant((TReal) compassinfo)) ;
-	        	}
+        if(!iGenericPosition->GetValue(EPositionFieldHeadingError , compassinfo) )
+            {
+            Result->InsertL(KPositionFieldHeadingError ,TLiwVariant((TReal) compassinfo)) ;
+            }
 
 
-	    	if(!iGenericPosInfo->GetValue(EPositionFieldMagneticHeading , compassinfo) )
-	        	{
-	        	Result->InsertL(KPositionFieldMagneticHeading ,TLiwVariant((TReal) compassinfo)) ;
-	        	}
+        if(!iGenericPosition->GetValue(EPositionFieldMagneticHeading , compassinfo) )
+            {
+            Result->InsertL(KPositionFieldMagneticHeading ,TLiwVariant((TReal) compassinfo)) ;
+            }
 
 
 
-	    	if(!iGenericPosInfo->GetValue(EPositionFieldMagneticHeadingError , compassinfo) )
-	            {
-	            Result->InsertL(KPositionFieldMagneticHeadingError ,TLiwVariant((TReal) compassinfo)) ;
-
-	            } 
-
+        if(!iGenericPosition->GetValue(EPositionFieldMagneticHeadingError , compassinfo) )
+            {
+            Result->InsertL(KPositionFieldMagneticHeadingError ,TLiwVariant((TReal) compassinfo)) ;
 
-	    	} //End of  ECapabilityCompass
-
-		/*if( currCapability & TPositionModuleInfo :: ECapabilityNmea ) //Extract Nmea info if any and append it 	
-		    {                                                             //as part of out param list  
-		    TUint8 numSentences ;
-
-		    if(!iGenericPosInfo->GetValue(EPositionFieldNMEASentences , numSentences) )
-		        {
-		        Result->InsertL(KPositionFieldNMEASentences ,TLiwVariant((TReal) numSentences)) ;
+            } 
 		        }
 
 
-		    TBuf8 <20> nmeaSentences ;
-		    if(!iGenericPosInfo->GetValue(EPositionFieldNMEASentencesStart , nmeaSentences) )
-		        {
-		        Result->InsertL(KPositionFieldNMEASentencesStart ,TLiwVariant( numSentences)) ;
-		        }
-		    }*/ //End of ECapabilityNmea
-
-	     }
     aOutParamList.AppendL(TLiwGenericParam ( KLocationMap, TLiwVariant(Result))) ;
     Result->DecRef();
     CleanupStack :: Pop(Result) ;