19 |
19 |
20 #ifndef GPSWATCHER_H_ |
20 #ifndef GPSWATCHER_H_ |
21 #define GPSWATCHER_H_ |
21 #define GPSWATCHER_H_ |
22 |
22 |
23 #include <lbs.h> |
23 #include <lbs.h> |
24 |
24 #include <epos_intgpshwstatus.h> |
25 |
25 |
26 class CGPSTimeUpdater; |
26 class CGPSTimeUpdater; |
27 class CDRMClock; |
27 class CDRMClock; |
28 |
28 |
29 class CGPSWatcher : public CTimer |
29 |
|
30 class CGPSWatcher : public CTimer, public MPosIntGpsHwStatusObserver |
30 { |
31 { |
31 public: |
32 public: |
32 ~CGPSWatcher(); |
33 ~CGPSWatcher(); |
33 static CGPSWatcher* NewL( CDRMClock* aClock ); |
34 static CGPSWatcher* NewL( CDRMClock* aClock ); |
34 |
35 |
|
36 public: // from MPosIntGpsHwStatusObserver |
|
37 /** |
|
38 * Notify observer of a GPS hardware status event |
|
39 * @param aStatus The GPS hardware status. |
|
40 * @param aError KErrNone if successful. Other possible error values defined by RProperty::Get() |
|
41 */ |
|
42 void OnStatusUpdateEvent(CPosIntGpsHwStatus::TIntGpsHwStatus aStatus, TInt aError); |
|
43 |
35 private: |
44 private: |
36 CGPSWatcher( CDRMClock* aClock ); |
45 CGPSWatcher( CDRMClock* aClock ); |
37 void ConstructL(); |
46 void ConstructL(); |
38 |
47 |
39 void CheckModules(); |
48 void CheckSatellites(); |
40 void Subscribe(); |
49 TInt CheckModules(); |
41 void RunL(); |
50 void RunL(); |
42 void DoCancel(); |
51 void DoCancel(); |
43 TInt RunError( TInt aError ); |
52 TInt RunError( TInt aError ); |
44 |
53 |
45 private: |
54 private: |
46 RPositionServer iPosServer; |
55 // owned: |
47 TPositionModuleStatusEvent iStatusEvent; |
56 RPointerArray<CGPSTimeUpdater> iTimeUpdaters; |
48 |
57 |
49 // owned |
58 // not owned: |
50 CGPSTimeUpdater *iTimeUpdater; |
59 CDRMClock* iClock; |
51 |
60 |
52 // not owned |
61 // GPS status information: |
53 CDRMClock* iClock; |
62 CPosIntGpsHwStatus* iStatusUpdater; |
54 |
63 |
55 // Retry counter |
64 // status received from GPS: |
56 TInt iRetryCounter; |
65 CPosIntGpsHwStatus::TIntGpsHwStatus iGpsStatus; |
|
66 |
|
67 // List of active satellite modules: |
|
68 RPointerArray<TPositionModuleInfo> iActiveSatelliteModules; |
|
69 |
57 }; |
70 }; |
58 |
71 |
59 #endif /* GPSWATCHER_H_ */ |
72 #endif /* GPSWATCHER_H_ */ |