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

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

?? startup.c

?? Open DMT Client C Source code
?? C
?? 第 1 頁 / 共 3 頁
字號:
// ----------------------------------------------------------------------------// Copyright 2006-2007, Martin D. Flynn// All rights reserved// ----------------------------------------------------------------------------//// Licensed under the Apache License, Version 2.0 (the "License");// you may not use this file except in compliance with the License.// You may obtain a copy of the License at// // http://www.apache.org/licenses/LICENSE-2.0// // Unless required by applicable law or agreed to in writing, software// distributed under the License is distributed on an "AS IS" BASIS,// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.// See the License for the specific language governing permissions and// limitations under the License.//// ----------------------------------------------------------------------------// Description://  Main entry point and custom startup initialization//  Provides customized startup initialization.// ---// Change History://  2006/01/04  Martin D. Flynn//     -Initial release//  2006/01/12  Martin D. Flynn//     -Integrated syslog support//  2006/01/27  Martin D. Flynn//     -Changed '-debug' to send output logs to console//     -Fixed bug where "TRANSPORT_MEDIA_SOCK" should have been "TRANSPORT_MEDIA_SOCKET"//  2006/02/12  Martin D. Flynn//     -Changed to accomodate new return type from "gpsGetDiagnostics".//     -Changed to save properties back to 'propertyCache', instead of 'propertyFile'.//  2006/04/10  Martin D. Flynn//     -Changed Socket property 'PROP_MOTION_IN_MOTION' default to 15 minutes.//  2006/06/07  Martin D. Flynn//     -Relaxed TRANSPORT_MEDIA_SOCKET connection settings//  2007/01/28  Martin D. Flynn//     -Many changes to facilitate WindowsCE port//  2007/04/28  Martin D. FLynn//     -Don't queue events if either PROP_COMM_HOST or PROP_COMM_PORT are undefined.// ----------------------------------------------------------------------------#include "stdafx.h" // TARGET_WINCE#include "custom/defaults.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include "custom/log.h"#include "custom/gps.h"#include "custom/gpsmods.h"#include "custom/startup.h"#include "custom/transport.h"#include "modules/motion.h"#include "modules/odometer.h"#if defined(ENABLE_GEOZONE)#  include "modules/geozone.h"#endif#include "tools/stdtypes.h"#include "tools/utctools.h"#include "tools/strtools.h"#include "tools/bintools.h"#include "tools/threads.h"#include "tools/io.h"#include "tools/comport.h"#include "base/cerrors.h"#include "base/propman.h"#include "base/statcode.h"#include "base/mainloop.h"#include "base/accting.h"#include "base/events.h"#include "base/protocol.h"#if defined(ENBALE_UPLOAD)#  include "base/upload.h"#endif#if defined(TARGET_WINCE)#  include <aygshell.h>#  include "custom/wince/wceos.h"#else// TODO: should separate this into gumstix/linux/cygwin#  include "custom/linux/os.h"#endif// ----------------------------------------------------------------------------// Version string// Examples://   OpenDMTP_FILE.1.0.3//   OpenDMTP_SOCK.1.0.3#define DMTP_NAME                   APPLICATION_NAME#if   defined(TRANSPORT_MEDIA_SOCKET)#  define DMTP_TYPE                 "SOCK"  // - Socket communication#elif defined(TRANSPORT_MEDIA_SERIAL)#  define DMTP_TYPE                 "SER"   // - BlueTooth communication#elif defined(TRANSPORT_MEDIA_GPRS)#  define DMTP_TYPE                 "GPRS"  // - GPRS communication#elif defined(TRANSPORT_MEDIA_FILE)#  define DMTP_TYPE                 "FILE"  // - File event capture#endif#if !defined(DMTP_TYPE)#  error DMTP_TYPE not defined.#endif#define DMTP_NAME_TYPE_VERSION      DMTP_NAME "_" DMTP_TYPE "." RELEASE_VERSIONconst char APP_VERSION[] = { "$$VERSION:" DMTP_NAME_TYPE_VERSION "[" APPLICATION_FEATURES "]" };// ----------------------------------------------------------------------------// GPRS and SOCKET connect host:port#define DEFAULT_COMM_HOST           "localhost"#define DEFAULT_COMM_PORT           "31000" // this default may change at any time// ----------------------------------------------------------------------------#if defined(PROPERTY_FILE)/* property file names */static char propertyFile[80]  = { PROPERTY_FILE  };static char propertyCache[90] = { PROPERTY_CACHE };#if defined(PROPERTY_SAVE_INTERVAL)#define FIRST_PROPERTY_SAVE_INTERVAL    20Lstatic TimerSec_t   lastSavePropertyTimer = 0L;static UInt32       lastSavePropertyInterval = FIRST_PROPERTY_SAVE_INTERVAL;#endif#endif/* server host:port defined */#if defined(TRANSPORT_MEDIA_SOCKET) || defined(TRANSPORT_MEDIA_GPRS)static utBool hasServerHostPort = utTrue;#endif// ----------------------------------------------------------------------------// ----------------------------------------------------------------------------// define CUSTOM_EVENT_PACKETS to enable custom event packet//#define CUSTOM_EVENT_PACKETS#if defined(CUSTOM_EVENT_PACKETS) // {// Custom defined event packets#endif // } defined(CUSTOM_EVENT_PACKETS)// ----------------------------------------------------------------------------// ----------------------------------------------------------------------------/* add the specified event to the queue */static utBool _customAddSingleEvent(PacketPriority_t priority, ClientPacketType_t pktType, Event_t *er){    /* no event? */    if (!er) {        return utFalse;    }    /* add event packet */    Packet_t pkt;    utBool didAdd = evAddEventPacket(&pkt, priority, pktType, er);    UInt32 pktSeq = pkt.sequence;    /* display event */    logDEBUG(LOGSRC,"$%04lX:%lu,%04X,%.4lf/%.4lf:%ld,%.1lf,%s,%s,%04lX",         pktType, er->timestamp[0], er->statusCode,         er->gpsPoint[0].latitude, er->gpsPoint[0].longitude, er->gpsQuality,         er->odometerKM,         er->entity[0], er->entity[1],        pktSeq);    /* return success */    return didAdd;}/* add the specified event to the queue */static utBool _customAddEventFtn(PacketPriority_t priority, ClientPacketType_t pktType, Event_t *er){    /* no event? */    if (!er) {        return utFalse;    }        /* special event handling */    // perform any special event handling here    /* skip out if priority is PRIORITY_NONE */    if (priority == PRIORITY_NONE) {        // normally this will never occur, however, the client may choose to set the        // priority on a special event to PRIORITY_NONE in order to be able to handle        // it above and discard it here if necessary.        return utFalse;    }    /* skip if the packet type is not a standard event packet */    if (!pktIsEventPacket(pktType)) {        // generally, this will only occur in an HOS environment        return utFalse; // not a vehicle telemetry event    }    /* don't queue events if we don't have anywhere to send the data */#if defined(TRANSPORT_MEDIA_SOCKET) || defined(TRANSPORT_MEDIA_GPRS)    if (!hasServerHostPort) {        return utFalse; // host:port not defined, don't queue event    }#endif // defined(TRANSPORT_MEDIA_SOCKET) || defined(TRANSPORT_MEDIA_GPRS)    /* promote remaining priorities to PRIORITY_HIGH for file and serial transport */#if defined(TRANSPORT_MEDIA_FILE) || defined(TRANSPORT_MEDIA_SERIAL)    priority = PRIORITY_HIGH;#endif    /* add single event */    return _customAddSingleEvent(priority, pktType, er);}// ----------------------------------------------------------------------------/* property refresh, prior to a 'Get' */static void _propertyPreGET(PropertyRefresh_t mode, Key_t key, UInt8 *args, int argLen){    if (mode & PROP_REFRESH_GET) {        switch (key) {            case PROP_STATE_TIME: {                // update property with clock time                propSetUInt32(PROP_STATE_TIME, utcGetTimeSec());            } break;            case PROP_STATE_GPS: {                // update property with current GPS location                GPS_t lastGPS;                GPSOdometer_t gpsOdom;                memcpy((GPSShort_t*)&gpsOdom, (GPSShort_t*)gpsGetLastGPS(&lastGPS,-1), sizeof(GPSShort_t));                gpsOdom.meters = (UInt32)(odomGetDeviceDistanceMeters() + 0.5); // ROUND(X?)                propSetGPS(PROP_STATE_GPS, &gpsOdom);            } break;            case PROP_STATE_GPS_DIAGNOSTIC: {                // return GPS diagnostics (ie. GPS module health)                int i;                UInt32 *gpsStats = (UInt32*)gpsGetDiagnostics((GPSDiagnostics_t*)0);                for (i = 0; i < (sizeof(GPSDiagnostics_t)/sizeof(UInt32)); i++) {                    propSetUInt32AtIndex(PROP_STATE_GPS_DIAGNOSTIC, i, gpsStats[i]);                }            } break;            case PROP_STATE_QUEUED_EVENTS: {                // update property with number of events                Int32 evQueCnt = 0L, evTotCnt = 0L;                evQueCnt = evGetPacketCount();                evTotCnt = evGetTotalPacketCount();                propSetUInt32AtIndex(PROP_STATE_QUEUED_EVENTS, 0, (UInt32)evQueCnt);                propSetUInt32AtIndex(PROP_STATE_QUEUED_EVENTS, 1, (UInt32)evTotCnt);            } break;            case PROP_GEOF_COUNT: {                // update property with number of GeoZone entries#if defined(ENABLE_GEOZONE)                propSetUInt32(PROP_GEOF_COUNT, (UInt32)geozGetGeoZoneCount());#endif            } break;        }    } }/* property update, after a 'Set' */static void _propertyPostSET(PropertyRefresh_t mode, Key_t key, UInt8 *args, int argLen){    if (mode & PROP_REFRESH_SET) {        switch (key) {            case PROP_STATE_DEVICE_ID: {                // change host/device name                const char *s = propGetDeviceID(0); // propGetString(PROP_STATE_DEVICE_ID,"");                if (!s || !*s) {                     s = DEVICE_ID;                     if (!s || !*s) {                        s = propGetString(PROP_STATE_SERIAL, "");                    }                }#if !defined(SECONDARY_SERIAL_TRANSPORT)                // set bluetooth broadcast name                osSetHostname(s);#endif                // save properties to save new ID?            } break;#if defined(SECONDARY_SERIAL_TRANSPORT)            case PROP_STATE_DEVICE_BT: {                // change bluetooth broadcast name                const char *s = propGetDeviceID(1); // propGetString(PROP_STATE_DEVICE_BT,"");                if (!s || !*s) {                     s = DEVICE_ID;                     if (!s || !*s) {                        s = propGetString(PROP_STATE_SERIAL, "");                    }                }                // set bluetooth broadcast name                osSetHostname(s);                // save properties to save new ID?            } break;#endif        }    }}// ----------------------------------------------------------------------------/* status "ping" */CommandError_t startupPingStatus(PacketPriority_t priority, StatusCode_t code, int ndx){    ClientPacketType_t pktType = DEFAULT_EVENT_FORMAT;        /* initialize an event in anticipation that the status code is valid */    GPS_t gps;    Event_t evRcd;    evSetEventDefaults(&evRcd, code, 0L, gpsGetLastGPS(&gps,-1));    /* check specified status code */    if ((code == STATUS_LOCATION) || (code == STATUS_WAYMARK) || (code == STATUS_QUERY)) {        if (ndx > 0) {            // index was specified and was greater than '0'            return COMMAND_INDEX;        } else {            // send current location            _customAddEventFtn(priority, pktType, &evRcd);            return COMMAND_OK;        }    } else    if ((code >= STATUS_ODOM_0) && (code <= STATUS_ODOM_7)) {        int odoNdx = code - STATUS_ODOM_0; // odometer index        if ((ndx >= 0) && (ndx != odoNdx)) {            // index was specified, but is not equal to the odomenter index            return COMMAND_INDEX;        } else {            // send current odometer value            // 'evRcd.odometerKM' is already be set above (in 'evSetEventDefaults')            if (odoNdx == 0) {                // vehicle distance (may need special handling                evRcd.distanceKM = odomGetDeviceDistanceMeters() / 1000.0;            } else {                // driver, etc                evRcd.distanceKM = odomGetDistanceMetersAtIndex(odoNdx) / 1000.0;            }            _customAddEventFtn(priority, pktType, &evRcd);            return COMMAND_OK;        }    } else {        // Other candidated:        //  STATUS_ELAPSED_xx        return COMMAND_STATUS;    }    }// ----------------------------------------------------------------------------/* status "ping" [see PROP_CMD_STATUS_EVENT] */static CommandError_t _cmdSendStatus(int protoNdx, Key_t key, const UInt8 *data, int dataLen){    // 'protoNdx' contains the handle to the protocol transport    /* parse arguments */    UInt32 code32 = 0L;    UInt32 ndx32  = 0L;    int flds = binScanf(data, dataLen, "%2u%1u", &code32, &ndx32);    if (flds < 1) {        return COMMAND_ARGUMENTS;    }    StatusCode_t code = (StatusCode_t)code32;    int ndx = (flds >= 2)? (int)ndx32 : -1;        /* status ping */    return startupPingStatus(PRIORITY_HIGH, code, ndx);     }/* set digital output [see PROP_CMD_SET_OUTPUT] */static CommandError_t _cmdSetOutput(int protoNdx, Key_t key, const UInt8 *data, int dataLen){    // 'protoNdx' contains the handle to the protocol transport    /* parse arguments */    UInt32 ndx    = 0L;    UInt32 state  = 0L;    UInt32 duraMS = 0L;    int flds = binScanf(data, dataLen, "%1u%1u%4u", &ndx, &state, &duraMS);    if (flds < 2) {        return COMMAND_ARGUMENTS;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合免费观看高清在线观看| 欧美tk—视频vk| 亚洲欧美影音先锋| 99久久婷婷国产综合精品| 综合在线观看色| 欧美午夜精品一区二区三区| 亚洲不卡av一区二区三区| 91精品国产综合久久精品app| 午夜精品久久久久久不卡8050| 欧美精品九九99久久| 理论片日本一区| 国产午夜精品一区二区| 色婷婷精品大在线视频| 天堂资源在线中文精品| 欧美一级二级三级蜜桃| 国产在线视频不卡二| 国产精品蜜臀av| 在线观看一区不卡| 免费精品视频在线| 欧美激情综合五月色丁香小说| 99久久精品免费看国产免费软件| 亚洲综合一区二区精品导航| 欧美电影免费观看完整版| 国产成人亚洲综合a∨婷婷图片 | 日韩欧美国产一区在线观看| 韩日欧美一区二区三区| 成人欧美一区二区三区视频网页| 欧美日韩国产区一| 国产一区二区久久| 亚洲图片欧美综合| 久久精品一区二区三区不卡牛牛| 色88888久久久久久影院野外| 奇米精品一区二区三区四区| 国产精品理论在线观看| 欧美日韩精品福利| 成人福利在线看| 丝袜美腿亚洲一区二区图片| 国产精品乱人伦中文| 日韩欧美亚洲国产精品字幕久久久| 国产成人av电影在线观看| 亚洲一区二区精品久久av| 久久久精品综合| 4438成人网| 色综合婷婷久久| 国产成人在线看| 日本亚洲免费观看| 一区二区成人在线视频| 欧美国产精品一区| 91精品国产丝袜白色高跟鞋| 在线免费观看日本一区| 国产丶欧美丶日本不卡视频| 日本欧美一区二区三区乱码| 有码一区二区三区| 国产欧美精品一区二区三区四区| 欧美日韩精品欧美日韩精品一综合| av电影在线观看一区| 国产在线精品不卡| 欧美aaaaaa午夜精品| 亚洲高清视频中文字幕| 亚洲精品视频一区| 国产精品卡一卡二| 国产亚洲va综合人人澡精品| 日韩欧美国产系列| 777精品伊人久久久久大香线蕉| 91啪亚洲精品| 91啪九色porn原创视频在线观看| 国产成人综合网站| 国产做a爰片久久毛片| 日本不卡视频一二三区| 午夜久久福利影院| 一区二区三区欧美日| 亚洲人成电影网站色mp4| 国产精品久99| 国产精品久久国产精麻豆99网站| 中文字幕第一区第二区| 久久久亚洲欧洲日产国码αv| 精品成人一区二区三区| 日韩免费视频一区二区| 日韩一级高清毛片| 欧美一区午夜视频在线观看| 欧美人动与zoxxxx乱| 欧美区视频在线观看| 精品1区2区3区| 91久久一区二区| 欧美性猛交xxxxxx富婆| 欧美日韩高清在线播放| 欧美精品国产精品| 欧美一区二区黄色| 欧美videos中文字幕| 久久精品亚洲麻豆av一区二区| 26uuu精品一区二区| 久久综合久久综合久久综合| 国产欧美一区二区三区在线老狼| 国产精品麻豆欧美日韩ww| 中文字幕一区二区三区在线不卡| 亚洲特黄一级片| 亚洲地区一二三色| 麻豆精品久久久| 国产一区二区精品久久| 成人app网站| 欧美视频你懂的| 日韩精品一区二区三区四区| 中文字幕二三区不卡| 亚洲一区精品在线| 开心九九激情九九欧美日韩精美视频电影 | 麻豆成人91精品二区三区| 久久精品国产色蜜蜜麻豆| 国产精品一区二区久久精品爱涩| 成人免费毛片嘿嘿连载视频| 色天天综合色天天久久| 欧美一区二区三区四区五区| 久久久综合精品| 亚洲免费在线播放| 久久99久久99精品免视看婷婷| 国产成人午夜精品影院观看视频 | 男女男精品视频| 成人在线综合网站| 欧美性受极品xxxx喷水| 精品处破学生在线二十三| 综合色中文字幕| 久久国产精品99久久人人澡| youjizz国产精品| 日韩色视频在线观看| 国产精品久久久久影视| 日韩高清一区在线| 97se亚洲国产综合自在线| 91精品国产麻豆国产自产在线 | 91美女在线视频| 久久综合色婷婷| 夜夜夜精品看看| 成人av电影在线网| 日韩欧美中文字幕公布| 亚洲免费观看高清完整版在线观看熊| 欧美a级一区二区| 91国产成人在线| 中文字幕精品一区二区精品绿巨人| 天天爽夜夜爽夜夜爽精品视频| 岛国精品一区二区| 制服丝袜中文字幕一区| 亚洲欧美视频在线观看| 国产高清不卡二三区| 91麻豆精品91久久久久久清纯| 亚洲欧美电影一区二区| 国产精品一区二区三区四区| 日韩亚洲欧美在线观看| 一区二区三区欧美| 91免费版在线看| 国产视频不卡一区| 久久成人羞羞网站| 欧美挠脚心视频网站| 一区二区在线看| 97aⅴ精品视频一二三区| 国产欧美日韩在线| 国产一区二区精品在线观看| 欧美电影免费提供在线观看| 日本不卡一区二区| 欧美色图免费看| 亚洲国产精品一区二区尤物区| 成人av在线一区二区| 国产精品无人区| 成人av集中营| 国产精品久久久久一区二区三区| 国产精品一区二区91| 久久婷婷综合激情| 国产伦精品一区二区三区在线观看| 日韩午夜在线观看视频| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美日韩卡一卡二| 亚洲综合免费观看高清完整版在线| 91亚洲国产成人精品一区二区三 | 午夜av区久久| 91精品国产乱码久久蜜臀| 日本一不卡视频| 欧美成人女星排名| 国产中文字幕精品| 国产欧美视频在线观看| 懂色av中文一区二区三区| 国产精品对白交换视频| 色嗨嗨av一区二区三区| 一区二区三区不卡视频| 欧美日韩国产一区| 日本aⅴ精品一区二区三区| 欧美变态tickling挠脚心| 精品一区二区日韩| 国产三级精品在线| 成人av电影在线播放| 一区二区三区色| 91精品在线观看入口| 国产在线观看一区二区| 国产精品另类一区| 欧洲视频一区二区| 日韩电影免费在线| 日本一区二区三区在线观看| 91视频www| 日韩高清在线不卡| 国产日本欧洲亚洲| 欧美在线综合视频| 精品综合免费视频观看| 国产精品视频第一区| 欧美色综合天天久久综合精品|