qtmobility/plugins/sensors/maemo6/maemo6sensorbase.cpp
changeset 11 06b8e2af4411
parent 8 71781823f776
child 14 6fbed849b4f4
equal deleted inserted replaced
8:71781823f776 11:06b8e2af4411
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the Qt Mobility Components.
     7 ** This file is part of the Qt Mobility Components.
     8 **
     8 **
    38 ** $QT_END_LICENSE$
    38 ** $QT_END_LICENSE$
    39 **
    39 **
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 
    41 
    42 #include "maemo6sensorbase.h"
    42 #include "maemo6sensorbase.h"
    43 #include <ctime>
       
    44 
    43 
    45 SensorManagerInterface* maemo6sensorbase::m_remoteSensorManager = 0;
    44 SensorManagerInterface* maemo6sensorbase::m_remoteSensorManager = 0;
    46 const float maemo6sensorbase::GRAVITY_EARTH = 9.80665;
    45 const float maemo6sensorbase::GRAVITY_EARTH = 9.80665;
    47 const float maemo6sensorbase::GRAVITY_EARTH_THOUSANDTH = 0.00980665;
    46 const float maemo6sensorbase::GRAVITY_EARTH_THOUSANDTH = 0.00980665;
    48 
    47 
    89         return;
    88         return;
    90     if (m_sensorInterface)
    89     if (m_sensorInterface)
    91         m_sensorInterface->stop();
    90         m_sensorInterface->stop();
    92     m_sensorRunning = false;
    91     m_sensorRunning = false;
    93 }
    92 }
    94 
       
    95 qtimestamp maemo6sensorbase::createTimestamp()
       
    96 {
       
    97     timespec stamp;
       
    98     clock_gettime(CLOCK_MONOTONIC, &stamp);
       
    99     qtimestamp data = stamp.tv_sec;
       
   100     data = data * 1000000;
       
   101     data = stamp.tv_nsec / 1000 + data;
       
   102     return data;
       
   103 }