亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? gps.c

?? Open DMT Client C Source code
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
            gpsAquireRequest = utFalse;        } AQUIRE_UNLOCK        // We are now either NOT in powerSaveMode, or 'gpsAquire(...)' has been called.                /* exit now if this thread has been told to quit */        if (!gpsRunThread) {            break;        }        /* open port to GPS */        if (!_gpsOpen()) {            // Open failed.  Wait, then retry open.            // This should be a critical error.            if (utcIsTimerExpired(gpsLastOpenErrorTimer,900L)) {                gpsPortName = propGetString(PROP_CFG_GPS_PORT, DEFAULT_GPS_PORT); // refresh name                gpsLastOpenErrorTimer = utcGetTimer();                if (!comPortIsValidName(gpsPortName)) {                    logERROR(LOGSRC,"GPS port invalid: %s", gpsPortName);                } else {                    logCRITICAL(LOGSRC,"Unable to open GPS port: %s", gpsPortName); // strerror(errno));                }            }            threadSleepMS(5000L);            continue;        }        // The HP hw6945 GPS receiver should be powering up from a cold-start at this point.        // If the device always keeps the GPS hot, then we will just be able to aquire a        // fix much sooner.        /* read GPS (forever, or until error) */        // We want to make sure we stay in '_gpsReadGPSFix' long enough to get at least one        // GPS fix (assuming that the receiver may be coming up from a cold-start).  If the         // GPS receiver is already hot, then we'll just get a fix much sooner.        UInt32 timeoutMS = 0L;        if (powerSaveMode) {            // If we are in power-save mode, then 'gpsAquire(...)' was called and is waiting            // for a valid GPS fix (hopefully with a reasonable timeout value).  We will wait            // here for a GPS fix with the same timeout value.            timeoutMS = powerSaveTimeoutMS; // from 'gpsAquireTimeoutMS'            UInt32 MIN_TIMOUT = 90L * 1000L; // 90 seconds (should be enough for a cold GPS start)            if (timeoutMS < MIN_TIMOUT) {                timeoutMS = MIN_TIMOUT;            }        }        int gpsErr = _gpsReadGPSFix(timeoutMS);        if (gpsErr <= 0) {            // (gpsErr <  0) we've received an error, increment restart counter            // (gpsErr == 0) powerSaveMode timeout, increment restart counter            SAMPLE_LOCK {                gpsRestartCount++;                logDEBUG(LOGSRC,"Error/Timeout - closing GPS port [%lu]", gpsRestartCount);            } SAMPLE_UNLOCK        } else {            // (gpsErr >  0) powerSaveMode GPS fix received            logDEBUG(LOGSRC,"PowerSave - closing GPS port ...");        }        /*close GPS port */        _gpsClose();            } //while (gpsRunThread)        /* once this thread stops, it isn't starting again */    // The following resources should be released:    //  - gpsComPort    //  - gpsMutex    //  - gpsSampleMutex    //  - gpsAquireMutex    //  - gpsAquireCond    //  - And everything in the supported GPS modules    //  - ???    logERROR(LOGSRC,"GPS thread is terminating ...");    threadExit();    }/* indicate thread should stop */static void _gpsStopThread(void *arg){    gpsRunThread = utFalse;    AQUIRE_LOCK {        // nudge thread        AQUIRE_NOTIFY    } AQUIRE_UNLOCK    _gpsClose();}/* start the thread */static utBool _gpsStartThread(){    /* create thread */    gpsRunThread = utTrue; // must set BEFORE we start the thread!    if (threadCreate(&gpsThread,&_gpsThreadRunnable,0,"GPS") == 0) {        // thread started successfully        threadAddThreadStopFtn(&_gpsStopThread,0);    } else {        logCRITICAL(LOGSRC,"Unable to start GPS thread");        gpsRunThread = utFalse;    }    return gpsRunThread;}#endif // defined(GPS_THREAD)// ----------------------------------------------------------------------------/* GPS module initialization */static utBool _gpsDidInit = utFalse;void gpsInitialize(eventAddFtn_t queueEvent){    /* already initialized? */    if (_gpsDidInit) {        return;    }    _gpsDidInit = utTrue;    /* init gps comport */    comPortInitStruct(&gpsComPort);    /* clear gps struct */    gpsClear(&gpsFixLast);    gpsClear(&gpsFixUnsafe);    #if defined(GPS_THREAD)    /* create mutex's */    threadMutexInit(&gpsMutex);    threadMutexInit(&gpsSampleMutex);    threadMutexInit(&gpsAquireMutex);    threadConditionInit(&gpsAquireCond);#endif    /* GPS module initialization */    gpsModuleInitialize(queueEvent);#if defined(GPS_THREAD)    /* start thread */    _gpsStartThread();#endif}// ----------------------------------------------------------------------------/* set flag indicating GPS fix is stale (or not) */void gpsSetFixStale(utBool stale){    // this value is currently only set in 'mainloop.c'    gpsIsStale = stale;}/* return true if current GPS fix is stale */utBool gpsIsFixStale(){    // Note: this may be accessed from multiple threads, but since this is not    // a critical value, no locking is performed.    return gpsIsStale;}// ----------------------------------------------------------------------------/* check minimum values in GPS record */GPS_t *gpsCheckMinimums(GPS_t *gps){    if (gps) {        // check minimum speed         double minSpeedKPH = propGetDouble(PROP_GPS_MIN_SPEED, 7.0);        if (gps->speedKPH < minSpeedKPH) {            // the reported speed does not meet our minimum requirement            // mark the speed as 'not moving'            gps->speedKPH = 0.0;            gps->heading  = 0.0; // clear the heading when the speed is '0'        }     }    return gps;}// ----------------------------------------------------------------------------/* aquire GPS fix */GPS_t *gpsAquire(GPS_t *gps, UInt32 timeoutMS){    /* null gps pointer specified */    if (!gps) {        return (GPS_t*)0;    }        /* clear gps point */    gpsClear(gps);#if defined(GPS_THREAD)    /* no timeout, return last fix */    if (timeoutMS <= 0L) {        // no timeout specified, just return the latest fix that we have (if any)        // the caller can determine if he wants to use the fix        return gpsGetLastGPS(gps, -1);    }        /* indicate to GPS thread that we want a fix */    // This is only necessary if the gps interval is long and the gps thread is    // waiting to be told to make a gps aquisition.    AQUIRE_LOCK {        gpsAquireTimeoutMS = timeoutMS; // this value is > 0        gpsAquireRequest   = utTrue;        AQUIRE_NOTIFY    } AQUIRE_UNLOCK    // at this point, the gps thread should be working on getting a fix    /* wait until a fix is available */    UInt32 accumTimeoutMS = 0L;    for (;accumTimeoutMS < timeoutMS;) {                /* get latest fix */        GPS_t *g = gpsGetLastGPS(gps, -1);        if (g && (utcGetTimerAgeSec(g->ageTimer) <= 7L)) {            // The latest fix occurred within the last 7 seconds.            return g;        }                /* wait for next fix */        UInt32 tmo = timeoutMS - accumTimeoutMS;        if (tmo > 1000L) { tmo = 1000L; }        threadSleepMS(tmo);        accumTimeoutMS += tmo;    }    /* no fix (timeout?) */    return (GPS_t*)0;#else    /* timeout mode: block while reading GPS fix */    UInt32 tmo = (timeoutMS < 3000L)? 3000L : timeoutMS;#if defined(GPS_DEVICE_SIMULATOR)    const char *gpsPortName = propGetString(PROP_CFG_GPS_PORT, DEFAULT_GPS_PORT);    gpsSimulator = strEqualsIgnoreCase(gpsPortName, GPS_SIMULATOR_PORT);    if (gpsSimulator) {        int rtn = _gpsReadGPSFix(tmo);        if (rtn > 0) {            // valid fix aquired            return gpsGetLastGPS(gps, 15);        } else {            // timeout            return (GPS_t*)0;        }    } else#endif    if (comPortIsOpen(&gpsComPort) || _gpsOpen()) {        int rtn = _gpsReadGPSFix(tmo);        _gpsClose(); // always close the port when runnin in non-thread mode        if (rtn > 0) {            // valid fix aquired (at least $GPRMC)            GPS_t *g = gpsGetLastGPS(gps, 15);            return g;        } else        if (rtn < 0) {            // error            return (GPS_t*)0;        } else {            // timeout             return (GPS_t*)0;        }    } else {        // unable to open GPS port        return (GPS_t*)0;    }#endif // defined(GPS_THREAD)}/* get last aquired GPS fix */GPS_t *gpsGetLastGPS(GPS_t *gps, Int16 maxAgeSec){    // no blocking    if (gps) {                /* get latest fix */        GPS_LOCK {            // gpsFixLast   - contains the most recent fix that has all the GPS components            // gpsFixUnsafe - contains the fix-in-progress            if (gpsFixUnsafe.fixtime < (gpsFixLast.fixtime + GP_EXPIRE)) {                // The last fix is within 5 seconds of the new fix-in-process.                // During normal GPS aquisition, the fix times will likely be the same.                // If not the same, then the fix-in-process may have just started on                 // the next sample.                memcpy(gps, &gpsFixLast, sizeof(GPS_t));            } else            if (gpsFixUnsafe.nmea & NMEA0183_GPRMC) {                // The last fix ('gpsFixLast') is stale.                // The fix-in-process at least has the GPRMC                // One of the following may have occured:                //  - We stopped getting GPGGA records (or don't get them).                //  - We just started getting valid GPS fixes again and we happen to have been                 //    called when we are between GPRMC/GPGGA records (unlikely, but possible).                //logDEBUG(LOGSRC,"We don't have a valid $GPGGA record");                 memcpy(gps, &gpsFixUnsafe, sizeof(GPS_t));            } else {                // The fix-in-process doesn't have a GPRMC.                // The last fix is stale, but return it anyway.                memcpy(gps, &gpsFixLast, sizeof(GPS_t));                 // fix may still be invalid            }        } GPS_UNLOCK                /* check fix */        if (!gpsIsValid(gps)) {            //logINFO(LOGSRC,"Point is invalid ...");            return (GPS_t*)0; // GPSPoint is invalid        } else        if ((maxAgeSec > 0) && (utcGetTimerAgeSec(gps->ageTimer) > maxAgeSec)) {            //logINFO(LOGSRC,"Point is stale ... [%ld]", utcGetTimerAgeSec(gps->ageTimer));            return (GPS_t*)0; // GPSPoint is stale        } else {            return gpsCheckMinimums(gps);        }            } else {                /* no place to put fix */        return (GPS_t*)0;            }}// ----------------------------------------------------------------------------

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品99久久久久久久vr| 亚洲精品美国一| 亚洲免费观看视频| 国产精品一区二区在线观看不卡| 亚洲欧洲色图综合| 97精品久久久午夜一区二区三区 | 大胆亚洲人体视频| 国产亚洲欧美一级| 国产乱一区二区| 亚洲444eee在线观看| 色婷婷av一区二区三区之一色屋| 国产精品欧美一区喷水| 成人久久久精品乱码一区二区三区 | 欧美成人r级一区二区三区| 天天色天天操综合| 欧美电影精品一区二区| 国产激情一区二区三区桃花岛亚洲| 久久久高清一区二区三区| 成人毛片视频在线观看| 国内国产精品久久| 国产精品久久久久影院亚瑟| 精品一区二区三区免费播放| 欧美老年两性高潮| 美女视频免费一区| 精品免费日韩av| 日韩一区二区三区电影| 丰满亚洲少妇av| 午夜精品福利一区二区蜜股av| 亚洲天堂成人在线观看| 欧美日韩高清影院| 国产精品一二二区| 国产一区二区三区在线观看免费视频 | 91丨porny丨中文| 美腿丝袜亚洲三区| 日韩精品成人一区二区三区| 久久精品人人爽人人爽| 精品久久久久久无| 精品福利一区二区三区| 成人午夜精品一区二区三区| 国产精品一区三区| 成人一区二区三区视频| 成人av网址在线观看| 日本美女视频一区二区| 亚洲精品成人在线| 一区二区三区在线观看网站| 日韩一区二区不卡| 精品国产3级a| 国产视频一区在线观看| 国产精品电影一区二区| 亚洲婷婷综合色高清在线| 亚洲精品va在线观看| 亚洲国产精品久久人人爱 | 亚洲韩国精品一区| 天天综合色天天综合色h| 视频一区二区三区中文字幕| 久久精品国产久精国产爱| 依依成人精品视频| 亚洲chinese男男1069| 日韩电影在线一区二区三区| 老司机精品视频导航| 国产精品一卡二卡在线观看| 99视频精品全部免费在线| 国产一区二区三区| 成人午夜视频免费看| 91精品福利视频| 福利电影一区二区| 99久久伊人精品| 在线观看av不卡| 99r国产精品| 67194成人在线观看| 在线观看日韩av先锋影音电影院| 欧美精品日日鲁夜夜添| 国产亚洲欧美色| 亚洲夂夂婷婷色拍ww47| 亚洲激情图片一区| 蜜臀av一区二区在线免费观看| 国产高清一区日本| 色偷偷一区二区三区| 欧美一级午夜免费电影| 欧美一区二区观看视频| 国产亚洲精品资源在线26u| 亚洲另类在线一区| 国产在线乱码一区二区三区| 在线观看视频一区| 国产色婷婷亚洲99精品小说| 亚洲电影在线免费观看| 国产精品影视在线观看| 欧美日韩国产影片| 国产精品看片你懂得| 日韩成人免费电影| 色综合久久天天| 欧美va在线播放| 亚洲小说春色综合另类电影| 国产成人在线影院| 欧美日本免费一区二区三区| 国产精品私房写真福利视频| 日韩国产精品久久久| 99久久综合精品| www国产成人| 国产精品久久看| 另类小说欧美激情| 欧美制服丝袜第一页| 国产精品久久午夜| 国产在线视视频有精品| 欧美精品久久久久久久多人混战| 亚洲欧美综合在线精品| 国产做a爰片久久毛片| 91麻豆精品久久久久蜜臀| 亚洲黄色小视频| 99久久精品国产一区| 国产亚洲成av人在线观看导航| 免费成人小视频| 成人午夜看片网址| 久久亚洲精华国产精华液| 青青草成人在线观看| 欧美色综合天天久久综合精品| 555夜色666亚洲国产免| 一区二区在线观看视频| 成人动漫一区二区| 国产欧美一区二区精品性| 亚洲综合一区二区精品导航| 成人深夜在线观看| 国产色一区二区| 国产成人在线视频播放| 久久久久久久综合狠狠综合| 国产一区二区三区免费看| 欧美一级日韩不卡播放免费| 日本不卡一区二区三区| 欧美日本一区二区| 日韩精品久久理论片| 正在播放一区二区| 蜜桃传媒麻豆第一区在线观看| 欧美一区二区三区免费大片 | 日本一区二区三区视频视频| 国产成人精品一区二区三区四区| 精品国产乱码久久久久久久| 极品美女销魂一区二区三区免费| 欧美videos中文字幕| 久久不见久久见免费视频7 | 亚洲国产美女搞黄色| 一本大道综合伊人精品热热| 一区二区成人在线| 欧美日韩免费不卡视频一区二区三区| 亚洲成av人影院| 91精品国产综合久久蜜臀| 美女久久久精品| 久久久久久久久免费| 国产精品 欧美精品| 中文字幕在线不卡国产视频| 色综合婷婷久久| 欧美电影免费观看高清完整版在线| 蜜桃av一区二区| 国产精品天干天干在线综合| 91麻豆免费观看| 日韩电影网1区2区| 久久综合国产精品| av中文字幕不卡| 亚洲h动漫在线| 久久婷婷综合激情| 91亚洲精华国产精华精华液| 一区二区三区四区不卡视频| 欧美肥妇bbw| 国产精品亚洲一区二区三区在线| 国产精品久久久久一区二区三区| 色网综合在线观看| 久久精品国产99国产| 中文字幕免费观看一区| 国产在线不卡视频| 18涩涩午夜精品.www| 欧美日韩亚州综合| 一区二区三区av电影| 欧美成人猛片aaaaaaa| 成人小视频免费在线观看| 亚洲国产欧美日韩另类综合| 久久婷婷国产综合国色天香| 99九九99九九九视频精品| 日韩在线一区二区三区| 国产精品第四页| 欧美一区二区三区四区高清 | 欧美成人官网二区| 一本色道久久综合亚洲aⅴ蜜桃| 婷婷中文字幕一区三区| 久久精品一区二区三区四区| 欧美主播一区二区三区美女| 精品亚洲国产成人av制服丝袜| 日韩码欧中文字| www久久久久| 欧美日韩亚洲综合在线| 成人18视频在线播放| 日韩在线播放一区二区| 亚洲色图欧洲色图婷婷| 久久久久久久久久久久久女国产乱| 在线观看亚洲a| 成人午夜av在线| 免费不卡在线视频| 亚洲一区二区三区美女| 国产调教视频一区| 精品卡一卡二卡三卡四在线| 欧美性生活一区| heyzo一本久久综合|