Magnetic.h 974 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __MAGNETIC_H__
  2. #define __MAGNETIC_H__
  3. #include <sensrvdatalistener.h>
  4. class MMagneticReader
  5. {
  6. public:
  7. virtual void DataReceivedL(TInt aAngle, TInt aAccuracyLevel) = 0;
  8. };
  9. class CSensorFinder : public CBase, public MSensrvDataListener
  10. {
  11. public:
  12. static CSensorFinder* NewL(MMagneticReader& aReader);
  13. virtual ~CSensorFinder();
  14. public: // MSensorDataListener
  15. void DataReceived( CSensrvChannel& aChannel, TInt aCount, TInt aDataLost );
  16. void DataError( CSensrvChannel& aChannel, TSensrvErrorSeverity aError );
  17. void GetDataListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface );
  18. private:
  19. CSensorFinder(MMagneticReader& aReader);
  20. void ConstructL();
  21. private://data
  22. CSensrvChannel* iMagneticNorthSensor;
  23. MMagneticReader& iDataObserver;
  24. TInt iMagnetometerCalibrationLevel;
  25. TInt iMagnetometerAngleFromNorth;
  26. };
  27. #endif /* __MAGNETIC_H__ */