void CGPSController::CheckTimeout() { if( CGPSController::s_pInstance != NULL ) { CGPSController* gps = CGPSController::s_pInstance; gps->Lock(); bool gpsOff = gps->m_gpsIsOn && (time(NULL)>=gps->m_timeout); gps->Unlock(); if (gpsOff) { CGPSDevice::TurnOff(); gps->m_gpsIsOn = false; gps->m_knownPosition = false; } } }
void CGPSController::TurnGpsOff() { if( CGPSController::s_pInstance != NULL ) { CGPSController* gps = CGPSController::s_pInstance; gps->Lock(); bool gpsOff = gps->m_gpsIsOn; gps->Unlock(); if (gpsOff) { CGPSDevice::TurnOff(); gps->m_gpsIsOn = false; gps->m_knownPosition = false; gps->m_latitude = 0; gps->m_longitude = 0; } } }
void CGPSController::CheckTimeout() { if( CGPSController::s_pInstance != NULL ) { CGPSController* gps = CGPSController::s_pInstance; gps->Lock(); bool gpsOff = gps->m_gpsIsOn && (time(NULL)>=gps->m_timeout); gps->Unlock(); if (gpsOff) { CGPSDevice::TurnOff(); gps->m_gpsIsOn = false; gps->m_knownPosition = false; gps->m_latitude = 0; gps->m_longitude = 0; gps->m_altitude = 0; gps->m_speed = 0; gps->m_satelliteCount = 0; } } }