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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gps.c

?? Open DMT Client C Source code
?? C
?? 第 1 頁 / 共 4 頁
字號:
        /* don't update clock if 'delta' is '0' */    if (delta <= 0L) {        return utFalse;    }        /* minimum delta */    if (delta < MIN_DELTA_CLOCK_TIME) {        delta = MIN_DELTA_CLOCK_TIME;    }        /* check actual time delta */    long d = labs(fixtime - utcGetTimeSec()); // setting systime to fixtime    if (d <= delta) {        // actual time delta is within acceptable range        return utFalse;    }    /* never update if we're running the GPS simulator */#if defined(GPS_DEVICE_SIMULATOR)    if (gpsSimulator) {        logDEBUG(LOGSRC,"System clock out-of-sync: %ld [delta %ld sec]", fixtime, d);        return utFalse;    }#endif        /* update clock */    logDEBUG(LOGSRC,"System clock out-of-sync: %ld [delta %ld sec]", fixtime, d);    utcSetTimeSec(fixtime);    return utTrue;}// ----------------------------------------------------------------------------/* parse YMD/HMS into UTC Epoch seconds */static UInt32 _gpsGetUTCSeconds(UInt32 dmy, UInt32 hms){    /* time of day [TOD] */    int    HH  = (int)((hms / 10000L) % 100L);    int    MM  = (int)((hms / 100L) % 100L);    int    SS  = (int)(hms % 100L);    UInt32 TOD = (HH * 3600L) + (MM * 60L) + SS;    /* current UTC day */    long DAY = 0L;    if (dmy) {        int    yy  = (int)(dmy % 100L) + 2000;        int    mm  = (int)((dmy / 100L) % 100L);        int    dd  = (int)((dmy / 10000L) % 100L);        long   yr  = ((long)yy * 1000L) + (long)(((mm - 3) * 1000) / 12);        DAY        = ((367L * yr + 625L) / 1000L) - (2L * (yr / 1000L))                     + (yr / 4000L) - (yr / 100000L) + (yr / 400000L)                     + (long)dd - 719469L;    } else {        // we don't have the day, so we need to figure out as close as we can what it should be.        UInt32 utc = utcGetTimeSec();        if (utc < MIN_CLOCK_TIME) {            // the system clock time is not valid            logWARNING(LOGSRC,"Current clock time is prior to minimum time! [%lu]", utc);            DAY = 0L;        } else {            UInt32 tod = utc % DAY_SECONDS(1);            DAY        = utc / DAY_SECONDS(1);            Int32  dif = tod - TOD; // difference should be small (ie. < 1 hour)            if (labs(dif) > HOUR_SECONDS(12)) { // 12 to 18 hours                // > 12 hour difference, assume we've crossed a day boundary                if (tod > TOD) {                    // tod > TOD likely represents the next day                    DAY++;                } else {                    // tod < TOD likely represents the previous day                    DAY--;                }            }        }    }        /* return UTC seconds */    UInt32 sec = DAY_SECONDS(DAY) + TOD;    return sec;    }/* parse latitude */static double getLatitude(const char *s, const char *d){    double _lat = strParseDouble(s, 99999.0);    if (_lat < 99999.0) {        double lat = (double)((long)_lat / 100L); // _lat is always positive here        lat += (_lat - (lat * 100.0)) / 60.0;        return !strcmp(d,"S")? -lat : lat;    } else {        return 90.0; // invalid latitude    }}/* parse longitude */static double getLongitude(const char *s, const char *d){    double _lon = strParseDouble(s, 99999.0);    if (_lon < 99999.0) {        double lon = (double)((long)_lon / 100L); // _lon is always positive here        lon += (_lon - (lon * 100.0)) / 60.0;        return !strcmp(d,"W")? -lon : lon;    } else {        return 180.0; // invalid longitude    }}/* read a single line from the GPS receiver */static int _gpsReadLine(ComPort_t *com, char *data, int dataSize, long timeoutMS){#if defined(GPS_DEVICE_SIMULATOR)#define SIM_LAT(X) (  37.0 + (X)) //  41#define SIM_LON(X) (-140.0 - (X)) // -87    if (gpsSimulator) {        static int simCount = 0;        threadSleepMS(1000L);        double LL[][2] = {//#ifdef NOT_DEF            { SIM_LAT(0.10000), SIM_LON(0.10000) },            { SIM_LAT(0.17000), SIM_LON(0.17000) },            { SIM_LAT(0.18000), SIM_LON(0.18000) },            { SIM_LAT(0.19000), SIM_LON(0.19000) },            { SIM_LAT(0.20000), SIM_LON(0.20000) },            { SIM_LAT(0.21000), SIM_LON(0.21000) },            { SIM_LAT(0.30000), SIM_LON(0.30000) },            { SIM_LAT(0.40000), SIM_LON(0.40000) },            { SIM_LAT(0.41000), SIM_LON(0.41000) },            { SIM_LAT(0.42000), SIM_LON(0.42000) },            { SIM_LAT(0.43000), SIM_LON(0.43000) },//#endif            { SIM_LAT(0.50089), SIM_LON(0.56954) },        };        int LLCount = sizeof(LL) / sizeof(LL[0]);        simCount++;        char *d = data;#if defined(TARGET_WINCE)        SYSTEMTIME st;        GetSystemTime(&st); // UTC        int hr  = st.wHour, mn = st.wMinute, sc = st.wSecond;        int dy  = st.wDay, mo = st.wMonth, yr = st.wYear % 100;#else        UInt32 tsc = utcGetTimeSec(); // - HOUR_SECONDS(8); // simulator        struct tm *tmp = gmtime(&tsc);        int hr  = tmp->tm_hour, mn = tmp->tm_min, sc = tmp->tm_sec;        int dy  = tmp->tm_mday, mo = tmp->tm_mon + 1, yr = tmp->tm_year % 100;#endif        int kts = ((simCount % 20) <= 10)? 20 : 0; // knots        int x   = ((simCount/1) % LLCount);        double lat = ((100.0 * (long)LL[x][0]) + (60.0 * (LL[x][0] - (long)LL[x][0])));        double lon = ((100.0 * (long)LL[x][1]) + (60.0 * (LL[x][1] - (long)LL[x][1])));        if (lon < 0.0) { lon = -lon; }        sprintf(d, "$GPRMC,");                      d += strlen(d);        sprintf(d, "%02d%02d%02d", hr, mn, sc);     d += strlen(d);        sprintf(d, ",A,");                          d += strlen(d);        sprintf(d, "%f,N,", (float)lat);                   d += strlen(d);        sprintf(d, "%f,W,", (float)lon);                   d += strlen(d);        sprintf(d, "%d", kts);                      d += strlen(d);        sprintf(d, ",108.52,");                     d += strlen(d);        sprintf(d, "%02d%02d%02d", dy, mo, yr);     d += strlen(d);        sprintf(d, ",,");                           d += strlen(d);        ChecksumXOR_t cksum = 0x00;        cksumCalcCharXOR(data+1,&cksum);        sprintf(d, "*%02X", (int)cksum);            d += strlen(d);        //logDEBUG(LOGSRC,"GPS SIM[%d]: %s", simCount, data);        return (d - data);    }#endif    return comPortReadLine(com, data, dataSize, timeoutMS);}/* read GPS fix */// If 'timeoutMS' is 0L, this function does not returnstatic int _gpsReadGPSFix(UInt32 timeoutMS){    ComPort_t *com = &gpsComPort;    int dataLen = 0;    char data[256];    TimerSec_t startTimer = utcGetTimer();        /* timeout */    // This function will exit when one of the following occurs:    //   - A valid GPRMC record is found (if timeout is in effect)    //   - A timeout occurs    //   - An error occurs    UInt32 timeoutSec = (timeoutMS > 0L)? ((timeoutMS + 999L) / 1000L) : 0L;    /* flush everything currently in the comport buffers */    // (Try to make sure this GPS device sends only the '$GPRMC' sentence.)    comPortFlush(com, 0L); // '0' means don't do any reading, just use 'tcflush'    /* read/parse NMEA-0183 data */    long readTimeoutMS  = 5000L;    long accumTimeoutMS = 0L;    while (utTrue) {#if defined(GPS_THREAD)        /* thread mode */        if (!gpsRunThread) {            // this thread has been requested to stop            return 0; // stop thread        }#endif        /* timeout mode */        if ((timeoutSec > 0L) && utcIsTimerExpired(startTimer,timeoutSec)) {            // timeout            return 0; // timeout        }        /* have we read a "$GPRMC" record in the last GPS_EVENT_INTERVAL seconds? */#if defined(GPS_THREAD)        // [wait a few seconds before we start checking GPS errors (ie. skip first few passes)]        if (utcIsTimerExpired(startTimer,60L)) {            // If we've NEVER received a $GPRMC record, then 'gpsLastSampleTimer == 0L'.            UInt32 gpsLostInterval = GPS_EVENT_INTERVAL;            if (utcIsTimerExpired(gpsLastSampleTimer,gpsLostInterval)) {                // We haven't receive *ANY* "$GPRMC" record in over GPS_EVENT_INTERVAL seconds!                // One of the following may be the cause:                //  - The GPS module is not attached.                //  - The GPS module went to sleep (WindowsCE)                //  - The GPS module died (or was disconnected).                //  - The serial port connection is in a strange state.                // [Note: a disconnected GPS antenna will NOT cause control to reach here.]                // The best we can do is reopen the serial port and try again.                if (utcIsTimerExpired(gpsLastLostErrorTimer,600L)) {                    if (gpsLastSampleTimer == 0L) {                        logERROR(LOGSRC,"No GPS communication: %lu", (gpsRestartCount + 1L));                    } else {                        logERROR(LOGSRC,"Lost GPS communication: %lu", (gpsRestartCount + 1L));                    }                    gpsLastLostErrorTimer = utcGetTimer();                }                return -1; // error            }        }#endif        /* read data */        dataLen = _gpsReadLine(com, data, sizeof(data), readTimeoutMS);        if (dataLen < 0) {            // com port closed? (not likely on the GumStix)            if (utcIsTimerExpired(gpsLastReadErrorTimer,600L)) {                gpsLastReadErrorTimer = utcGetTimer();                logWARNING(LOGSRC,"GPS read error: %lu", (gpsRestartCount + 1L));            }            return -1; // error        } else        if (dataLen == 0) {            if (COMERR_IsTimeout(com)) {                // TIMEOUT? (if the GPS module is in place, this should never occur)                // This indicates that we have lost communication with the GPS.                accumTimeoutMS += readTimeoutMS;                continue;            } else {                // zero length record                continue;            }        }        /* we've read at least something, reset timeout */        accumTimeoutMS = 0L;        /* valid data? */        if (data[0] != '$') {            // we must have started in the middle of the sentence            continue; // try again        }                /* DEBUG: display data */#if defined(TARGET_WINCE)        if (gpsPortDebug) {            logDEBUG(LOGSRC,"%s", data);        }#else        //logDEBUG(LOGSRC,"%s", data);#endif#if defined(TARGET_WINCE)        // skip handling of specific GPS receiver types#else        /* unexpected sentences */        if (strStartsWith(data, "$PG") ||    // <-- Garmin sentence            strStartsWith(data, "$GPGSV")) { // <-- Satellite info sentence            // reconfigure Garmin device            //logINFO(LOGSRC,"Unexpected sentence: %s", data);            const char *receiver = propGetString(PROP_CFG_GPS_MODEL,"");            if (strEqualsIgnoreCase(receiver,GPS_RECEIVER_GARMIN)) {                // If the serial port is configured for RX-only, then this section should                // be commented out.  Otherwise the Garmin config strings will be continually                // sent and may slow down communication with the receiver.                _gpsConfigGarmin(com);            } else {                // don't know how to trim out these sentences            }            continue;        }#endif        /* NMEA-0183 sentence */        if (strStartsWith(data, "$GP")) {            // http://www.scientificcomponent.com/nmea0183.htm            // http://home.mira.net/~gnb/gps/nmea.html            // $GPGGA - Global Positioning System Fix Data            //   $GPGGA|015402.240|0000.0000|N|00000.0000|E|0|00|50.0|0.0|M|18.0|M|0.0|0000*4B|            //   $GPGGA|025425.494|3509.0743|N|11907.6314|W|1|04|2.3|530.3|M|-21.9|M|0.0|0000*4D|            //   $GPGGA,    1     ,    2    ,3,     4    ,5,6,7 , 8 ,  9 ,10,  11,12,13 , 14            //      1   UTC time of position HHMMSS            //      2   current latitude in ddmm.mm format            //      3   latitude hemisphere ("N" = northern, "S" = southern)            //      4   current longitude in dddmm.mm format            //      5   longitude hemisphere ("E" = eastern, "W" = western)            //      6   (0=no fix, 1=GPS, 2=DGPS, 3=PPS?, 6=dead-reckoning)            //      7   number of satellites (00-12)            //      8   Horizontal Dilution of Precision            //      9   Height above/below mean geoid (above mean sea level, not WGS-84 ellipsoid height)            //     10   Unit of height, always 'M' meters            //     11   Geoidal separation (add to #9 to get WGS-84 ellipsoid height)            //     12   Unit of Geoidal separation (meters)            //     13   Age of differential GPS            //     14   Differential reference station ID (always '0000')            // $GPGLL - Geographic Position, Latitude/Longitude            //   $GPGLL|36000.0000|N|72000.0000|E|015402.240|V*17|            //   $GPGLL|3209.0943|N|11907.9313|W|025426.493|A*2F|            //   $GPGLL,    1    ,2,     3    ,4,      5   ,6            //      1    Current latitude            //      2    North/South            //      3    Current longitude            //      4    East/West            //      5    UTC in hhmmss format

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲在线观看免费| 老汉av免费一区二区三区| 91精品国产高清一区二区三区蜜臀| 国产资源在线一区| 亚洲综合激情网| 欧美高清在线视频| 日韩欧美123| 欧美色电影在线| av中文字幕亚洲| 久久精品国产成人一区二区三区 | 亚洲国产sm捆绑调教视频 | 欧美日韩精品欧美日韩精品一综合| 国产精品一二二区| 日韩制服丝袜先锋影音| 中文字幕成人av| 久久综合九色综合欧美就去吻| 欧美亚洲图片小说| www.欧美日韩国产在线| 国产乱对白刺激视频不卡| 美女一区二区视频| 首页国产丝袜综合| 亚洲综合图片区| 一区二区三区视频在线看| 国产精品天天看| 中文字幕乱码日本亚洲一区二区 | 日韩专区中文字幕一区二区| 中文字幕一区二区三区乱码在线| 久久久久久97三级| 日韩欧美123| 欧美成人a在线| 日韩一区二区三区观看| 91精品国产综合久久久久| 欧美午夜在线观看| 欧美日韩国产一区| 欧美日韩一区久久| 欧美日韩视频在线一区二区| 一本到不卡免费一区二区| 色综合久久久网| 色婷婷久久久亚洲一区二区三区| 成人黄色国产精品网站大全在线免费观看 | 久久精品人人做人人综合| 久久综合网色—综合色88| 久久久久国色av免费看影院| 久久久一区二区三区| 久久亚区不卡日本| 久久精品夜色噜噜亚洲a∨| 国产亚洲精品免费| 亚洲国产高清aⅴ视频| 国产精品久久久久久久岛一牛影视 | 免费在线观看不卡| 韩国精品在线观看| 丁香婷婷综合网| aaa欧美日韩| 日本道色综合久久| 欧美日韩不卡视频| 日韩一级高清毛片| 久久免费精品国产久精品久久久久| 国产清纯在线一区二区www| 国产精品乱子久久久久| 亚洲人123区| 日韩经典中文字幕一区| 激情深爱一区二区| 99视频热这里只有精品免费| 欧美最猛性xxxxx直播| 欧美一区二区三区四区高清| 欧美精品一区二区三区视频| 国产欧美精品一区二区三区四区 | 亚洲人午夜精品天堂一二香蕉| 亚洲va天堂va国产va久| 欧美视频在线一区| 精品久久久久久久久久久久久久久久久 | 欧美成人猛片aaaaaaa| 国产欧美一区二区精品性色超碰| 国产精品电影一区二区三区| 亚洲va欧美va人人爽| 激情国产一区二区| 色婷婷综合久色| 欧美精品一区二区三区一线天视频 | 欧美日韩免费一区二区三区视频 | 亚洲高清中文字幕| 韩国成人精品a∨在线观看| 色欧美乱欧美15图片| 日韩视频免费观看高清完整版在线观看 | 亚洲视频1区2区| 日韩制服丝袜av| 99re66热这里只有精品3直播| 欧美一级专区免费大片| 18涩涩午夜精品.www| 免费观看一级欧美片| 色婷婷狠狠综合| 精品国产欧美一区二区| 亚洲综合久久久久| 成人动漫一区二区三区| 日韩一卡二卡三卡国产欧美| 亚洲欧美日韩在线| 国产麻豆视频一区| 欧美日韩黄色影视| 国产精品二三区| 国模冰冰炮一区二区| 在线观看欧美黄色| 国产精品水嫩水嫩| 激情欧美一区二区三区在线观看| 欧美亚洲动漫制服丝袜| 国产精品欧美一级免费| 久久精品国产99国产精品| 欧美视频在线观看一区| 国产精品国产自产拍高清av| 精品一区二区三区免费观看| 91.成人天堂一区| 亚洲美女屁股眼交| voyeur盗摄精品| 久久精品欧美日韩精品| 久久66热偷产精品| 日韩欧美美女一区二区三区| 天天av天天翘天天综合网| 91色.com| 国产精品家庭影院| 成人精品国产一区二区4080| 国产午夜久久久久| 狠狠狠色丁香婷婷综合久久五月| 91精品国产综合久久久久久久| 亚洲国产成人91porn| 91国产福利在线| 亚洲最大成人综合| 色婷婷激情一区二区三区| 亚洲日本va午夜在线影院| av资源网一区| 国产精品动漫网站| 91在线免费播放| 日韩美女视频19| 97久久人人超碰| 亚洲精品日韩一| 欧美在线一区二区| 午夜精品一区在线观看| 91黄色激情网站| 婷婷丁香久久五月婷婷| 欧美二区三区91| 免费高清在线视频一区·| 日韩精品一区二区三区视频 | 成人一级片网址| 国产精品久久影院| 色呦呦日韩精品| 亚洲最色的网站| 欧美一区二区三区四区在线观看| 日日夜夜精品视频天天综合网| 欧美军同video69gay| 青青草成人在线观看| 欧美电影免费观看完整版 | 欧美午夜精品理论片a级按摩| 亚洲一区二区三区四区在线| 欧美疯狂做受xxxx富婆| 精品影院一区二区久久久| 久久午夜色播影院免费高清| 成人免费电影视频| 一区二区三区四区高清精品免费观看 | 成人丝袜高跟foot| 亚洲麻豆国产自偷在线| 777亚洲妇女| 久久66热re国产| 中文字幕一区二区三区不卡在线| 在线一区二区三区四区五区| 秋霞午夜av一区二区三区| 国产亚洲精品精华液| 在线免费亚洲电影| 麻豆国产欧美一区二区三区| 日本一区二区成人| 欧美亚洲国产一卡| 久久97超碰国产精品超碰| 综合激情成人伊人| 91精品国产91久久久久久一区二区 | 日韩黄色片在线观看| 久久九九久精品国产免费直播| 99re这里只有精品视频首页| 日韩精品国产精品| 国产精品美女久久久久久| 欧美日韩一区二区三区四区五区 | 日本一区二区三区在线观看| 色八戒一区二区三区| 久久精品久久久精品美女| 中文字幕一区二区不卡| 日韩一级片网站| 色综合天天在线| 九九**精品视频免费播放| 亚洲色图欧洲色图婷婷| 精品国产污污免费网站入口| 91久久精品午夜一区二区| 国产精品一区二区三区四区| 一区二区三区中文字幕精品精品 | 91精品福利在线一区二区三区 | 免费三级欧美电影| 亚洲黄色录像片| 久久久久青草大香线综合精品| 精品视频123区在线观看| 国产精品伊人色| 日本在线观看不卡视频| 亚洲欧美一区二区三区国产精品| 精品国产亚洲在线| 欧美乱妇一区二区三区不卡视频| av在线不卡免费看| 久久精品国产99国产精品|