123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283 |
- #ifndef LOC_GPS_H
- #define LOC_GPS_H
- #include <stdint.h>
- #include <sys/cdefs.h>
- #include <sys/types.h>
- #include <pthread.h>
- #include <sys/socket.h>
- #include <stdbool.h>
- __BEGIN_DECLS
- #define LOC_FLP_STATUS_LOCATION_AVAILABLE 0
- #define LOC_FLP_STATUS_LOCATION_UNAVAILABLE 1
- #define LOC_CAPABILITY_GNSS (1U<<0)
- #define LOC_CAPABILITY_WIFI (1U<<1)
- #define LOC_CAPABILITY_CELL (1U<<3)
- typedef int64_t LocGpsUtcTime;
- #define LOC_GPS_MAX_SVS 32
- #define LOC_GNSS_MAX_SVS 64
- #define LOC_GPS_MAX_MEASUREMENT 32
- #define LOC_GNSS_MAX_MEASUREMENT 64
- typedef uint32_t LocGpsPositionMode;
- #define LOC_GPS_POSITION_MODE_STANDALONE 0
- #define LOC_GPS_POSITION_MODE_MS_BASED 1
- #define LOC_GPS_POSITION_MODE_MS_ASSISTED 2
- typedef uint32_t LocGpsPositionRecurrence;
- #define LOC_GPS_POSITION_RECURRENCE_PERIODIC 0
- #define LOC_GPS_POSITION_RECURRENCE_SINGLE 1
- typedef uint16_t LocGpsStatusValue;
- #define LOC_GPS_STATUS_NONE 0
- #define LOC_GPS_STATUS_SESSION_BEGIN 1
- #define LOC_GPS_STATUS_SESSION_END 2
- #define LOC_GPS_STATUS_ENGINE_ON 3
- #define LOC_GPS_STATUS_ENGINE_OFF 4
- typedef uint16_t LocGpsLocationFlags;
- #define LOC_GPS_LOCATION_HAS_LAT_LONG 0x0001
- #define LOC_GPS_LOCATION_HAS_ALTITUDE 0x0002
- #define LOC_GPS_LOCATION_HAS_SPEED 0x0004
- #define LOC_GPS_LOCATION_HAS_BEARING 0x0008
- #define LOC_GPS_LOCATION_HAS_ACCURACY 0x0010
- #define LOC_GPS_LOCATION_HAS_VERT_UNCERTAINITY 0x0020
- #define LOC_GPS_LOCATION_HAS_SPEED_ACCURACY 0x0040
- #define LOC_GPS_LOCATION_HAS_BEARING_ACCURACY 0x0080
- #define LOC_GPS_LOCATION_HAS_SPOOF_MASK 0x0100
- #define LOC_GPS_LOCATION_HAS_SOURCE_INFO 0x0200
- typedef uint32_t LocGpsSpoofMask;
- #define LOC_GPS_LOCATION_NONE_SPOOFED 0x0000
- #define LOC_GPS_LOCATION_POSITION_SPOOFED 0x0001
- #define LOC_GPS_LOCATION_TIME_SPOOFED 0x0002
- #define LOC_GPS_LOCATION_NAVIGATION_DATA_SPOOFED 0x0004
- #define LOC_GPS_CAPABILITY_SCHEDULING (1 << 0)
- #define LOC_GPS_CAPABILITY_MSB (1 << 1)
- #define LOC_GPS_CAPABILITY_MSA (1 << 2)
- #define LOC_GPS_CAPABILITY_SINGLE_SHOT (1 << 3)
- #define LOC_GPS_CAPABILITY_ON_DEMAND_TIME (1 << 4)
- #define LOC_GPS_CAPABILITY_GEOFENCING (1 << 5)
- #define LOC_GPS_CAPABILITY_MEASUREMENTS (1 << 6)
- #define LOC_GPS_CAPABILITY_NAV_MESSAGES (1 << 7)
- typedef uint16_t LocGpsAidingData;
- #define LOC_GPS_DELETE_EPHEMERIS 0x0001
- #define LOC_GPS_DELETE_ALMANAC 0x0002
- #define LOC_GPS_DELETE_POSITION 0x0004
- #define LOC_GPS_DELETE_TIME 0x0008
- #define LOC_GPS_DELETE_IONO 0x0010
- #define LOC_GPS_DELETE_UTC 0x0020
- #define LOC_GPS_DELETE_HEALTH 0x0040
- #define LOC_GPS_DELETE_SVDIR 0x0080
- #define LOC_GPS_DELETE_SVSTEER 0x0100
- #define LOC_GPS_DELETE_SADATA 0x0200
- #define LOC_GPS_DELETE_RTI 0x0400
- #define LOC_GPS_DELETE_MB_DATA 0x0800
- #define LOC_GPS_DELETE_CELLDB_INFO 0x8000
- #define LOC_GPS_DELETE_ALL 0xFFFF
- typedef uint16_t LocAGpsType;
- #define LOC_AGPS_TYPE_ANY 0
- #define LOC_AGPS_TYPE_SUPL 1
- #define LOC_AGPS_TYPE_C2K 2
- #define LOC_AGPS_TYPE_WWAN_ANY 3
- #define LOC_AGPS_TYPE_WIFI 4
- #define LOC_AGPS_TYPE_SUPL_ES 5
- typedef uint16_t LocSubId;
- #define LOC_DEFAULT_SUB 0
- #define LOC_PRIMARY_SUB 1
- #define LOC_SECONDARY_SUB 2
- #define LOC_TERTIARY_SUB 3
- typedef uint16_t LocAGpsSetIDType;
- #define LOC_AGPS_SETID_TYPE_NONE 0
- #define LOC_AGPS_SETID_TYPE_IMSI 1
- #define LOC_AGPS_SETID_TYPE_MSISDN 2
- typedef uint16_t LocApnIpType;
- #define LOC_APN_IP_INVALID 0
- #define LOC_APN_IP_IPV4 1
- #define LOC_APN_IP_IPV6 2
- #define LOC_APN_IP_IPV4V6 3
- #define LOC_GPS_NI_SHORT_STRING_MAXLEN 256
- #define LOC_GPS_NI_LONG_STRING_MAXLEN 2048
- typedef uint32_t LocGpsNiType;
- #define LOC_GPS_NI_TYPE_VOICE 1
- #define LOC_GPS_NI_TYPE_UMTS_SUPL 2
- #define LOC_GPS_NI_TYPE_UMTS_CTRL_PLANE 3
- #define LOC_GPS_NI_TYPE_EMERGENCY_SUPL 4
- typedef uint32_t LocGpsNiNotifyFlags;
- #define LOC_GPS_NI_NEED_NOTIFY 0x0001
- #define LOC_GPS_NI_NEED_VERIFY 0x0002
- #define LOC_GPS_NI_PRIVACY_OVERRIDE 0x0004
- typedef int LocGpsUserResponseType;
- #define LOC_GPS_NI_RESPONSE_ACCEPT 1
- #define LOC_GPS_NI_RESPONSE_DENY 2
- #define LOC_GPS_NI_RESPONSE_NORESP 3
- typedef int LocGpsNiEncodingType;
- #define LOC_GPS_ENC_NONE 0
- #define LOC_GPS_ENC_SUPL_GSM_DEFAULT 1
- #define LOC_GPS_ENC_SUPL_UTF8 2
- #define LOC_GPS_ENC_SUPL_UCS2 3
- #define LOC_GPS_ENC_UNKNOWN -1
- typedef uint8_t LocAGpsStatusValue;
- #define LOC_GPS_REQUEST_AGPS_DATA_CONN 1
- #define LOC_GPS_RELEASE_AGPS_DATA_CONN 2
- #define LOC_GPS_AGPS_DATA_CONNECTED 3
- #define LOC_GPS_AGPS_DATA_CONN_DONE 4
- #define LOC_GPS_AGPS_DATA_CONN_FAILED 5
- typedef uint16_t LocAGpsRefLocationType;
- #define LOC_AGPS_REF_LOCATION_TYPE_GSM_CELLID 1
- #define LOC_AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2
- #define LOC_AGPS_REF_LOCATION_TYPE_MAC 3
- #define LOC_AGPS_REF_LOCATION_TYPE_LTE_CELLID 4
- #define LOC_AGPS_REG_LOCATION_TYPE_MAC 3
- #define LOC_AGPS_RIL_NETWORK_TYPE_MOBILE 0
- #define LOC_AGPS_RIL_NETWORK_TYPE_WIFI 1
- #define LOC_AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2
- #define LOC_AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3
- #define LOC_AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4
- #define LOC_AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5
- #define LOC_AGPS_RIL_NETWORK_TTYPE_WIMAX 6
- typedef uint16_t LocGpsClockFlags;
- #define LOC_GPS_CLOCK_HAS_LEAP_SECOND (1<<0)
- #define LOC_GPS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1)
- #define LOC_GPS_CLOCK_HAS_FULL_BIAS (1<<2)
- #define LOC_GPS_CLOCK_HAS_BIAS (1<<3)
- #define LOC_GPS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4)
- #define LOC_GPS_CLOCK_HAS_DRIFT (1<<5)
- #define LOC_GPS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6)
- typedef uint16_t LocGnssClockFlags;
- #define LOC_GNSS_CLOCK_HAS_LEAP_SECOND (1<<0)
- #define LOC_GNSS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1)
- #define LOC_GNSS_CLOCK_HAS_FULL_BIAS (1<<2)
- #define LOC_GNSS_CLOCK_HAS_BIAS (1<<3)
- #define LOC_GNSS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4)
- #define LOC_GNSS_CLOCK_HAS_DRIFT (1<<5)
- #define LOC_GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6)
- typedef uint8_t LocGpsClockType;
- #define LOC_GPS_CLOCK_TYPE_UNKNOWN 0
- #define LOC_GPS_CLOCK_TYPE_LOCAL_HW_TIME 1
- #define LOC_GPS_CLOCK_TYPE_GPS_TIME 2
- typedef uint32_t LocGpsMeasurementFlags;
- #define LOC_GPS_MEASUREMENT_HAS_SNR (1<<0)
- #define LOC_GPS_MEASUREMENT_HAS_ELEVATION (1<<1)
- #define LOC_GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY (1<<2)
- #define LOC_GPS_MEASUREMENT_HAS_AZIMUTH (1<<3)
- #define LOC_GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY (1<<4)
- #define LOC_GPS_MEASUREMENT_HAS_PSEUDORANGE (1<<5)
- #define LOC_GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY (1<<6)
- #define LOC_GPS_MEASUREMENT_HAS_CODE_PHASE (1<<7)
- #define LOC_GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY (1<<8)
- #define LOC_GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9)
- #define LOC_GPS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10)
- #define LOC_GPS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11)
- #define LOC_GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12)
- #define LOC_GPS_MEASUREMENT_HAS_BIT_NUMBER (1<<13)
- #define LOC_GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT (1<<14)
- #define LOC_GPS_MEASUREMENT_HAS_DOPPLER_SHIFT (1<<15)
- #define LOC_GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY (1<<16)
- #define LOC_GPS_MEASUREMENT_HAS_USED_IN_FIX (1<<17)
- #define LOC_GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE (1<<18)
- typedef uint32_t LocGnssMeasurementFlags;
- #define LOC_GNSS_MEASUREMENT_HAS_SNR (1<<0)
- #define LOC_GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9)
- #define LOC_GNSS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10)
- #define LOC_GNSS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11)
- #define LOC_GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12)
- typedef uint8_t LocGpsLossOfLock;
- #define LOC_GPS_LOSS_OF_LOCK_UNKNOWN 0
- #define LOC_GPS_LOSS_OF_LOCK_OK 1
- #define LOC_GPS_LOSS_OF_LOCK_CYCLE_SLIP 2
- typedef uint8_t LocGpsMultipathIndicator;
- #define LOC_GPS_MULTIPATH_INDICATOR_UNKNOWN 0
- #define LOC_GPS_MULTIPATH_INDICATOR_DETECTED 1
- #define LOC_GPS_MULTIPATH_INDICATOR_NOT_USED 2
- typedef uint8_t LocGnssMultipathIndicator;
- #define LOC_GNSS_MULTIPATH_INDICATOR_UNKNOWN 0
- #define LOC_GNSS_MULTIPATH_INDICATOR_PRESENT 1
- #define LOC_GNSS_MULTIPATH_INDICATOR_NOT_PRESENT 2
- typedef uint16_t LocGpsMeasurementState;
- #define LOC_GPS_MEASUREMENT_STATE_UNKNOWN 0
- #define LOC_GPS_MEASUREMENT_STATE_CODE_LOCK (1<<0)
- #define LOC_GPS_MEASUREMENT_STATE_BIT_SYNC (1<<1)
- #define LOC_GPS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2)
- #define LOC_GPS_MEASUREMENT_STATE_TOW_DECODED (1<<3)
- #define LOC_GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4)
- typedef uint32_t LocGnssMeasurementState;
- #define LOC_GNSS_MEASUREMENT_STATE_UNKNOWN 0
- #define LOC_GNSS_MEASUREMENT_STATE_CODE_LOCK (1<<0)
- #define LOC_GNSS_MEASUREMENT_STATE_BIT_SYNC (1<<1)
- #define LOC_GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2)
- #define LOC_GNSS_MEASUREMENT_STATE_TOW_DECODED (1<<3)
- #define LOC_GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4)
- #define LOC_GNSS_MEASUREMENT_STATE_SYMBOL_SYNC (1<<5)
- #define LOC_GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC (1<<6)
- #define LOC_GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED (1<<7)
- #define LOC_GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC (1<<8)
- #define LOC_GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC (1<<9)
- #define LOC_GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK (1<<10)
- #define LOC_GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK (1<<11)
- #define LOC_GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC (1<<12)
- #define LOC_GNSS_MEASUREMENT_STATE_SBAS_SYNC (1<<13)
- typedef uint16_t LocGpsAccumulatedDeltaRangeState;
- #define LOC_GPS_ADR_STATE_UNKNOWN 0
- #define LOC_GPS_ADR_STATE_VALID (1<<0)
- #define LOC_GPS_ADR_STATE_RESET (1<<1)
- #define LOC_GPS_ADR_STATE_CYCLE_SLIP (1<<2)
- typedef uint16_t LocGnssAccumulatedDeltaRangeState;
- #define LOC_GNSS_ADR_STATE_UNKNOWN 0
- #define LOC_GNSS_ADR_STATE_VALID (1<<0)
- #define LOC_GNSS_ADR_STATE_RESET (1<<1)
- #define LOC_GNSS_ADR_STATE_CYCLE_SLIP (1<<2)
- #if 0
- typedef uint8_t GpsNavigationMessageType;
- #define GPS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0
- #define GPS_NAVIGATION_MESSAGE_TYPE_L1CA 1
- #define GPS_NAVIGATION_MESSAGE_TYPE_L2CNAV 2
- #define GPS_NAVIGATION_MESSAGE_TYPE_L5CNAV 3
- #define GPS_NAVIGATION_MESSAGE_TYPE_CNAV2 4
- typedef int16_t GnssNavigationMessageType;
- #define GNSS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0
- #define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L1CA 0x0101
- #define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L2CNAV 0x0102
- #define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L5CNAV 0x0103
- #define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_CNAV2 0x0104
- #define GNSS_NAVIGATION_MESSAGE_TYPE_GLO_L1CA 0x0301
- #define GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D1 0x0501
- #define GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D2 0x0502
- #define GNSS_NAVIGATION_MESSAGE_TYPE_GAL_I 0x0601
- #define GNSS_NAVIGATION_MESSAGE_TYPE_GAL_F 0x0602
- typedef uint16_t NavigationMessageStatus;
- #define NAV_MESSAGE_STATUS_UNKNOWN 0
- #define NAV_MESSAGE_STATUS_PARITY_PASSED (1<<0)
- #define NAV_MESSAGE_STATUS_PARITY_REBUILT (1<<1)
- #define NAV_MESSAGE_STATUS_UNKONW 0
- #endif
- typedef uint8_t LocGnssSvFlags;
- #define LOC_GNSS_SV_FLAGS_NONE 0
- #define LOC_GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA (1 << 0)
- #define LOC_GNSS_SV_FLAGS_HAS_ALMANAC_DATA (1 << 1)
- #define LOC_GNSS_SV_FLAGS_USED_IN_FIX (1 << 2)
- typedef uint8_t LocGnssConstellationType;
- #define LOC_GNSS_CONSTELLATION_UNKNOWN 0
- #define LOC_GNSS_CONSTELLATION_GPS 1
- #define LOC_GNSS_CONSTELLATION_SBAS 2
- #define LOC_GNSS_CONSTELLATION_GLONASS 3
- #define LOC_GNSS_CONSTELLATION_QZSS 4
- #define LOC_GNSS_CONSTELLATION_BEIDOU 5
- #define LOC_GNSS_CONSTELLATION_GALILEO 6
- #define LOC_GPS_XTRA_INTERFACE "gps-xtra"
- #define LOC_GPS_DEBUG_INTERFACE "gps-debug"
- #define LOC_AGPS_INTERFACE "agps"
- #define LOC_SUPL_CERTIFICATE_INTERFACE "supl-certificate"
- #define LOC_GPS_NI_INTERFACE "gps-ni"
- #define LOC_AGPS_RIL_INTERFACE "agps_ril"
- #define LOC_GPS_GEOFENCING_INTERFACE "gps_geofencing"
- #define LOC_GPS_MEASUREMENT_INTERFACE "gps_measurement"
- #define LOC_GPS_NAVIGATION_MESSAGE_INTERFACE "gps_navigation_message"
- #define LOC_GNSS_CONFIGURATION_INTERFACE "gnss_configuration"
- typedef struct {
-
- uint32_t size;
-
- uint16_t flags;
-
- LocGpsSpoofMask spoof_mask;
-
- double latitude;
-
- double longitude;
-
- double altitude;
-
- float speed;
-
- float bearing;
-
- float accuracy;
-
- float vertUncertainity;
-
- LocGpsUtcTime timestamp;
-
- uint64_t elapsedRealTime;
-
- uint64_t elapsedRealTimeUnc;
- } LocGpsLocation;
- typedef struct {
-
- size_t size;
- LocGpsStatusValue status;
- } LocGpsStatus;
- typedef struct {
-
- size_t size;
-
- int prn;
-
- float snr;
-
- float elevation;
-
- float azimuth;
- } LocGpsSvInfo;
- typedef struct {
-
- size_t size;
-
- int16_t svid;
-
- LocGnssConstellationType constellation;
-
- float c_n0_dbhz;
-
- float elevation;
-
- float azimuth;
-
- LocGnssSvFlags flags;
- } LocGnssSvInfo;
- typedef struct {
-
- size_t size;
- int num_svs;
- LocGpsSvInfo sv_list[LOC_GPS_MAX_SVS];
- uint32_t ephemeris_mask;
- uint32_t almanac_mask;
- uint32_t used_in_fix_mask;
- } LocGpsSvStatus;
- typedef struct {
-
- size_t size;
-
- int num_svs;
-
- LocGnssSvInfo gnss_sv_list[LOC_GNSS_MAX_SVS];
- } LocGnssSvStatus;
- typedef struct {
- LocAGpsRefLocationType type;
-
- uint16_t mcc;
-
- uint16_t mnc;
-
- uint16_t lac;
-
- uint32_t cid;
-
- uint16_t tac;
-
- uint16_t pcid;
- } LocAGpsRefLocationCellID;
- typedef struct {
- uint8_t mac[6];
- } LocAGpsRefLocationMac;
- typedef struct {
- LocAGpsRefLocationType type;
- union {
- LocAGpsRefLocationCellID cellID;
- LocAGpsRefLocationMac mac;
- } u;
- } LocAGpsRefLocation;
- typedef void (* loc_gps_location_callback)(LocGpsLocation* location);
- typedef void (* loc_gps_status_callback)(LocGpsStatus* status);
- typedef void (* loc_gps_sv_status_callback)(LocGpsSvStatus* sv_info);
- typedef void (* loc_gnss_sv_status_callback)(LocGnssSvStatus* sv_info);
- typedef void (* loc_gps_nmea_callback)(LocGpsUtcTime timestamp, const char* nmea, int length);
- typedef void (* loc_gps_set_capabilities)(uint32_t capabilities);
- typedef void (* loc_gps_acquire_wakelock)();
- typedef void (* loc_gps_release_wakelock)();
- typedef void (* loc_gps_request_utc_time)();
- typedef pthread_t (* loc_gps_create_thread)(const char* name, void (*start)(void *), void* arg);
- typedef struct {
-
- size_t size;
-
- uint16_t year_of_hw;
- } LocGnssSystemInfo;
- typedef void (*loc_gnss_set_system_info)(const LocGnssSystemInfo* info);
- typedef struct {
-
- size_t size;
- loc_gps_location_callback location_cb;
- loc_gps_status_callback status_cb;
- loc_gps_sv_status_callback sv_status_cb;
- loc_gps_nmea_callback nmea_cb;
- loc_gps_set_capabilities set_capabilities_cb;
- loc_gps_acquire_wakelock acquire_wakelock_cb;
- loc_gps_release_wakelock release_wakelock_cb;
- loc_gps_create_thread create_thread_cb;
- loc_gps_request_utc_time request_utc_time_cb;
- loc_gnss_set_system_info set_system_info_cb;
- loc_gnss_sv_status_callback gnss_sv_status_cb;
- } LocGpsCallbacks;
- typedef struct {
-
- size_t size;
-
- int (*init)( LocGpsCallbacks* callbacks );
-
- int (*start)( void );
-
- int (*stop)( void );
-
- void (*cleanup)( void );
-
- int (*inject_time)(LocGpsUtcTime time, int64_t timeReference,
- int uncertainty);
-
- int (*inject_location)(double latitude, double longitude, float accuracy);
-
- void (*delete_aiding_data)(LocGpsAidingData flags);
-
- int (*set_position_mode)(LocGpsPositionMode mode, LocGpsPositionRecurrence recurrence,
- uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time);
-
- const void* (*get_extension)(const char* name);
- } LocGpsInterface;
- typedef void (* loc_gps_xtra_download_request)();
- typedef struct {
- loc_gps_xtra_download_request download_request_cb;
- loc_gps_create_thread create_thread_cb;
- } LocGpsXtraCallbacks;
- typedef struct {
-
- size_t size;
-
- int (*init)( LocGpsXtraCallbacks* callbacks );
-
- int (*inject_xtra_data)( char* data, int length );
- } LocGpsXtraInterface;
- #if 0
- typedef struct {
-
- size_t size;
-
- size_t (*get_internal_state)(char* buffer, size_t bufferSize);
- } LocGpsDebugInterface;
- #endif
- typedef struct {
-
- size_t size;
- LocAGpsType type;
- LocAGpsStatusValue status;
-
- uint32_t ipaddr;
-
- struct sockaddr_storage addr;
- } LocAGpsStatus;
- typedef void (* loc_agps_status_callback)(LocAGpsStatus* status);
- typedef struct {
- loc_agps_status_callback status_cb;
- loc_gps_create_thread create_thread_cb;
- } LocAGpsCallbacks;
- typedef struct {
-
- size_t size;
-
- void (*init)(LocAGpsCallbacks* callbacks);
-
- int (*data_conn_open)(const char* apn);
-
- int (*data_conn_closed)();
-
- int (*data_conn_failed)();
-
- int (*set_server)(LocAGpsType type, const char* hostname, int port);
-
- int (*data_conn_open_with_apn_ip_type)(
- const char* apn,
- LocApnIpType apnIpType);
- } LocAGpsInterface;
- #define LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS 0
- #define LOC_AGPS_CERTIFICATE_ERROR_GENERIC -100
- #define LOC_AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES -101
- typedef struct {
- size_t length;
- u_char* data;
- } LocDerEncodedCertificate;
- typedef struct {
- u_char data[20];
- } LocSha1CertificateFingerprint;
- typedef struct {
-
- size_t size;
-
- int (*install_certificates) ( const LocDerEncodedCertificate* certificates, size_t length );
-
- int (*revoke_certificates) ( const LocSha1CertificateFingerprint* fingerprints, size_t length );
- } LocSuplCertificateInterface;
- typedef struct {
-
- size_t size;
-
- int notification_id;
-
- LocGpsNiType ni_type;
-
- LocGpsNiNotifyFlags notify_flags;
-
- int timeout;
-
- LocGpsUserResponseType default_response;
-
- char requestor_id[LOC_GPS_NI_SHORT_STRING_MAXLEN];
-
- char text[LOC_GPS_NI_LONG_STRING_MAXLEN];
-
- LocGpsNiEncodingType requestor_id_encoding;
-
- LocGpsNiEncodingType text_encoding;
-
- char extras[LOC_GPS_NI_LONG_STRING_MAXLEN];
- } LocGpsNiNotification;
- typedef void (*loc_gps_ni_notify_callback)(LocGpsNiNotification *notification);
- typedef struct
- {
-
- loc_gps_ni_notify_callback notify_cb;
- loc_gps_create_thread create_thread_cb;
- } LocGpsNiCallbacks;
- typedef struct
- {
-
- size_t size;
-
- void (*init) (LocGpsNiCallbacks *callbacks);
-
- void (*respond) (int notif_id, LocGpsUserResponseType user_response);
- } LocGpsNiInterface;
- #define LOC_AGPS_RIL_REQUEST_SETID_IMSI (1<<0L)
- #define LOC_AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L)
- #define LOC_AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L)
- #define LOC_AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L)
- typedef void (*loc_agps_ril_request_set_id)(uint32_t flags);
- typedef void (*loc_agps_ril_request_ref_loc)(uint32_t flags);
- typedef struct {
- loc_agps_ril_request_set_id request_setid;
- loc_agps_ril_request_ref_loc request_refloc;
- loc_gps_create_thread create_thread_cb;
- } LocAGpsRilCallbacks;
- typedef struct {
-
- size_t size;
-
- void (*init)( LocAGpsRilCallbacks* callbacks );
-
- void (*set_ref_location) (const LocAGpsRefLocation *agps_reflocation, size_t sz_struct);
-
- void (*set_set_id) (LocAGpsSetIDType type, const char* setid);
-
- void (*ni_message) (uint8_t *msg, size_t len);
-
- void (*update_network_state) (int connected, int type, int roaming, const char* extra_info);
-
- void (*update_network_availability) (int avaiable, const char* apn);
- } LocAGpsRilInterface;
- #define LOC_GPS_GEOFENCE_ENTERED (1<<0L)
- #define LOC_GPS_GEOFENCE_EXITED (1<<1L)
- #define LOC_GPS_GEOFENCE_UNCERTAIN (1<<2L)
- #define LOC_GPS_GEOFENCE_DWELL_INSIDE (1<<0L)
- #define LOC_GPS_GEOFENCE_DWELL_OUTSIDE (1<<1L)
- #define LOC_GPS_GEOFENCE_CONFIDENCE_LOW 1
- #define LOC_GPS_GEOFENCE_CONFIDENCE_MEDIUM 2
- #define LOC_GPS_GEOFENCE_CONFIDENCE_HIGH 3
- #define LOC_GPS_GEOFENCE_UNAVAILABLE (1<<0L)
- #define LOC_GPS_GEOFENCE_AVAILABLE (1<<1L)
- #define LOC_GPS_GEOFENCE_OPERATION_SUCCESS 0
- #define LOC_GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES -100
- #define LOC_GPS_GEOFENCE_ERROR_ID_EXISTS -101
- #define LOC_GPS_GEOFENCE_ERROR_ID_UNKNOWN -102
- #define LOC_GPS_GEOFENCE_ERROR_INVALID_TRANSITION -103
- #define LOC_GPS_GEOFENCE_ERROR_GENERIC -149
- typedef void (*loc_gps_geofence_transition_callback) (int32_t geofence_id, LocGpsLocation* location,
- int32_t transition, LocGpsUtcTime timestamp);
- typedef void (*loc_gps_geofence_status_callback) (int32_t status, LocGpsLocation* last_location);
- typedef void (*loc_gps_geofence_add_callback) (int32_t geofence_id, int32_t status);
- typedef void (*loc_gps_geofence_remove_callback) (int32_t geofence_id, int32_t status);
- typedef void (*loc_gps_geofence_pause_callback) (int32_t geofence_id, int32_t status);
- typedef void (*loc_gps_geofence_resume_callback) (int32_t geofence_id, int32_t status);
- typedef struct {
- loc_gps_geofence_transition_callback geofence_transition_callback;
- loc_gps_geofence_status_callback geofence_status_callback;
- loc_gps_geofence_add_callback geofence_add_callback;
- loc_gps_geofence_remove_callback geofence_remove_callback;
- loc_gps_geofence_pause_callback geofence_pause_callback;
- loc_gps_geofence_resume_callback geofence_resume_callback;
- loc_gps_create_thread create_thread_cb;
- } LocGpsGeofenceCallbacks;
- typedef struct {
-
- size_t size;
-
- void (*init)( LocGpsGeofenceCallbacks* callbacks );
-
- void (*add_geofence_area) (int32_t geofence_id, double latitude, double longitude,
- double radius_meters, int last_transition, int monitor_transitions,
- int notification_responsiveness_ms, int unknown_timer_ms);
-
- void (*pause_geofence) (int32_t geofence_id);
-
- void (*resume_geofence) (int32_t geofence_id, int monitor_transitions);
-
- void (*remove_geofence_area) (int32_t geofence_id);
- } LocGpsGeofencingInterface;
- typedef struct {
-
- size_t size;
- LocGpsClockFlags flags;
- int16_t leap_second;
- LocGpsClockType type;
- int64_t time_ns;
- double time_uncertainty_ns;
- int64_t full_bias_ns;
- double bias_ns;
- double bias_uncertainty_ns;
- double drift_nsps;
- double drift_uncertainty_nsps;
- } LocGpsClock;
- typedef struct {
-
- size_t size;
-
- LocGnssClockFlags flags;
-
- int16_t leap_second;
-
- int64_t time_ns;
-
- double time_uncertainty_ns;
-
- int64_t full_bias_ns;
-
- double bias_ns;
-
- double bias_uncertainty_ns;
-
- double drift_nsps;
-
- double drift_uncertainty_nsps;
-
- uint32_t hw_clock_discontinuity_count;
- } LocGnssClock;
- typedef struct {
-
- size_t size;
- LocGpsMeasurementFlags flags;
- int8_t prn;
- double time_offset_ns;
- LocGpsMeasurementState state;
- int64_t received_gps_tow_ns;
- int64_t received_gps_tow_uncertainty_ns;
- double c_n0_dbhz;
- double pseudorange_rate_mps;
- double pseudorange_rate_uncertainty_mps;
- LocGpsAccumulatedDeltaRangeState accumulated_delta_range_state;
- double accumulated_delta_range_m;
- double accumulated_delta_range_uncertainty_m;
- double pseudorange_m;
- double pseudorange_uncertainty_m;
- double code_phase_chips;
- double code_phase_uncertainty_chips;
- float carrier_frequency_hz;
- int64_t carrier_cycles;
- double carrier_phase;
- double carrier_phase_uncertainty;
- LocGpsLossOfLock loss_of_lock;
- int32_t bit_number;
- int16_t time_from_last_bit_ms;
- double doppler_shift_hz;
- double doppler_shift_uncertainty_hz;
- LocGpsMultipathIndicator multipath_indicator;
- double snr_db;
- double elevation_deg;
- double elevation_uncertainty_deg;
- double azimuth_deg;
- double azimuth_uncertainty_deg;
- bool used_in_fix;
- } LocGpsMeasurement;
- typedef struct {
-
- size_t size;
-
- LocGnssMeasurementFlags flags;
-
- int16_t svid;
-
- LocGnssConstellationType constellation;
-
- double time_offset_ns;
-
- LocGnssMeasurementState state;
-
- int64_t received_sv_time_in_ns;
-
- int64_t received_sv_time_uncertainty_in_ns;
-
- double c_n0_dbhz;
-
- double pseudorange_rate_mps;
-
- double pseudorange_rate_uncertainty_mps;
-
- LocGnssAccumulatedDeltaRangeState accumulated_delta_range_state;
-
- double accumulated_delta_range_m;
-
- double accumulated_delta_range_uncertainty_m;
-
- float carrier_frequency_hz;
-
- int64_t carrier_cycles;
-
- double carrier_phase;
-
- double carrier_phase_uncertainty;
-
- LocGnssMultipathIndicator multipath_indicator;
-
- double snr_db;
- } LocGnssMeasurement;
- typedef struct {
-
- size_t size;
- size_t measurement_count;
- LocGpsMeasurement measurements[LOC_GPS_MAX_MEASUREMENT];
-
- LocGpsClock clock;
- } LocGpsData;
- typedef struct {
-
- size_t size;
-
- size_t measurement_count;
-
- LocGnssMeasurement measurements[LOC_GNSS_MAX_MEASUREMENT];
-
- LocGnssClock clock;
- } LocGnssData;
- typedef void (*loc_gps_measurement_callback) (LocGpsData* data);
- typedef void (*loc_gnss_measurement_callback) (LocGnssData* data);
- typedef struct {
-
- size_t size;
- loc_gps_measurement_callback measurement_callback;
- loc_gnss_measurement_callback loc_gnss_measurement_callback;
- } LocGpsMeasurementCallbacks;
- #define LOC_GPS_MEASUREMENT_OPERATION_SUCCESS 0
- #define LOC_GPS_MEASUREMENT_ERROR_ALREADY_INIT -100
- #define LOC_GPS_MEASUREMENT_ERROR_GENERIC -101
- typedef struct {
-
- size_t size;
-
- int (*init) (LocGpsMeasurementCallbacks* callbacks);
-
- void (*close) ();
- } LocGpsMeasurementInterface;
- #if 0
- typedef struct {
-
- size_t size;
- int8_t prn;
- GpsNavigationMessageType type;
- NavigationMessageStatus status;
- int16_t message_id;
- int16_t submessage_id;
- size_t data_length;
- uint8_t* data;
- } GpsNavigationMessage;
- typedef struct {
-
- size_t size;
-
- int16_t svid;
-
- GnssNavigationMessageType type;
-
- NavigationMessageStatus status;
-
- int16_t message_id;
-
- int16_t submessage_id;
-
- size_t data_length;
-
- uint8_t* data;
- } GnssNavigationMessage;
- typedef void (*gps_navigation_message_callback) (GpsNavigationMessage* message);
- typedef void (*gnss_navigation_message_callback) (GnssNavigationMessage* message);
- typedef struct {
-
- size_t size;
- gps_navigation_message_callback navigation_message_callback;
- gnss_navigation_message_callback gnss_navigation_message_callback;
- } GpsNavigationMessageCallbacks;
- #define GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS 0
- #define GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT -100
- #define GPS_NAVIGATION_MESSAGE_ERROR_GENERIC -101
- typedef struct {
-
- size_t size;
-
- int (*init) (GpsNavigationMessageCallbacks* callbacks);
-
- void (*close) ();
- } GpsNavigationMessageInterface;
- #endif
- typedef struct {
-
- size_t size;
-
- void (*configuration_update) (const char* config_data, int32_t length);
- } LocGnssConfigurationInterface;
- __END_DECLS
- #endif
|