qtmobility/src/location/qgeoinfothread_wince.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
   137         requestInterval = timeout;
   137         requestInterval = timeout;
   138         requestNextTime = currentDateTime().addMSecs(requestInterval);
   138         requestNextTime = currentDateTime().addMSecs(requestInterval);
   139 
   139 
   140         locker.unlock();
   140         locker.unlock();
   141         wakeUp();
   141         wakeUp();
   142         /*
       
   143         // See comments above run() to see why we're doing things like this
       
   144         if (!isRunning())
       
   145             start();
       
   146         else
       
   147             wakeUp();
       
   148             */
       
   149     }
   142     }
   150 }
   143 }
   151 
   144 
   152 void QGeoInfoThreadWinCE::startUpdates()
   145 void QGeoInfoThreadWinCE::startUpdates()
   153 {
   146 {
   160         if (updatesInterval != 0)
   153         if (updatesInterval != 0)
   161             updatesNextTime = currentDateTime().addMSecs(updatesInterval);
   154             updatesNextTime = currentDateTime().addMSecs(updatesInterval);
   162 
   155 
   163         locker.unlock();
   156         locker.unlock();
   164         wakeUp();
   157         wakeUp();
   165         /*
       
   166         // See comments above run() to see why we're doing things like this
       
   167         if (!isRunning())
       
   168             start();
       
   169         else
       
   170             wakeUp();
       
   171             */
       
   172     }
   158     }
   173 }
   159 }
   174 
   160 
   175 void QGeoInfoThreadWinCE::stopUpdates()
   161 void QGeoInfoThreadWinCE::stopUpdates()
   176 {
   162 {
   353             // the Microsoft GPS API.
   339             // the Microsoft GPS API.
   354             // This checks for an unexpected power down and turns the hardware back on.
   340             // This checks for an unexpected power down and turns the hardware back on.
   355 
   341 
   356             // The GPS state has been updated.
   342             // The GPS state has been updated.
   357 
   343 
   358             /* If this takes ages we can mark the on state from updates and check for the off state after timeouts
       
   359             if (dwRet == WAIT_OBJECT_0 + 1) {
   344             if (dwRet == WAIT_OBJECT_0 + 1) {
   360                 GPS_DEVICE device;
   345                 GPS_DEVICE device;
   361                 device.dwVersion = GPS_VERSION_1;
   346                 device.dwVersion = GPS_VERSION_1;
   362                 device.dwSize = sizeof(device);
   347                 device.dwSize = sizeof(device);
   363 
   348 
   370                     // turn on devices that have previously reached the "On" state.
   355                     // turn on devices that have previously reached the "On" state.
   371                     gpsReachedOnState = false;
   356                     gpsReachedOnState = false;
   372                     m_gps = GPSOpenDevice(m_newDataEvent, m_gpsStateChange, NULL, 0);
   357                     m_gps = GPSOpenDevice(m_newDataEvent, m_gpsStateChange, NULL, 0);
   373                 }
   358                 }
   374             }
   359             }
   375             */
       
   376 
   360 
   377             // We reach this point if the gps state has changed, if the wake up event has been
   361             // We reach this point if the gps state has changed, if the wake up event has been
   378             // triggered, if we received data we were not interested in from the GPS,
   362             // triggered, if we received data we were not interested in from the GPS,
   379             // or if a timeout occurred while waiting for gps data.
   363             // or if a timeout occurred while waiting for gps data.
   380             //
   364             //