From b1bcffd829ce83c78028838939f011a4b6abb722 Mon Sep 17 00:00:00 2001 From: Prateek Chaubey Date: Tue, 20 Mar 2018 06:14:48 +0100 Subject: [PATCH] land: switch to msm8937-common --- Android.mk | 109 +- BoardConfig.mk | 4 + android_filesystem_config.h | 44 - audio/aanc_tuning_mixer.txt | 144 - audio/audio_effects.conf | 412 --- audio/audio_output_policy.conf | 63 - audio/audio_policy.conf | 173 - audio/audio_policy_configuration.xml | 296 -- audio/mixer_paths_qrd_sku1.xml | 1205 ------- audio/sound_trigger_mixer_paths.xml | 83 - audio/sound_trigger_platform_info.xml | 72 - bluetooth/bdroid_buildcfg.h | 31 - board/00-qcom-platform-msm8937.mk | 24 - board/ant.mk | 2 - board/bluetooth.mk | 3 - board/bootloader.mk | 3 - board/charger.mk | 3 - board/cne.mk | 2 - board/crypto.mk | 2 - board/display.mk | 6 - board/filesystem.mk | 11 - board/fm.mk | 4 - board/gps.mk | 3 - board/hardware.mk | 5 - board/init.mk | 2 + board/kernel.mk | 12 +- board/malloc.mk | 2 - board/per-mgr.mk | 2 - board/qcom-audio.mk | 39 - board/qcom-bluetooth.mk | 3 - board/{camera.mk => qcom-camera.mk} | 0 board/qcom-display.mk | 6 - board/qcom-init.mk | 4 - board/qcom-keymaster.mk | 2 - board/qcom-media.mk | 1 - board/qcom-wlan.mk | 16 - board/recovery.mk | 2 - board/sensors.mk | 2 - board/sepolicy.mk | 5 - .../org/cyanogenmod/hardware/KeyDisabler.java | 46 - cmhw/org/cyanogenmod/hardware/VibratorHW.java | 54 - configs/media_codecs.xml | 259 -- configs/media_codecs_performance.xml | 127 - configs/media_profiles.xml | 698 ---- configs/msm_irqbalance.conf | 2 - configs/sec_config | 319 -- configs/sensors/hals.conf | 1 - configs/sensors/sensor_def_qcomdev.conf | 351 -- configs/thermal-engine.conf | 230 -- device.mk | 11 +- doze/Android.mk | 17 - doze/AndroidManifest.xml | 38 - doze/proguard.flags | 3 - doze/res/values/strings.xml | 19 - .../doze/BootCompletedReceiver.java | 33 - doze/src/org/cyanogenmod/doze/CMSensor.java | 77 - .../src/org/cyanogenmod/doze/DozeService.java | 91 - doze/src/org/cyanogenmod/doze/TiltSensor.java | 48 - extract-files.sh | 1 - gps/Android.mk | 21 - gps/CleanSpec.mk | 50 - gps/Makefile.am | 10 - gps/configure.ac | 97 - gps/core/Android.mk | 58 - gps/core/ContextBase.cpp | 138 - gps/core/ContextBase.h | 144 - gps/core/LBSProxyBase.h | 80 - gps/core/LocAdapterBase.cpp | 149 - gps/core/LocAdapterBase.h | 131 - gps/core/LocAdapterProxyBase.h | 75 - gps/core/LocApiBase.cpp | 598 ---- gps/core/LocApiBase.h | 274 -- gps/core/LocDualContext.cpp | 151 - gps/core/LocDualContext.h | 76 - gps/core/Makefile.am | 46 - gps/core/UlpProxyBase.h | 122 - gps/core/gps_extended.h | 104 - gps/core/gps_extended_c.h | 1088 ------ gps/core/loc_core_log.cpp | 243 -- gps/core/loc_core_log.h | 58 - gps/etc/flp.conf | 60 - gps/etc/gps.conf | 182 - gps/etc/izat.conf | 233 -- gps/etc/lowi.conf | 51 - gps/etc/sap.conf | 67 - gps/etc/xtwifi.conf | 82 - gps/gnsspps/Android.mk | 32 - gps/gnsspps/Makefile.am | 35 - gps/gnsspps/configure.ac | 60 - gps/gnsspps/gnsspps.c | 194 -- gps/gnsspps/gnsspps.h | 45 - gps/gnsspps/gnsspps.pc.in | 10 - gps/gnsspps/timepps.h | 106 - gps/loc-hal.pc.in | 10 - gps/loc_api/Android.mk | 13 - gps/loc_api/Makefile.am | 133 - gps/loc_api/libloc_api-rpc-50001/Android.mk | 3 - .../libloc_api-rpc-glue/Android.mk | 60 - .../libloc_api-rpc-glue/Makefile.am | 46 - .../libloc_api-rpc-glue/rpc_inc/LocApiRpc.h | 142 - .../libloc_api-rpc-glue/rpc_inc/debug.h | 69 - .../rpc_inc/loc_api_fixup.h | 226 -- .../libloc_api-rpc-glue/rpc_inc/loc_api_log.h | 59 - .../rpc_inc/loc_api_rpc_glue.h | 123 - .../rpc_inc/loc_api_sync_call.h | 90 - .../rpc_inc/loc_apicb_appinit.h | 45 - .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 1475 -------- .../libloc_api-rpc-glue/src/loc_api_fixup.c | 52 - .../libloc_api-rpc-glue/src/loc_api_log.c | 344 -- .../src/loc_api_rpc_glue.c | 635 ---- .../src/loc_api_sync_call.c | 565 --- .../src/loc_apicb_appinit.c | 86 - .../libloc_api-rpc-stub/Android.mk | 36 - .../libloc_api-rpc-stub/Makefile.am | 42 - .../inc/loc_api_rpcgen_cb_rpc.h | 156 - .../inc/loc_api_rpcgen_common_rpc.h | 1261 ------- .../inc/loc_api_rpcgen_rpc.h | 288 -- .../inc/loc_apicb_appinit.h | 34 - .../src/loc_api_rpcgen_cb_svc.c | 327 -- .../src/loc_api_rpcgen_cb_xdr.c | 60 - .../src/loc_api_rpcgen_clnt.c | 155 - .../src/loc_api_rpcgen_common_xdr.c | 1775 ---------- .../src/loc_api_rpcgen_xdr.c | 199 -- .../src/loc_apicb_appinit.c | 74 - .../libloc_api-rpc-stub/xdr/loc_api.xdr | 261 -- .../libloc_api-rpc-stub/xdr/loc_api_cb.xdr | 187 - .../xdr/loc_api_common.xdr | 1021 ------ gps/loc_api/libloc_api_50001/Android.mk | 114 - .../libloc_api_50001/LocEngAdapter.cpp | 601 ---- gps/loc_api/libloc_api_50001/LocEngAdapter.h | 376 -- gps/loc_api/libloc_api_50001/Makefile.am | 78 - gps/loc_api/libloc_api_50001/gps.c | 73 - gps/loc_api/libloc_api_50001/loc.cpp | 1118 ------ gps/loc_api/libloc_api_50001/loc.h | 67 - gps/loc_api/libloc_api_50001/loc_eng.cpp | 3081 ----------------- gps/loc_api/libloc_api_50001/loc_eng.h | 210 -- gps/loc_api/libloc_api_50001/loc_eng_agps.cpp | 969 ------ gps/loc_api/libloc_api_50001/loc_eng_agps.h | 435 --- .../libloc_api_50001/loc_eng_dmn_conn.cpp | 269 -- .../libloc_api_50001/loc_eng_dmn_conn.h | 59 - .../loc_eng_dmn_conn_glue_msg.c | 222 -- .../loc_eng_dmn_conn_glue_msg.h | 51 - .../loc_eng_dmn_conn_glue_pipe.c | 215 -- .../loc_eng_dmn_conn_glue_pipe.h | 50 - .../loc_eng_dmn_conn_handler.cpp | 236 -- .../loc_eng_dmn_conn_handler.h | 106 - .../loc_eng_dmn_conn_thread_helper.c | 398 --- .../loc_eng_dmn_conn_thread_helper.h | 74 - gps/loc_api/libloc_api_50001/loc_eng_log.cpp | 35 - gps/loc_api/libloc_api_50001/loc_eng_log.h | 44 - gps/loc_api/libloc_api_50001/loc_eng_msg.h | 306 -- gps/loc_api/libloc_api_50001/loc_eng_ni.cpp | 413 --- gps/loc_api/libloc_api_50001/loc_eng_ni.h | 59 - gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp | 924 ----- gps/loc_api/libloc_api_50001/loc_eng_nmea.h | 43 - gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp | 219 -- gps/loc_api/libloc_api_50001/loc_eng_xtra.h | 47 - gps/utils/Android.mk | 69 - gps/utils/LocHeap.cpp | 354 -- gps/utils/LocHeap.h | 96 - gps/utils/LocSharedLock.h | 59 - gps/utils/LocThread.cpp | 266 -- gps/utils/LocThread.h | 92 - gps/utils/LocTimer.cpp | 742 ---- gps/utils/LocTimer.h | 74 - gps/utils/Makefile.am | 55 - gps/utils/MsgTask.cpp | 101 - gps/utils/MsgTask.h | 67 - gps/utils/linked_list.c | 327 -- gps/utils/linked_list.h | 217 -- gps/utils/loc_cfg.cpp | 400 --- gps/utils/loc_cfg.h | 91 - gps/utils/loc_log.cpp | 238 -- gps/utils/loc_log.h | 71 - gps/utils/loc_misc_utils.cpp | 114 - gps/utils/loc_misc_utils.h | 99 - gps/utils/loc_target.cpp | 287 -- gps/utils/loc_target.h | 86 - gps/utils/loc_timer.h | 73 - gps/utils/log_util.h | 195 -- gps/utils/msg_q.c | 335 -- gps/utils/msg_q.h | 207 -- .../platform_lib_abstractions/Android.mk | 5 - .../elapsed_millis_since_boot.cpp | 46 - .../loc_pla/Android.mk | 5 - .../loc_pla/Makefile.am | 10 - .../loc_pla/configure.ac | 61 - .../include/platform_lib_android_runtime.h | 45 - .../loc_pla/include/platform_lib_gettid.h | 41 - .../loc_pla/include/platform_lib_includes.h | 40 - .../loc_pla/include/platform_lib_log_util.h | 196 -- .../loc_pla/include/platform_lib_macros.h | 73 - .../include/platform_lib_property_service.h | 44 - .../include/platform_lib_sched_policy.h | 46 - .../loc_pla/include/platform_lib_time.h | 35 - .../loc_pla/loc-pla.pc.in | 10 - .../loc_pla/src/Android.mk | 55 - .../loc_pla/src/Makefile.am | 41 - .../src/platform_lib_android_runtime.cpp | 40 - .../loc_pla/src/platform_lib_gettid.cpp | 40 - .../loc_pla/src/platform_lib_log_util.cpp | 42 - .../src/platform_lib_property_service.cpp | 39 - .../loc_pla/src/platform_lib_sched_policy.cpp | 41 - .../loc_pla/src/platform_lib_time.cpp | 47 - .../loc_stub/Android.mk | 5 - .../loc_stub/Makefile.am | 9 - .../loc_stub/configure.ac | 67 - .../include/loc_stub_android_runtime.h | 45 - .../loc_stub/include/loc_stub_gettid.h | 44 - .../include/loc_stub_property_service.h | 42 - .../loc_stub/include/loc_stub_sched_policy.h | 64 - .../loc_stub/include/loc_stub_time.h | 45 - .../loc_stub/loc-stub.pc.in | 10 - .../loc_stub/src/Android.mk | 49 - .../loc_stub/src/Makefile.am | 40 - .../loc_stub/src/loc_stub_android_runtime.cpp | 41 - .../loc_stub/src/loc_stub_gettid.cpp | 37 - .../src/loc_stub_property_service.cpp | 42 - .../loc_stub/src/loc_stub_sched_policy.cpp | 50 - .../loc_stub/src/loc_stub_time.cpp | 46 - idc/gf3208.idc | 15 - idc/uinput-fpc.idc | 15 - init/Android.mk | 28 - init/init_land.cpp | 169 - keylayout/ft5x06_720p.kl | 31 - keylayout/gf3208.kl | 14 - keylayout/gpio-keys.kl | 32 - keylayout/uinput-fpc.kl | 14 - libinit/init_land.cpp | 78 + lineage.dependencies | 12 +- lineage.mk | 2 +- .../base/core/res/res/values/config.xml | 86 - .../res/values/config.xml | 20 - .../apps/Dialer/res/values/config.xml | 21 - .../vendor/cmsdk/cm/res/res/values/config.xml | 38 - .../base/core/res/res/values/config.xml | 314 -- .../base/core/res/res/xml/power_profile.xml | 26 - .../SettingsProvider/res/values/defaults.xml | 21 - .../packages/SystemUI/res/values/config.xml | 20 - .../telephony/resources/res/values/config.xml | 37 - .../apps/Bluetooth/res/values/config.xml | 28 - .../apps/CarrierConfig/res/xml/vendor.xml | 501 --- .../res/values/config.xml | 22 - .../res/values-mcc001-mnc10/config.xml | 19 - .../res/values-mcc311-mnc390/config.xml | 19 - .../res/values-mcc405-mnc840/config.xml | 19 - .../res/values-mcc405-mnc857/config.xml | 19 - .../res/values-mcc405-mnc858/config.xml | 19 - .../res/values-mcc405-mnc859/config.xml | 19 - .../res/values-mcc405-mnc862/config.xml | 19 - .../res/values-mcc405-mnc863/config.xml | 19 - .../res/values-mcc405-mnc864/config.xml | 19 - .../res/values-mcc405-mnc867/config.xml | 19 - .../res/values-mcc405-mnc868/config.xml | 19 - .../res/values-mcc405-mnc871/config.xml | 19 - .../packages/apps/Snap/res/values/config.xml | 28 - .../apps/Snap/res/values/qcomstrings.xml | 25 - .../res/values-mcc460-mnc7/config.xml | 27 - .../services/Telephony/res/values/config.xml | 45 - product/ant.mk | 9 - product/bluetooth.mk | 12 - product/camera.mk | 6 - product/cne.mk | 3 - product/consumerir.mk | 3 - product/display.mk | 29 - product/filesystem.mk | 3 - product/fingerprint.mk | 7 - product/init.mk | 16 +- product/irq.mk | 3 - product/keylayout.mk | 11 +- product/lights.mk | 3 - product/media.mk | 18 - product/perf.mk | 4 - product/qcom-audio.mk | 71 +- product/qcom-camera.mk | 12 +- product/qcom-display.mk | 22 - product/qcom-fm.mk | 8 - product/qcom-gps.mk | 20 - product/qcom-media.mk | 10 - product/qcom-perf.mk | 7 - product/qcom-radio.mk | 50 +- product/qcom-thermal.mk | 3 - product/sdcardfs.mk | 3 - product/sensors.mk | 18 - product/touchscreen.mk | 3 - product/usb.mk | 9 - product/wifi.mk | 29 - proprietary-files-qc.txt | 516 --- rootdir/Android.mk | 78 +- rootdir/etc/init.qcom.bt.sh | 90 - rootdir/fstab.qcom | 21 - rootdir/{init.qcom.sh => init.device.rc} | 36 +- rootdir/init.qcom.power.rc | 178 - rootdir/init.qcom.rc | 471 --- rootdir/init.qcom.usb.rc | 1617 --------- rootdir/init.qcom.usb.sh | 308 -- rootdir/init.target.rc | 185 - rootdir/ueventd.qcom.rc | 277 -- sepolicy/bluetooth_loader.te | 2 - sepolicy/device.te | 2 - sepolicy/file.te | 5 - sepolicy/file_contexts | 24 - sepolicy/fingerprintd.te | 12 - sepolicy/fsck.te | 1 - sepolicy/gx_fpd.te | 50 - sepolicy/ims.te | 1 - sepolicy/init.te | 3 - sepolicy/location.te | 2 - sepolicy/netmgrd.te | 3 - sepolicy/per_mgr.te | 1 - sepolicy/priv_app.te | 1 - sepolicy/qti_init_shell.te | 3 - sepolicy/radio.te | 1 - sepolicy/rmt_storage.te | 1 - sepolicy/service.te | 1 - sepolicy/service_contexts | 1 - sepolicy/system_app.te | 2 - sepolicy/system_server.te | 1 - sepolicy/tee.te | 6 - sepolicy/ueventd.te | 1 - setup-makefiles.sh | 3 - wifi/firmware/WCNSS_cfg.dat | Bin 11514 -> 0 bytes wifi/firmware/WCNSS_qcom_cfg.ini | 483 --- wifi/fstman.ini | 24 - wifi/hostapd.accept | 3 - wifi/hostapd.deny | 2 - wifi/hostapd_default.conf | 1043 ------ wifi/p2p_supplicant_overlay.conf | 2 - wifi/wpa_supplicant_overlay.conf | 2 - 329 files changed, 113 insertions(+), 45033 deletions(-) delete mode 100644 android_filesystem_config.h delete mode 100644 audio/aanc_tuning_mixer.txt delete mode 100644 audio/audio_effects.conf delete mode 100644 audio/audio_output_policy.conf delete mode 100644 audio/audio_policy.conf delete mode 100644 audio/audio_policy_configuration.xml delete mode 100644 audio/mixer_paths_qrd_sku1.xml delete mode 100644 audio/sound_trigger_mixer_paths.xml delete mode 100644 audio/sound_trigger_platform_info.xml delete mode 100644 bluetooth/bdroid_buildcfg.h delete mode 100644 board/00-qcom-platform-msm8937.mk delete mode 100644 board/ant.mk delete mode 100644 board/bluetooth.mk delete mode 100644 board/bootloader.mk delete mode 100644 board/charger.mk delete mode 100644 board/cne.mk delete mode 100644 board/crypto.mk delete mode 100644 board/display.mk delete mode 100644 board/filesystem.mk delete mode 100644 board/fm.mk delete mode 100644 board/gps.mk delete mode 100644 board/hardware.mk create mode 100644 board/init.mk delete mode 100644 board/malloc.mk delete mode 100644 board/per-mgr.mk delete mode 100644 board/qcom-audio.mk delete mode 100644 board/qcom-bluetooth.mk rename board/{camera.mk => qcom-camera.mk} (100%) delete mode 100644 board/qcom-display.mk delete mode 100644 board/qcom-init.mk delete mode 100644 board/qcom-keymaster.mk delete mode 100644 board/qcom-media.mk delete mode 100644 board/qcom-wlan.mk delete mode 100644 board/recovery.mk delete mode 100644 board/sensors.mk delete mode 100644 board/sepolicy.mk delete mode 100644 cmhw/org/cyanogenmod/hardware/KeyDisabler.java delete mode 100644 cmhw/org/cyanogenmod/hardware/VibratorHW.java delete mode 100644 configs/media_codecs.xml delete mode 100644 configs/media_codecs_performance.xml delete mode 100644 configs/media_profiles.xml delete mode 100644 configs/msm_irqbalance.conf delete mode 100644 configs/sec_config delete mode 100644 configs/sensors/hals.conf delete mode 100644 configs/sensors/sensor_def_qcomdev.conf delete mode 100644 configs/thermal-engine.conf delete mode 100644 doze/Android.mk delete mode 100644 doze/AndroidManifest.xml delete mode 100644 doze/proguard.flags delete mode 100644 doze/res/values/strings.xml delete mode 100644 doze/src/org/cyanogenmod/doze/BootCompletedReceiver.java delete mode 100644 doze/src/org/cyanogenmod/doze/CMSensor.java delete mode 100644 doze/src/org/cyanogenmod/doze/DozeService.java delete mode 100644 doze/src/org/cyanogenmod/doze/TiltSensor.java delete mode 100644 gps/Android.mk delete mode 100644 gps/CleanSpec.mk delete mode 100644 gps/Makefile.am delete mode 100644 gps/configure.ac delete mode 100644 gps/core/Android.mk delete mode 100644 gps/core/ContextBase.cpp delete mode 100644 gps/core/ContextBase.h delete mode 100644 gps/core/LBSProxyBase.h delete mode 100644 gps/core/LocAdapterBase.cpp delete mode 100644 gps/core/LocAdapterBase.h delete mode 100644 gps/core/LocAdapterProxyBase.h delete mode 100644 gps/core/LocApiBase.cpp delete mode 100644 gps/core/LocApiBase.h delete mode 100644 gps/core/LocDualContext.cpp delete mode 100644 gps/core/LocDualContext.h delete mode 100644 gps/core/Makefile.am delete mode 100644 gps/core/UlpProxyBase.h delete mode 100644 gps/core/gps_extended.h delete mode 100644 gps/core/gps_extended_c.h delete mode 100644 gps/core/loc_core_log.cpp delete mode 100644 gps/core/loc_core_log.h delete mode 100644 gps/etc/flp.conf delete mode 100644 gps/etc/gps.conf delete mode 100644 gps/etc/izat.conf delete mode 100644 gps/etc/lowi.conf delete mode 100644 gps/etc/sap.conf delete mode 100644 gps/etc/xtwifi.conf delete mode 100644 gps/gnsspps/Android.mk delete mode 100644 gps/gnsspps/Makefile.am delete mode 100644 gps/gnsspps/configure.ac delete mode 100644 gps/gnsspps/gnsspps.c delete mode 100644 gps/gnsspps/gnsspps.h delete mode 100644 gps/gnsspps/gnsspps.pc.in delete mode 100644 gps/gnsspps/timepps.h delete mode 100644 gps/loc-hal.pc.in delete mode 100644 gps/loc_api/Android.mk delete mode 100644 gps/loc_api/Makefile.am delete mode 100644 gps/loc_api/libloc_api-rpc-50001/Android.mk delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr delete mode 100644 gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr delete mode 100644 gps/loc_api/libloc_api_50001/Android.mk delete mode 100644 gps/loc_api/libloc_api_50001/LocEngAdapter.cpp delete mode 100644 gps/loc_api/libloc_api_50001/LocEngAdapter.h delete mode 100644 gps/loc_api/libloc_api_50001/Makefile.am delete mode 100644 gps/loc_api/libloc_api_50001/gps.c delete mode 100644 gps/loc_api/libloc_api_50001/loc.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_agps.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_agps.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_log.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_log.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_msg.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_ni.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_ni.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_nmea.h delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp delete mode 100644 gps/loc_api/libloc_api_50001/loc_eng_xtra.h delete mode 100644 gps/utils/Android.mk delete mode 100644 gps/utils/LocHeap.cpp delete mode 100644 gps/utils/LocHeap.h delete mode 100644 gps/utils/LocSharedLock.h delete mode 100644 gps/utils/LocThread.cpp delete mode 100644 gps/utils/LocThread.h delete mode 100644 gps/utils/LocTimer.cpp delete mode 100644 gps/utils/LocTimer.h delete mode 100644 gps/utils/Makefile.am delete mode 100644 gps/utils/MsgTask.cpp delete mode 100644 gps/utils/MsgTask.h delete mode 100644 gps/utils/linked_list.c delete mode 100644 gps/utils/linked_list.h delete mode 100644 gps/utils/loc_cfg.cpp delete mode 100644 gps/utils/loc_cfg.h delete mode 100644 gps/utils/loc_log.cpp delete mode 100644 gps/utils/loc_log.h delete mode 100644 gps/utils/loc_misc_utils.cpp delete mode 100644 gps/utils/loc_misc_utils.h delete mode 100644 gps/utils/loc_target.cpp delete mode 100644 gps/utils/loc_target.h delete mode 100644 gps/utils/loc_timer.h delete mode 100644 gps/utils/log_util.h delete mode 100644 gps/utils/msg_q.c delete mode 100644 gps/utils/msg_q.h delete mode 100644 gps/utils/platform_lib_abstractions/Android.mk delete mode 100644 gps/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/Android.mk delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/Makefile.am delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/configure.ac delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/src/Android.mk delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/src/Makefile.am delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/Android.mk delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/Makefile.am delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/configure.ac delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/src/Android.mk delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/src/Makefile.am delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp delete mode 100644 gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp delete mode 100644 idc/gf3208.idc delete mode 100644 idc/uinput-fpc.idc delete mode 100644 init/Android.mk delete mode 100644 init/init_land.cpp delete mode 100644 keylayout/ft5x06_720p.kl delete mode 100644 keylayout/gf3208.kl delete mode 100644 keylayout/gpio-keys.kl delete mode 100644 keylayout/uinput-fpc.kl create mode 100644 libinit/init_land.cpp delete mode 100644 overlay-lineage/frameworks/base/core/res/res/values/config.xml delete mode 100644 overlay-lineage/packages/apps/CellBroadcastReceiver/res/values/config.xml delete mode 100644 overlay-lineage/packages/apps/Dialer/res/values/config.xml delete mode 100644 overlay-lineage/vendor/cmsdk/cm/res/res/values/config.xml delete mode 100644 overlay/frameworks/base/core/res/res/values/config.xml delete mode 100644 overlay/frameworks/base/core/res/res/xml/power_profile.xml delete mode 100644 overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml delete mode 100644 overlay/frameworks/base/packages/SystemUI/res/values/config.xml delete mode 100644 overlay/frameworks/opt/telephony/resources/res/values/config.xml delete mode 100644 overlay/packages/apps/Bluetooth/res/values/config.xml delete mode 100644 overlay/packages/apps/CarrierConfig/res/xml/vendor.xml delete mode 100644 overlay/packages/apps/CellBroadcastReceiver/res/values/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc001-mnc10/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc311-mnc390/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc840/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc857/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc858/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc859/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc862/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc863/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc864/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc867/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc868/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values-mcc405-mnc871/config.xml delete mode 100644 overlay/packages/apps/Snap/res/values/config.xml delete mode 100644 overlay/packages/apps/Snap/res/values/qcomstrings.xml delete mode 100644 overlay/packages/services/Telephony/res/values-mcc460-mnc7/config.xml delete mode 100644 overlay/packages/services/Telephony/res/values/config.xml delete mode 100644 product/ant.mk delete mode 100644 product/bluetooth.mk delete mode 100644 product/camera.mk delete mode 100644 product/cne.mk delete mode 100644 product/consumerir.mk delete mode 100644 product/display.mk delete mode 100644 product/filesystem.mk delete mode 100644 product/fingerprint.mk delete mode 100644 product/irq.mk delete mode 100644 product/lights.mk delete mode 100644 product/media.mk delete mode 100644 product/perf.mk delete mode 100644 product/qcom-display.mk delete mode 100644 product/qcom-fm.mk delete mode 100644 product/qcom-gps.mk delete mode 100644 product/qcom-media.mk delete mode 100644 product/qcom-perf.mk delete mode 100644 product/qcom-thermal.mk delete mode 100644 product/sdcardfs.mk delete mode 100644 product/sensors.mk delete mode 100644 product/touchscreen.mk delete mode 100644 product/usb.mk delete mode 100644 product/wifi.mk delete mode 100644 proprietary-files-qc.txt delete mode 100755 rootdir/etc/init.qcom.bt.sh delete mode 100644 rootdir/fstab.qcom rename rootdir/{init.qcom.sh => init.device.rc} (55%) mode change 100755 => 100644 delete mode 100644 rootdir/init.qcom.power.rc delete mode 100644 rootdir/init.qcom.rc delete mode 100644 rootdir/init.qcom.usb.rc delete mode 100755 rootdir/init.qcom.usb.sh delete mode 100644 rootdir/init.target.rc delete mode 100644 rootdir/ueventd.qcom.rc delete mode 100644 sepolicy/bluetooth_loader.te delete mode 100644 sepolicy/device.te delete mode 100644 sepolicy/file.te delete mode 100644 sepolicy/file_contexts delete mode 100644 sepolicy/fingerprintd.te delete mode 100644 sepolicy/fsck.te delete mode 100644 sepolicy/gx_fpd.te delete mode 100644 sepolicy/ims.te delete mode 100644 sepolicy/init.te delete mode 100644 sepolicy/location.te delete mode 100644 sepolicy/netmgrd.te delete mode 100644 sepolicy/per_mgr.te delete mode 100644 sepolicy/priv_app.te delete mode 100644 sepolicy/qti_init_shell.te delete mode 100644 sepolicy/radio.te delete mode 100644 sepolicy/rmt_storage.te delete mode 100644 sepolicy/service.te delete mode 100644 sepolicy/service_contexts delete mode 100644 sepolicy/system_app.te delete mode 100644 sepolicy/system_server.te delete mode 100644 sepolicy/tee.te delete mode 100644 sepolicy/ueventd.te delete mode 100644 wifi/firmware/WCNSS_cfg.dat delete mode 100644 wifi/firmware/WCNSS_qcom_cfg.ini delete mode 100644 wifi/fstman.ini delete mode 100644 wifi/hostapd.accept delete mode 100644 wifi/hostapd.deny delete mode 100644 wifi/hostapd_default.conf delete mode 100644 wifi/p2p_supplicant_overlay.conf delete mode 100644 wifi/wpa_supplicant_overlay.conf diff --git a/Android.mk b/Android.mk index 2fd4ef8..27c7782 100644 --- a/Android.mk +++ b/Android.mk @@ -1,5 +1,6 @@ # # Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-18 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,113 +13,15 @@ # 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. -# -# This contains the module build definitions for the hardware-specific -# components for this device. -# -# As much as possible, those components should be built unconditionally, -# with device-specific names to avoid collisions, to avoid device-specific -# bitrot and build breakages. Building a component unconditionally does -# *not* include it on all devices, so it is safe even with hardware-specific -# components. +# WARNING: Everything listed here will be built on ALL platforms, +# including x86, the emulator, and the SDK. Modules must be uniquely +# named (liblights.tuna), and must build everywhere, or limit themselves +# to only building on ARM if they include assembly. Individual makefiles +# are responsible for having their own logic, for fine-grained control. LOCAL_PATH := $(call my-dir) ifeq ($(TARGET_DEVICE),land) - include $(call all-makefiles-under,$(LOCAL_PATH)) - -include $(CLEAR_VARS) - -LOCAL_MODULE := wifi_symlinks -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := FAKE -LOCAL_MODULE_SUFFIX := -timestamp - -include $(BUILD_SYSTEM)/base_rules.mk - -$(LOCAL_BUILT_MODULE): ACTUAL_INI_FILE := /data/misc/wifi/WCNSS_qcom_cfg.ini -$(LOCAL_BUILT_MODULE): WCNSS_INI_SYMLINK := $(TARGET_OUT)/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini - -$(LOCAL_BUILT_MODULE): ACTUAL_BIN_FILE := /persist/WCNSS_qcom_wlan_nv.bin -$(LOCAL_BUILT_MODULE): WCNSS_BIN_SYMLINK := $(TARGET_OUT)/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin - -$(LOCAL_BUILT_MODULE): ACTUAL_DAT_FILE := /persist/WCNSS_wlan_dictionary.dat -$(LOCAL_BUILT_MODULE): WCNSS_DAT_SYMLINK := $(TARGET_OUT)/etc/firmware/wlan/prima/WCNSS_wlan_dictionary.dat - -$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/Android.mk -$(LOCAL_BUILT_MODULE): - $(hide) echo "Making symlinks for wifi" - $(hide) mkdir -p $(dir $@) - $(hide) mkdir -p $(dir $(WCNSS_INI_SYMLINK)) - $(hide) rm -rf $@ - $(hide) rm -rf $(WCNSS_INI_SYMLINK) - $(hide) ln -sf $(ACTUAL_INI_FILE) $(WCNSS_INI_SYMLINK) - $(hide) rm -rf $(WCNSS_BIN_SYMLINK) - $(hide) ln -sf $(ACTUAL_BIN_FILE) $(WCNSS_BIN_SYMLINK) - $(hide) rm -rf $(WCNSS_DAT_SYMLINK) - $(hide) ln -sf $(ACTUAL_DAT_FILE) $(WCNSS_DAT_SYMLINK) - $(hide) touch $@ - -IMS_LIBS := libimscamera_jni.so libimsmedia_jni.so -IMS_SYMLINKS := $(addprefix $(TARGET_OUT)/priv-app/ims/lib/arm64/,$(notdir $(IMS_LIBS))) -$(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "IMS lib link: $@" - @mkdir -p $(dir $@) - @rm -rf $@ - $(hide) ln -sf /system/lib64/$(notdir $@) $@ - -ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS) - -GOODIX_IMAGES := \ - goodixfp.b00 goodixfp.b01 goodixfp.b02 goodixfp.b03 \ - goodixfp.b04 goodixfp.b05 goodixfp.b06 goodixfp.mdt - -GOODIX_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(GOODIX_IMAGES))) -$(GOODIX_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "Goodix firmware link: $@" - @mkdir -p $(dir $@) - @rm -rf $@ - $(hide) ln -sf /firmware/image/$(notdir $@) $@ - -ALL_DEFAULT_INSTALLED_MODULES += $(GOODIX_SYMLINKS) - -FPC_IMAGES := \ - fpcta.b00 fpcta.b01 fpcta.b02 fpcta.b03 \ - fpcta.b04 fpcta.b05 fpcta.b06 fpcta.mdt - -FPC_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(FPC_IMAGES))) -$(FPC_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "Fpc firmware link: $@" - @mkdir -p $(dir $@) - @rm -rf $@ - $(hide) ln -sf /firmware/image/$(notdir $@) $@ - -ALL_DEFAULT_INSTALLED_MODULES += $(FPC_SYMLINKS) - -RFS_MSM_ADSP_SYMLINKS := $(TARGET_OUT)/rfs/msm/adsp/ -$(RFS_MSM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "Creating RFS MSM ADSP folder structure: $@" - @rm -rf $@/* - @mkdir -p $(dir $@)/readonly - $(hide) ln -sf /data/tombstones/lpass $@/ramdumps - $(hide) ln -sf /persist/rfs/msm/adsp $@/readwrite - $(hide) ln -sf /persist/rfs/shared $@/shared - $(hide) ln -sf /persist/hlos_rfs/shared $@/hlos - $(hide) ln -sf /firmware $@/readonly/firmware - -RFS_MSM_MPSS_SYMLINKS := $(TARGET_OUT)/rfs/msm/mpss/ -$(RFS_MSM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) - @echo "Creating RFS MSM MPSS folder structure: $@" - @rm -rf $@/* - @mkdir -p $(dir $@)/readonly - $(hide) ln -sf /data/tombstones/modem $@/ramdumps - $(hide) ln -sf /persist/rfs/msm/mpss $@/readwrite - $(hide) ln -sf /persist/rfs/shared $@/shared - $(hide) ln -sf /persist/hlos_rfs/shared $@/hlos - $(hide) ln -sf /firmware $@/readonly/firmware - -ALL_DEFAULT_INSTALLED_MODULES += $(RFS_MSM_ADSP_SYMLINKS) $(RFS_MSM_MPSS_SYMLINKS) - endif diff --git a/BoardConfig.mk b/BoardConfig.mk index acc89d0..e5bd9e1 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -1,5 +1,6 @@ # # Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-18 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +15,9 @@ # limitations under the License. # +# inherit from common msm8937-common +-include device/xiaomi/msm8937-common/BoardConfigCommon.mk + DEVICE_PATH := device/xiaomi/land # Inherit device-specific board fragments diff --git a/android_filesystem_config.h b/android_filesystem_config.h deleted file mode 100644 index 8bb29d8..0000000 --- a/android_filesystem_config.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -# Copyright (c) 2016, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of The Linux Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - - -#define NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS -static const struct fs_path_config android_device_files[] = { - // { 00755, AID_UID, AID_GID, (1ULL << CAPABILITY), "PATH_TO_BINARY" }, - { 00755, AID_BLUETOOTH, AID_BLUETOOTH, (1ULL << CAP_BLOCK_SUSPEND), "system/bin/wcnss_filter" }, - { 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE), "system/bin/cnss-daemon"}, - { 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE), "system/bin/pm-service"}, - { 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE), "system/bin/imsdatadaemon" }, - { 00755, AID_SYSTEM, AID_RADIO, (1ULL << CAP_NET_BIND_SERVICE), "system/bin/ims_rtp_daemon" }, -#ifdef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS - { 00000, AID_ROOT, AID_ROOT, 0, "system/etc/fs_config_dirs" }, -#endif -}; diff --git a/audio/aanc_tuning_mixer.txt b/audio/aanc_tuning_mixer.txt deleted file mode 100644 index 0e3bf30..0000000 --- a/audio/aanc_tuning_mixer.txt +++ /dev/null @@ -1,144 +0,0 @@ -#ANC_TEST_P_PATH_MIC_STEREO Capture -acdb_dev_id:85 -!Capture -Txdevice:0 - -enable -TX7 HPF Switch:0 -TX8 HPF Switch:0 -AIF1_CAP Mixer SLIM TX7:1 -AIF1_CAP Mixer SLIM TX8:1 -SLIM TX7 MUX:DEC9 -DEC9 MUX:DMIC4 -SLIM TX8 MUX:DEC10 -DEC10 MUX:DMIC3 -SLIM_0_TX Channels:Two -MultiMedia1 Mixer SLIM_0_TX:1 - -disable -MultiMedia1 Mixer SLIM_0_TX:0 -AIF1_CAP Mixer SLIM TX7:0 -AIF1_CAP Mixer SLIM TX8:0 -SLIM TX7 MUX:ZERO -SLIM TX8 MUX:ZERO -DEC10 MUX:ZERO -DEC9 MUX:ZERO -TX7 HPF Switch:0 -TX8 HPF Switch:0 - -#ANC_TEST_S_PATH_MIC_STEREO Capture -acdb_dev_id:88 -!Capture -Txdevice:0 - -enable -TX7 HPF Switch:0 -TX8 HPF Switch:0 -AIF1_CAP Mixer SLIM TX7:1 -AIF1_CAP Mixer SLIM TX8:1 -SLIM TX7 MUX:DEC8 -DEC7 MUX:ANC2_FB -ANC2 MUX:DMIC3 -SLIM TX8 MUX:DEC7 -DEC8 MUX:ANC1_FB -ANC1 MUX:DMIC3 -ANC1 FB MUX:EAR_HPH_L -SLIM_0_TX Channels:Two -MultiMedia1 Mixer SLIM_0_TX:1 - -disable -MultiMedia1 Mixer SLIM_0_TX:0 -AIF1_CAP Mixer SLIM TX7:0 -AIF1_CAP Mixer SLIM TX8:0 -SLIM TX7 MUX:ZERO -SLIM TX8 MUX:ZERO -DEC7 MUX:ZERO -ANC2 MUX:ZERO -ANC1 MUX:ZERO -DEC8 MUX:ZERO -ANC1 FB MUX:ZERO -TX7 HPF Switch:0 -TX8 HPF Switch:0 - -#ANC_TEST_E_PATH_MIC_STEREO Capture -acdb_dev_id:91 -!Capture -Txdevice:0 - -enable -TX7 HPF Switch:0 -TX8 HPF Switch:0 -AIF1_CAP Mixer SLIM TX7:1 -AIF1_CAP Mixer SLIM TX8:1 -SLIM TX7 MUX:DEC8 -DEC7 MUX:ANC2_FB -ANC2 MUX:DMIC4 -ANC1 MUX:DMIC4 -SLIM TX8 MUX:DEC7 -DEC8 MUX:ANC1_FB -ANC1 FB MUX:EAR_HPH_L -SLIM_0_TX Channels:Two -MultiMedia1 Mixer SLIM_0_TX:1 - -disable -MultiMedia1 Mixer SLIM_0_TX:0 -AIF1_CAP Mixer SLIM TX7:0 -AIF1_CAP Mixer SLIM TX8:0 -SLIM TX7 MUX:ZERO -SLIM TX8 MUX:ZERO -DEC7 MUX:ZERO -ANC2 MUX:ZERO -DEC10 MUX:ZERO -ANC1 FB MUX:ZERO -TX7 HPF Switch:0 -TX8 HPF Switch:0 - -#ANC_TEST_S_PATH_HANDSET_SPKR_ANC_MONO -acdb_dev_id:86 -!Playback -Rxdevice:0 - -enable -ANC Function:ON -SLIM RX1 MUX:AIF1_PB -SLIM_0_RX Channels:One -RX1 MIX1 INP1:RX1 -CLASS_H_DSM MUX:DSM_HPHL_RX1 -RX1 Digital Volume:87 -DAC1 Switch:1 -ANC Slot:7 -SLIMBUS_0_RX Audio Mixer MultiMedia1:1 - -disable -SLIMBUS_0_RX Audio Mixer MultiMedia1:0 -ANC Slot:0 -SLIM RX1 MUX:ZERO -RX1 MIX1 INP1:ZERO -RX1 Digital Volume:0 -DAC1 Switch:0 -ANC Function:OFF - -#ANC_TEST_E_PATH_HANDSET_SPKR_ANC_MONO -acdb_dev_id:89 -!Playback -Rxdevice:0 - -enable -ANC Function:ON -SLIM RX1 MUX:AIF1_PB -SLIM_0_RX Channels:One -RX1 MIX1 INP1:RX1 -CLASS_H_DSM MUX:DSM_HPHL_RX1 -RX1 Digital Volume:87 -DAC1 Switch:1 -ANC Slot:8 -SLIMBUS_0_RX Audio Mixer MultiMedia1:1 - -disable -SLIMBUS_0_RX Audio Mixer MultiMedia1:0 -ANC Slot:0 -SLIM RX1 MUX:ZERO -RX1 MIX1 INP1:ZERO -RX1 Digital Volume:0 -DAC1 Switch:0 -ANC Function:OFF diff --git a/audio/audio_effects.conf b/audio/audio_effects.conf deleted file mode 100644 index fc7b61a..0000000 --- a/audio/audio_effects.conf +++ /dev/null @@ -1,412 +0,0 @@ -# List of effect libraries to load. Each library element must contain a "path" element -# giving the full path of the library .so file. -# libraries { -# { -# path -# } -# } -libraries { - bundle { - path /system/lib/soundfx/libbundlewrapper.so - } - reverb { - path /system/lib/soundfx/libreverbwrapper.so - } - qcbassboost { - path /vendor/lib/soundfx/libqcbassboost.so - } - qcvirt { - path /vendor/lib/soundfx/libqcvirt.so - } - qcreverb { - path /vendor/lib/soundfx/libqcreverb.so - } - visualizer_sw { - path /system/lib/soundfx/libvisualizer.so - } - visualizer_hw { - path /system/lib/soundfx/libqcomvisualizer.so - } - downmix { - path /system/lib/soundfx/libdownmix.so - } - loudness_enhancer { - path /system/lib/soundfx/libldnhncr.so - } - proxy { - path /system/lib/soundfx/libeffectproxy.so - } - offload_bundle { - path /system/lib/soundfx/libqcompostprocbundle.so - } - audio_pre_processing { - path /system/lib/soundfx/libqcomvoiceprocessing.so - } - #add dirac effect bug 156518 - loudness_enhancer { - path /system/lib/soundfx/libldnhncr.so - } - volume_listener { - path /system/lib/soundfx/libvolumelistener.so - } - dirac { - path /system/lib/soundfx/libdirac.so - } -} - -# Default pre-processing library. Add to audio_effect.conf "libraries" section if -# audio HAL implements support for default software audio pre-processing effects -# -# pre_processing { -# path /system/lib/soundfx/libaudiopreprocessing.so -# } - -# list of effects to load. Each effect element must contain a "library" and a "uuid" element. -# The value of the "library" element must correspond to the name of one library element in the -# "libraries" element. -# The name of the effect element is indicative, only the value of the "uuid" element -# designates the effect. -# The uuid is the implementation specific UUID as specified by the effect vendor. This is not the -# generic effect type UUID. -# effects { -# { -# library -# uuid -# } -# ... -# } - -effects { - -# additions for the proxy implementation -# Proxy implementation - #effectname { - #library proxy - #uuid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - # SW implemetation of the effect. Added as a node under the proxy to - # indicate this as a sub effect. - #libsw { - #library libSW - #uuid yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy - #} End of SW effect - - # HW implementation of the effect. Added as a node under the proxy to - # indicate this as a sub effect. - #libhw { - #library libHW - #uuid zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz - #}End of HW effect - #} End of effect proxy - - bassboost { - library proxy - uuid 14804144-a5ee-4d24-aa88-0002a5d5c51b - - libsw { - library qcbassboost - uuid 23aca180-44bd-11e2-bcfd-0800200c9a66 - } - - libhw { - library offload_bundle - uuid 2c4a8c24-1581-487f-94f6-0002a5d5c51b - } - } - virtualizer { - library proxy - uuid d3467faa-acc7-4d34-acaf-0002a5d5c51b - - libsw { - library qcvirt - uuid e6c98a16-22a3-11e2-b87b-f23c91aec05e - } - - libhw { - library offload_bundle - uuid 509a4498-561a-4bea-b3b1-0002a5d5c51b - } - } - equalizer { - library proxy - uuid c8e70ecd-48ca-456e-8a4f-0002a5d5c51b - - libsw { - library bundle - uuid ce772f20-847d-11df-bb17-0002a5d5c51b - } - - libhw { - library offload_bundle - uuid a0dac280-401c-11e3-9379-0002a5d5c51b - } - } - volume { - library bundle - uuid 119341a0-8469-11df-81f9-0002a5d5c51b - } - reverb_env_aux { - library proxy - uuid 48404ac9-d202-4ccc-bf84-0002a5d5c51b - - libsw { - library qcreverb - uuid a8c1e5f3-293d-43cd-95ec-d5e26c02e217 - } - - libhw { - library offload_bundle - uuid 79a18026-18fd-4185-8233-0002a5d5c51b - } - } - reverb_env_ins { - library proxy - uuid b707403a-a1c1-4291-9573-0002a5d5c51b - - libsw { - library qcreverb - uuid 791fff8b-8129-4655-83a4-59bc61034c3a - } - - libhw { - library offload_bundle - uuid eb64ea04-973b-43d2-8f5e-0002a5d5c51b - } - } - reverb_pre_aux { - library proxy - uuid 1b78f587-6d1c-422e-8b84-0002a5d5c51b - - libsw { - library qcreverb - uuid 53ef1db5-c0c0-445b-b060-e34d20ebb70a - } - - libhw { - library offload_bundle - uuid 6987be09-b142-4b41-9056-0002a5d5c51b - } - } - reverb_pre_ins { - library proxy - uuid f3e178d2-ebcb-408e-8357-0002a5d5c51b - - libsw { - library qcreverb - uuid b08a0e38-22a5-11e2-b87b-f23c91aec05e - } - - libhw { - library offload_bundle - uuid aa2bebf6-47cf-4613-9bca-0002a5d5c51b - } - } - visualizer { - library proxy - uuid 1d0a1a53-7d5d-48f2-8e71-27fbd10d842c - - libsw { - library visualizer_sw - uuid d069d9e0-8329-11df-9168-0002a5d5c51b - } - - libhw { - library visualizer_hw - uuid 7a8044a0-1a71-11e3-a184-0002a5d5c51b - } - } - downmix { - library downmix - uuid 93f04452-e4fe-41cc-91f9-e475b6d1d69f - } - loudness_enhancer { - library loudness_enhancer - uuid fa415329-2034-4bea-b5dc-5b381c8d1e2c - } - aec { - library audio_pre_processing - uuid 0f8d0d2a-59e5-45fe-b6e4-248c8a799109 - } - ns { - library audio_pre_processing - uuid 1d97bb0b-9e2f-4403-9ae3-58c2554306f8 - } -#bug 156518 add dirac effect - music_helper { - library volume_listener - uuid 08b8b058-0590-11e5-ac71-0025b32654a0 - } - ring_helper { - library volume_listener - uuid 0956df94-0590-11e5-bdbe-0025b32654a0 - } - alarm_helper { - library volume_listener - uuid 09f303e2-0590-11e5-8fdb-0025b32654a0 - } - # voice_helper is called when stream type is voice_call in VoIP usecase - voice_helper { - library volume_listener - uuid 0ace5c08-0590-11e5-ae9e-0025b32654a0 - } - notification_helper { - library volume_listener - uuid 0b776dde-0590-11e5-81ba-0025b32654a0 - } - dirac { - library dirac - uuid e069d9e0-8329-11df-9168-0002a5d5c51b - } -} - -# additional effect from vendor -# UUID generated using version 1 - -output_session_processing { - music { - music_helper { - } - } - ring { - ring_helper { - } - } - alarm { - alarm_helper { - } - } - # stream type voice_call is used for VoIP call - voice_call { - voice_helper { - } - } - notification { - notification_helper { - } - } -} - -# Audio global processor configurations. -# The global processor configuration consists in a list of effects elements. -# The name of the effect element must be the name of one of the effects in -# the "effects" list of the file. -# Each effect element may optionally contain a list of parameters and their -# default value to apply when the pre processor effect is created. -# A parameter is defined by a "param" element and a "value" element. Each of these elements -# consists in one or more elements specifying a type followed by a value. -# The types defined are: "int", "short", "float", "bool" and "string" -# When both "param" and "value" are a single int, a simple form is allowed where just -# the param and value pair is present in the parameter description -# global_processing { -# { -# { -# param { -# int|short|float|bool|string -# [ int|short|float|bool|string ] -# ... -# } -# value { -# int|short|float|bool|string -# [ int|short|float|bool|string ] -# ... -# } -# } -# { } -# ... -# } -# ... -# } -global_processing { - dirac { - bl@lakala { - param { - int 6 - } - value { - string *com.lakala.android - } - } - bl@jawboneup { - param { - int 6 - } - value { - string *com.jawbone.up - } - } - bl@hojyremote { - param { - int 6 - } - value { - string *com.hojy.hremote - } - } - } - } -# Default pre-processing effects. Add to audio_effect.conf "effects" section if -# audio HAL implements support for them. -# -# agc { -# library pre_processing -# uuid aa8130e0-66fc-11e0-bad0-0002a5d5c51b -# } -# aec { -# library pre_processing -# uuid bb392ec0-8d4d-11e0-a896-0002a5d5c51b -# } -# ns { -# library pre_processing -# uuid c06c8400-8e06-11e0-9cb6-0002a5d5c51b -# } - -# Audio preprocessor configurations. -# The pre processor configuration consists in a list of elements each describing -# pre processor settings for a given input source. Valid input source names are: -# "mic", "camcorder", "voice_recognition", "voice_communication" -# Each input source element contains a list of effects elements. The name of the effect -# element must be the name of one of the effects in the "effects" list of the file. -# Each effect element may optionally contain a list of parameters and their -# default value to apply when the pre processor effect is created. -# A parameter is defined by a "param" element and a "value" element. Each of these elements -# consists in one or more elements specifying a type followed by a value. -# The types defined are: "int", "short", "float", "bool" and "string" -# When both "param" and "value" are a single int, a simple form is allowed where just -# the param and value pair is present in the parameter description -# pre_processing { -# { -# { -# { -# param { -# int|short|float|bool|string -# [ int|short|float|bool|string ] -# ... -# } -# value { -# int|short|float|bool|string -# [ int|short|float|bool|string ] -# ... -# } -# } -# { } -# ... -# } -# ... -# } -# ... -# } - -# Added aec, ns effects for voice_commuincation, which are supported by the board - -pre_processing { - voice_communication { - aec { - } - ns { - } - } -} - -# -# TODO: add default audio pre processor configurations after debug and tuning phase -# diff --git a/audio/audio_output_policy.conf b/audio/audio_output_policy.conf deleted file mode 100644 index 3d6b978..0000000 --- a/audio/audio_output_policy.conf +++ /dev/null @@ -1,63 +0,0 @@ -# List of profiles for the output device session where stream is routed. -# A stream opened with the inputs attributes which match the "flags" and -# "formats" as specified in the profile is routed to a device at -# sample rate specified under "sampling_rates" and bit width under -# "bit_width" and the topology extracted from the acdb data against -# the "app_type". -# -# the flags and formats are specified using the strings corresponding to -# enums in audio.h and audio_policy.h. They are concatenated with "|" -# without space or "\n". -# the flags and formats should match the ones in "audio_policy.conf" - -outputs { - default { - flags AUDIO_OUTPUT_FLAG_PRIMARY - formats AUDIO_FORMAT_PCM_16_BIT - sampling_rates 48000 - bit_width 16 - app_type 69937 - } - deep_buffer { - flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER - formats AUDIO_FORMAT_PCM_16_BIT - sampling_rates 48000 - bit_width 16 - app_type 69936 - } - direct { - flags AUDIO_OUTPUT_FLAG_DIRECT - formats AUDIO_FORMAT_PCM_16_BIT - sampling_rates 48000 - bit_width 16 - app_type 69936 - } - direct_pcm_16 { - flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_DIRECT_PCM - formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT - sampling_rates 44100|48000|96000|192000 - bit_width 16 - app_type 69936 - } - direct_pcm_24 { - flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_DIRECT_PCM - formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT - sampling_rates 44100|48000|96000|192000 - bit_width 24 - app_type 69940 - } - compress_offload_16 { - flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING - formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_AC3|AUDIO_FORMAT_E_AC3|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2 - sampling_rates 44100|48000|96000|192000 - bit_width 16 - app_type 69936 - } - compress_offload_24 { - flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING - formats AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_VORBIS - sampling_rates 44100|48000|96000|192000 - bit_width 24 - app_type 69940 - } -} diff --git a/audio/audio_policy.conf b/audio/audio_policy.conf deleted file mode 100644 index b7b858e..0000000 --- a/audio/audio_policy.conf +++ /dev/null @@ -1,173 +0,0 @@ -# Global configuration section: -# - lists input and output devices always present on the device -# as well as the output device selected by default. -# Devices are designated by a string that corresponds to the enum in audio.h -# - defines whether the speaker output path uses DRC -# "TRUE" means DRC is enabled, "FALSE" or omission means DRC isn't used. -global_configuration { - attached_output_devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_TELEPHONY_TX - default_output_device AUDIO_DEVICE_OUT_SPEAKER - attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_FM_TUNER|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_TELEPHONY_RX - - speaker_drc_enabled TRUE -} - -# audio hardware module section: contains descriptors for all audio hw modules present on the -# device. Each hw module node is named after the corresponding hw module library base name. -# For instance, "primary" corresponds to audio.primary..so. -# The "primary" module is mandatory and must include at least one output with -# AUDIO_OUTPUT_FLAG_PRIMARY flag. -# Each module descriptor contains one or more output profile descriptors and zero or more -# input profile descriptors. Each profile lists all the parameters supported by a given output -# or input stream category. -# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding -# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n". - -audio_hw_modules { - primary { - outputs { - primary { - sampling_rates 44100|48000 - channel_masks AUDIO_CHANNEL_OUT_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_FM - flags AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST - } - raw { - sampling_rates 48000 - channel_masks AUDIO_CHANNEL_OUT_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY - flags AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_RAW - } - deep_buffer { - sampling_rates 44100|48000 - channel_masks AUDIO_CHANNEL_OUT_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY - flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER - } - multichannel { - sampling_rates 44100|48000 - channel_masks dynamic - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY - flags AUDIO_OUTPUT_FLAG_DIRECT - } - direct_pcm { - sampling_rates 8000|11025|16000|22050|32000|44100|48000|64000|88200|96000|176400|192000 - channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_2POINT1|AUDIO_CHANNEL_OUT_QUAD|AUDIO_CHANNEL_OUT_PENTA|AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_6POINT1|AUDIO_CHANNEL_OUT_7POINT1 - formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT - devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_AUX_DIGITAL - flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_DIRECT_PCM - } - compress_offload { - sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000|64000|88200|96000|176400|192000 - channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_2POINT1|AUDIO_CHANNEL_OUT_QUAD|AUDIO_CHANNEL_OUT_PENTA|AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_6POINT1|AUDIO_CHANNEL_OUT_7POINT1 - formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_AC3|AUDIO_FORMAT_E_AC3|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2 - devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY - flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING - } - incall_music { - sampling_rates 8000|16000|48000 - channel_masks AUDIO_CHANNEL_OUT_MONO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO - flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_INCALL_MUSIC - } - voice_tx { - sampling_rates 8000|16000|48000 - channel_masks AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_TELEPHONY_TX - } - voip_rx { - sampling_rates 8000|16000 - channel_masks AUDIO_CHANNEL_OUT_MONO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_LINE|AUDIO_DEVICE_OUT_ALL_SCO - flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX - } - } - inputs { - primary { - sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000 - channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_FRONT_BACK - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_FM_TUNER|AUDIO_DEVICE_IN_VOICE_CALL - } - surround_sound { - sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000 - channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_FRONT_BACK|AUDIO_CHANNEL_INDEX_MASK_3|AUDIO_CHANNEL_INDEX_MASK_4|AUDIO_CHANNEL_IN_5POINT1 - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC - } - voice_rx { - sampling_rates 8000|16000|48000 - channel_masks AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_MONO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_IN_TELEPHONY_RX - } - } - } - a2dp { - outputs { - a2dp { - sampling_rates 44100 - channel_masks AUDIO_CHANNEL_OUT_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_ALL_A2DP - } - } - inputs { - a2dp { - sampling_rates 44100|48000 - channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP - } - } - } - usb { - outputs { - usb_accessory { - sampling_rates 44100 - channel_masks AUDIO_CHANNEL_OUT_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_USB_ACCESSORY - } - usb_device { - sampling_rates dynamic - channel_masks dynamic - formats dynamic - devices AUDIO_DEVICE_OUT_USB_DEVICE - } - } - inputs { - usb_device { - sampling_rates dynamic - channel_masks AUDIO_CHANNEL_IN_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_IN_USB_DEVICE - } - } - } - r_submix { - outputs { - submix { - sampling_rates 48000 - channel_masks AUDIO_CHANNEL_OUT_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX - } - } - inputs { - submix { - sampling_rates 48000 - channel_masks AUDIO_CHANNEL_IN_STEREO - formats AUDIO_FORMAT_PCM_16_BIT - devices AUDIO_DEVICE_IN_REMOTE_SUBMIX - } - } - } -} diff --git a/audio/audio_policy_configuration.xml b/audio/audio_policy_configuration.xml deleted file mode 100644 index 2443d13..0000000 --- a/audio/audio_policy_configuration.xml +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - - - - - - - - - Earpiece - Speaker - Telephony Tx - Built-In Mic - Built-In Back Mic - FM Tuner - Telephony Rx - - Speaker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/audio/mixer_paths_qrd_sku1.xml b/audio/mixer_paths_qrd_sku1.xml deleted file mode 100644 index 9824aec..0000000 --- a/audio/mixer_paths_qrd_sku1.xml +++ /dev/null @@ -1,1205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/audio/sound_trigger_mixer_paths.xml b/audio/sound_trigger_mixer_paths.xml deleted file mode 100644 index bbec875..0000000 --- a/audio/sound_trigger_mixer_paths.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/audio/sound_trigger_platform_info.xml b/audio/sound_trigger_platform_info.xml deleted file mode 100644 index fa12ef5..0000000 --- a/audio/sound_trigger_platform_info.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h deleted file mode 100644 index 9e2f232..0000000 --- a/bluetooth/bdroid_buildcfg.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) 2012 The Android Open Source Project - * Copyright (C) 2016 The CyanogenMod Project - * - * 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. - */ - -#ifndef _BDROID_BUILDCFG_H -#define _BDROID_BUILDCFG_H - -#define BTA_SKIP_BLE_READ_REMOTE_FEAT FALSE -#define MAX_ACL_CONNECTIONS 7 -#define MAX_L2CAP_CHANNELS 16 -#define BLE_VND_INCLUDED TRUE -#define BTA_BLE_SKIP_CONN_UPD FALSE -#define BLE_PERIPHERAL_ADV_NAME FALSE -#define BT_CLEAN_TURN_ON_DISABLED 1 -#define BTA_DISABLE_DELAY 1000 -#define BTM_WBS_INCLUDED TRUE -#define BTIF_HF_WBS_PREFERRED TRUE -#endif diff --git a/board/00-qcom-platform-msm8937.mk b/board/00-qcom-platform-msm8937.mk deleted file mode 100644 index ea986f1..0000000 --- a/board/00-qcom-platform-msm8937.mk +++ /dev/null @@ -1,24 +0,0 @@ -# Platform -TARGET_BOARD_PLATFORM := msm8937 - -# Architecture -TARGET_ARCH := arm64 -TARGET_ARCH_VARIANT := armv8-a -TARGET_CPU_ABI := arm64-v8a -TARGET_CPU_ABI2 := -TARGET_CPU_VARIANT := generic - -# Second architecture -TARGET_2ND_ARCH := arm -TARGET_2ND_ARCH_VARIANT := armv7-a-neon -TARGET_2ND_CPU_ABI := armeabi-v7a -TARGET_2ND_CPU_ABI2 := armeabi -TARGET_2ND_CPU_VARIANT := cortex-a53 - -TARGET_USES_64_BIT_BINDER := true - -# Qualcomm support -BOARD_USES_QCOM_HARDWARE := true -BOARD_USES_QC_TIME_SERVICES := true -TARGET_POWERHAL_VARIANT := qcom -TARGET_RIL_VARIANT := caf diff --git a/board/ant.mk b/board/ant.mk deleted file mode 100644 index e7535b8..0000000 --- a/board/ant.mk +++ /dev/null @@ -1,2 +0,0 @@ -# ANT -BOARD_ANT_WIRELESS_DEVICE := "vfs-prerelease" diff --git a/board/bluetooth.mk b/board/bluetooth.mk deleted file mode 100644 index 5290060..0000000 --- a/board/bluetooth.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Bluetooth -BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth -BOARD_HAVE_BLUETOOTH_QCOM := true diff --git a/board/bootloader.mk b/board/bootloader.mk deleted file mode 100644 index 54bd5e1..0000000 --- a/board/bootloader.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Bootloader -TARGET_BOOTLOADER_BOARD_NAME := MSM8937 -TARGET_NO_BOOTLOADER := true diff --git a/board/charger.mk b/board/charger.mk deleted file mode 100644 index a70804e..0000000 --- a/board/charger.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Charger -BOARD_CHARGER_DISABLE_INIT_BLANK := true -BOARD_CHARGER_ENABLE_SUSPEND := true diff --git a/board/cne.mk b/board/cne.mk deleted file mode 100644 index c0bb43c..0000000 --- a/board/cne.mk +++ /dev/null @@ -1,2 +0,0 @@ -# CNE / DPM -BOARD_USES_QCNE := true diff --git a/board/crypto.mk b/board/crypto.mk deleted file mode 100644 index 31c9e69..0000000 --- a/board/crypto.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Encryption -TARGET_HW_DISK_ENCRYPTION := true diff --git a/board/display.mk b/board/display.mk deleted file mode 100644 index 9eba43e..0000000 --- a/board/display.mk +++ /dev/null @@ -1,6 +0,0 @@ -# Bootanimation -TARGET_BOOTANIMATION_HALF_RES := true - -TARGET_USES_C2D_COMPOSITION := true -TARGET_USES_ION := true -USE_OPENGL_RENDERER := true diff --git a/board/filesystem.mk b/board/filesystem.mk deleted file mode 100644 index c963c4a..0000000 --- a/board/filesystem.mk +++ /dev/null @@ -1,11 +0,0 @@ -# Partitions -BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 -BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456 -BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864 -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472 -BOARD_USERDATAIMAGE_PARTITION_SIZE := 26301931008 - -BOARD_FLASH_BLOCK_SIZE := 131072 - -TARGET_USERIMAGES_USE_F2FS := true -TARGET_USERIMAGES_USE_EXT4 := true diff --git a/board/fm.mk b/board/fm.mk deleted file mode 100644 index 9a324ee..0000000 --- a/board/fm.mk +++ /dev/null @@ -1,4 +0,0 @@ -# FM -AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true -BOARD_HAVE_QCOM_FM := true -TARGET_QCOM_NO_FM_FIRMWARE := true diff --git a/board/gps.mk b/board/gps.mk deleted file mode 100644 index ef67844..0000000 --- a/board/gps.mk +++ /dev/null @@ -1,3 +0,0 @@ -# GPS -USE_DEVICE_SPECIFIC_GPS := true -TARGET_NO_RPC := true diff --git a/board/hardware.mk b/board/hardware.mk deleted file mode 100644 index a525d3e..0000000 --- a/board/hardware.mk +++ /dev/null @@ -1,5 +0,0 @@ -# CM Hardware -BOARD_USES_CYANOGEN_HARDWARE := true -BOARD_HARDWARE_CLASS += \ - hardware/cyanogen/cmhw \ - device/xiaomi/land/cmhw diff --git a/board/init.mk b/board/init.mk new file mode 100644 index 0000000..32ac697 --- /dev/null +++ b/board/init.mk @@ -0,0 +1,2 @@ +# Libinit +TARGET_LIBINIT_MSM8937_DEFINES_FILE := $(DEVICE_PATH)/libinit/init_land.cpp diff --git a/board/kernel.mk b/board/kernel.mk index 06261ef..2111571 100644 --- a/board/kernel.mk +++ b/board/kernel.mk @@ -1,12 +1,2 @@ -# CPUsets -ENABLE_CPUSETS := true - -# kernel -BOARD_KERNEL_BASE := 0x80000000 -BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_hsl_uart,0x78B0000 -BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb -BOARD_KERNEL_PAGESIZE := 2048 -BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100 +# Kernel TARGET_KERNEL_CONFIG := lineageos_land_defconfig -TARGET_KERNEL_SOURCE := kernel/xiaomi/msm8937 -TARGET_USE_SDCLANG := true diff --git a/board/malloc.mk b/board/malloc.mk deleted file mode 100644 index 73e1a34..0000000 --- a/board/malloc.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Malloc -MALLOC_SVELTE := true diff --git a/board/per-mgr.mk b/board/per-mgr.mk deleted file mode 100644 index 89ccf05..0000000 --- a/board/per-mgr.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Peripheral manager -TARGET_PER_MGR_ENABLED := true diff --git a/board/qcom-audio.mk b/board/qcom-audio.mk deleted file mode 100644 index 35f3a7c..0000000 --- a/board/qcom-audio.mk +++ /dev/null @@ -1,39 +0,0 @@ -# Audio -AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true -AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true -AUDIO_FEATURE_ENABLED_ANC_HEADSET := true -AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true -AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true -AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true -AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true -AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true -AUDIO_FEATURE_ENABLED_DEV_ARBI := true -AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true -AUDIO_FEATURE_ENABLED_EXT_HDMI := true -AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true -AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true -AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true -AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true -AUDIO_FEATURE_ENABLED_FLUENCE := true -AUDIO_FEATURE_ENABLED_HFP := true -AUDIO_FEATURE_ENABLED_HDMI_EDID := true -AUDIO_FEATURE_ENABLED_HIFI_AUDIO := true -AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true -AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true -AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true -AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true -AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true -AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true -AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true -AUDIO_FEATURE_ENABLED_SSR := true -AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true -#AUDIO_FEATURE_ENABLED_VOICE_CONCURRENCY := true -AUDIO_FEATURE_ENABLED_VORBIS_OFFLOAD := true -AUDIO_FEATURE_ENABLED_WMA_OFFLOAD := true -AUDIO_FEATURE_ENABLED_EXT_AMPLIFIER := false - -AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true -BOARD_SUPPORTS_SOUND_TRIGGER := true -BOARD_USES_ALSA_AUDIO := true -USE_CUSTOM_AUDIO_POLICY := 1 -USE_XML_AUDIO_POLICY_CONF := 1 diff --git a/board/qcom-bluetooth.mk b/board/qcom-bluetooth.mk deleted file mode 100644 index cf0c994..0000000 --- a/board/qcom-bluetooth.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Bluetooth -BLUETOOTH_HCI_USE_MCT := true -QCOM_BT_USE_SMD_TTY := true diff --git a/board/camera.mk b/board/qcom-camera.mk similarity index 100% rename from board/camera.mk rename to board/qcom-camera.mk diff --git a/board/qcom-display.mk b/board/qcom-display.mk deleted file mode 100644 index 0b84049..0000000 --- a/board/qcom-display.mk +++ /dev/null @@ -1,6 +0,0 @@ -MAX_EGL_CACHE_KEY_SIZE := 12*1024 -MAX_EGL_CACHE_SIZE := 2048*1024 - -NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 - -OVERRIDE_RS_DRIVER := libRSDriver_adreno.so diff --git a/board/qcom-init.mk b/board/qcom-init.mk deleted file mode 100644 index e79d121..0000000 --- a/board/qcom-init.mk +++ /dev/null @@ -1,4 +0,0 @@ -# Init -TARGET_INIT_VENDOR_LIB := libinit_land -TARGET_PLATFORM_DEVICE_BASE := /devices/soc/ -TARGET_RECOVERY_DEVICE_MODULES := libinit_land diff --git a/board/qcom-keymaster.mk b/board/qcom-keymaster.mk deleted file mode 100644 index c5c23d0..0000000 --- a/board/qcom-keymaster.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Keystore -TARGET_PROVIDES_KEYMASTER := true diff --git a/board/qcom-media.mk b/board/qcom-media.mk deleted file mode 100644 index 8b5e002..0000000 --- a/board/qcom-media.mk +++ /dev/null @@ -1 +0,0 @@ -TARGET_USES_MEDIA_EXTENSIONS := true diff --git a/board/qcom-wlan.mk b/board/qcom-wlan.mk deleted file mode 100644 index fa890ae..0000000 --- a/board/qcom-wlan.mk +++ /dev/null @@ -1,16 +0,0 @@ -# Wi-Fi -BOARD_HAS_QCOM_WLAN := true -BOARD_HAS_QCOM_WLAN_SDK := true - -BOARD_HOSTAPD_DRIVER := NL80211 -BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_qcwcn - -BOARD_WLAN_DEVICE := qcwcn - -BOARD_WPA_SUPPLICANT_DRIVER := NL80211 -BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_qcwcn - -WIFI_DRIVER_FW_PATH_AP := "ap" -WIFI_DRIVER_FW_PATH_STA := "sta" - -WPA_SUPPLICANT_VERSION := VER_0_8_X diff --git a/board/recovery.mk b/board/recovery.mk deleted file mode 100644 index b165cbb..0000000 --- a/board/recovery.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Recovery -TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/fstab.qcom diff --git a/board/sensors.mk b/board/sensors.mk deleted file mode 100644 index 3105d25..0000000 --- a/board/sensors.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Sensors -USE_SENSOR_MULTI_HAL := true diff --git a/board/sepolicy.mk b/board/sepolicy.mk deleted file mode 100644 index 225ecd5..0000000 --- a/board/sepolicy.mk +++ /dev/null @@ -1,5 +0,0 @@ -# SELinux -BOARD_SEPOLICY_DIRS += \ - $(DEVICE_PATH)/sepolicy - -include device/qcom/sepolicy/sepolicy.mk diff --git a/cmhw/org/cyanogenmod/hardware/KeyDisabler.java b/cmhw/org/cyanogenmod/hardware/KeyDisabler.java deleted file mode 100644 index 1984284..0000000 --- a/cmhw/org/cyanogenmod/hardware/KeyDisabler.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2017 The LineageOS Project - * - * 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. - */ - -package org.cyanogenmod.hardware; - -import org.cyanogenmod.internal.util.FileUtils; - -/* - * Disable capacitive keys - * - * This is intended for use on devices in which the capacitive keys - * can be fully disabled for replacement with a soft navbar. You - * really should not be using this on a device with mechanical or - * otherwise visible-when-inactive keys - */ - -public class KeyDisabler { - - private static String CONTROL_PATH = "/proc/touchpanel/capacitive_keys_enable"; - - public static boolean isSupported() { - return FileUtils.isFileWritable(CONTROL_PATH); - } - - public static boolean isActive() { - return FileUtils.readOneLine(CONTROL_PATH).equals("0"); - } - - public static boolean setActive(boolean state) { - return FileUtils.writeLine(CONTROL_PATH, (state ? "1" : "0")); - } - -} diff --git a/cmhw/org/cyanogenmod/hardware/VibratorHW.java b/cmhw/org/cyanogenmod/hardware/VibratorHW.java deleted file mode 100644 index 22d69c9..0000000 --- a/cmhw/org/cyanogenmod/hardware/VibratorHW.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2016 The CyanogenMod Project - * - * 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. - */ - -package org.cyanogenmod.hardware; - -import org.cyanogenmod.internal.util.FileUtils; - -public class VibratorHW { - private static String LEVEL_PATH = "/sys/class/timed_output/vibrator/vtg_level"; - private static String MAX_PATH = "/sys/class/timed_output/vibrator/vtg_max"; - private static String MIN_PATH = "/sys/class/timed_output/vibrator/vtg_min"; - - public static boolean isSupported() { - return FileUtils.isFileReadable(LEVEL_PATH) && - FileUtils.isFileWritable(LEVEL_PATH); - } - - public static int getMaxIntensity() { - return Integer.parseInt(FileUtils.readOneLine(MAX_PATH)); - } - - public static int getMinIntensity() { - return Integer.parseInt(FileUtils.readOneLine(MIN_PATH)); - } - - public static int getWarningThreshold() { - return -1; - } - - public static int getCurIntensity() { - return Integer.parseInt(FileUtils.readOneLine(LEVEL_PATH)); - } - - public static int getDefaultIntensity() { - return getMaxIntensity(); - } - - public static boolean setIntensity(int intensity) { - return FileUtils.writeLine(LEVEL_PATH, String.valueOf(intensity)); - } -} diff --git a/configs/media_codecs.xml b/configs/media_codecs.xml deleted file mode 100644 index 05af408..0000000 --- a/configs/media_codecs.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/configs/media_codecs_performance.xml b/configs/media_codecs_performance.xml deleted file mode 100644 index cb6de53..0000000 --- a/configs/media_codecs_performance.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/configs/media_profiles.xml b/configs/media_profiles.xml deleted file mode 100644 index 6087945..0000000 --- a/configs/media_profiles.xml +++ /dev/null @@ -1,698 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/configs/msm_irqbalance.conf b/configs/msm_irqbalance.conf deleted file mode 100644 index 5afc484..0000000 --- a/configs/msm_irqbalance.conf +++ /dev/null @@ -1,2 +0,0 @@ -PRIO=0,0,0,0,1,1,1,1 -IGNORED_IRQ=20,39 diff --git a/configs/sec_config b/configs/sec_config deleted file mode 100644 index 6ab6b93..0000000 --- a/configs/sec_config +++ /dev/null @@ -1,319 +0,0 @@ -/* IPC Security Config */ -/* :: */ -16:4294967295:1000:1021 -/* :: */ -56:4294967295:1021 -/* Allow SS CTL service to be used by system and net_raw processes */ -43:4294967295:1000:3004 -/* :: */ -71:4294967295:1001 -/* :: */ -50:4294967295:1001 -/* QMI-SLIM service permitted to gps and net_raw */ -55:4294967295:1021 -/* Allow Sensor services to be used by sensor process */ -256:4294967295:1000:1006:1013:1021:1047:3011 -257:4294967295:1000:1006:1013:1021:1047:3011 -258:4294967295:1000:1006:1013:1021:1047:3011 -259:4294967295:1000:1006:1013:1021:1047:3011 -260:4294967295:1000:1006:1013:1021:1047:3011 -261:4294967295:1000:1006:1013:1021:1047:3011 -262:4294967295:1000:1006:1013:1021:1047:3011 -263:4294967295:1000:1006:1013:1021:1047:3011 -264:4294967295:1000:1006:1013:1021:1047:3011 -265:4294967295:1000:1006:1013:1021:1047:3011 -266:4294967295:1000:1006:1013:1021:1047:3011 -267:4294967295:1000:1006:1013:1021:1047:3011 -268:4294967295:1000:1006:1013:1021:1047:3011 -269:4294967295:1000:1006:1013:1021:1047:3011 -270:4294967295:1000:1006:1013:1021:1047:3011 -271:4294967295:1000:1006:1013:1021:1047:3011 -272:4294967295:1000:1006:1013:1021:1047:3011 -273:4294967295:1000:1006:1013:1021:1047:3011 -274:4294967295:1000:1006:1013:1021:1047:3011 -275:4294967295:1000:1006:1013:1021:1047:3011 -276:4294967295:1000:1006:1013:1021:1047:3011 -277:4294967295:1000:1006:1013:1021:1047:3011 -278:4294967295:1000:1006:1013:1021:1047:3011 -279:4294967295:1000:1006:1013:1021:1047:3011 -280:4294967295:1000:1006:1013:1021:1047:3011 -281:4294967295:1000:1006:1013:1021:1047:3011 -282:4294967295:1000:1006:1013:1021:1047:3011 -283:4294967295:1000:1006:1013:1021:1047:3011 -284:4294967295:1000:1006:1013:1021:1047:3011 -285:4294967295:1000:1006:1013:1021:1047:3011 -286:4294967295:1000:1006:1013:1021:1047:3011 -287:4294967295:1000:1006:1013:1021:1047:3011 -288:4294967295:1000:1006:1013:1021:1047:3011 -289:4294967295:1000:1006:1013:1021:1047:3011 -290:4294967295:1000:1006:1013:1021:1047:3011 -291:4294967295:1000:1006:1013:1021:1047:3011 -292:4294967295:1000:1006:1013:1021:1047:3011 -293:4294967295:1000:1006:1013:1021:1047:3011 -294:4294967295:1000:1006:1013:1021:1047:3011 -295:4294967295:1000:1006:1013:1021:1047:3011 -296:4294967295:1000:1006:1013:1021:1047:3011 -297:4294967295:1000:1006:1013:1021:1047:3011 -298:4294967295:1000:1006:1013:1021:1047:3011 -299:4294967295:1000:1006:1013:1021:1047:3011 -300:4294967295:1000:1006:1013:1021:1047:3011 -301:4294967295:1000:1006:1013:1021:1047:3011 -302:4294967295:1000:1006:1013:1021:1047:3011 -303:4294967295:1000:1006:1013:1021:1047:3011 -304:4294967295:1000:1006:1013:1021:1047:3011 -305:4294967295:1000:1006:1013:1021:1047:3011 -306:4294967295:1000:1006:1013:1021:1047:3011 -307:4294967295:1000:1006:1013:1021:1047:3011 -308:4294967295:1000:1006:1013:1021:1047:3011 -309:4294967295:1000:1006:1013:1021:1047:3011 -310:4294967295:1000:1006:1013:1021:1047:3011 -311:4294967295:1000:1006:1013:1021:1047:3011 -312:4294967295:1000:1006:1013:1021:1047:3011 -313:4294967295:1000:1006:1013:1021:1047:3011 -314:4294967295:1000:1006:1013:1021:1047:3011 -315:4294967295:1000:1006:1013:1021:1047:3011 -316:4294967295:1000:1006:1013:1021:1047:3011 -317:4294967295:1000:1006:1013:1021:1047:3011 -318:4294967295:1000:1006:1013:1021:1047:3011 -319:4294967295:1000:1006:1013:1021:1047:3011 -320:4294967295:1000:1006:1013:1021:1047:3011 -321:4294967295:1000:1006:1013:1021:1047:3011 -322:4294967295:1000:1006:1013:1021:1047:3011 -323:4294967295:1000:1006:1013:1021:1047:3011 -324:4294967295:1000:1006:1013:1021:1047:3011 -325:4294967295:1000:1006:1013:1021:1047:3011 -326:4294967295:1000:1006:1013:1021:1047:3011 -327:4294967295:1000:1006:1013:1021:1047:3011 -328:4294967295:1000:1006:1013:1021:1047:3011 -329:4294967295:1000:1006:1013:1021:1047:3011 -330:4294967295:1000:1006:1013:1021:1047:3011 -331:4294967295:1000:1006:1013:1021:1047:3011 -332:4294967295:1000:1006:1013:1021:1047:3011 -333:4294967295:1000:1006:1013:1021:1047:3011 -334:4294967295:1000:1006:1013:1021:1047:3011 -335:4294967295:1000:1006:1013:1021:1047:3011 -336:4294967295:1000:1006:1013:1021:1047:3011 -337:4294967295:1000:1006:1013:1021:1047:3011 -338:4294967295:1000:1006:1013:1021:1047:3011 -339:4294967295:1000:1006:1013:1021:1047:3011 -340:4294967295:1000:1006:1013:1021:1047:3011 -341:4294967295:1000:1006:1013:1021:1047:3011 -342:4294967295:1000:1006:1013:1021:1047:3011 -343:4294967295:1000:1006:1013:1021:1047:3011 -344:4294967295:1000:1006:1013:1021:1047:3011 -345:4294967295:1000:1006:1013:1021:1047:3011 -346:4294967295:1000:1006:1013:1021:1047:3011 -347:4294967295:1000:1006:1013:1021:1047:3011 -348:4294967295:1000:1006:1013:1021:1047:3011 -349:4294967295:1000:1006:1013:1021:1047:3011 -350:4294967295:1000:1006:1013:1021:1047:3011 -351:4294967295:1000:1006:1013:1021:1047:3011 -352:4294967295:1000:1006:1013:1021:1047:3011 -353:4294967295:1000:1006:1013:1021:1047:3011 -354:4294967295:1000:1006:1013:1021:1047:3011 -355:4294967295:1000:1006:1013:1021:1047:3011 -356:4294967295:1000:1006:1013:1021:1047:3011 -357:4294967295:1000:1006:1013:1021:1047:3011 -358:4294967295:1000:1006:1013:1021:1047:3011 -359:4294967295:1000:1006:1013:1021:1047:3011 -360:4294967295:1000:1006:1013:1021:1047:3011 -361:4294967295:1000:1006:1013:1021:1047:3011 -362:4294967295:1000:1006:1013:1021:1047:3011 -363:4294967295:1000:1006:1013:1021:1047:3011 -364:4294967295:1000:1006:1013:1021:1047:3011 -365:4294967295:1000:1006:1013:1021:1047:3011 -366:4294967295:1000:1006:1013:1021:1047:3011 -367:4294967295:1000:1006:1013:1021:1047:3011 -368:4294967295:1000:1006:1013:1021:1047:3011 -369:4294967295:1000:1006:1013:1021:1047:3011 -370:4294967295:1000:1006:1013:1021:1047:3011 -371:4294967295:1000:1006:1013:1021:1047:3011 -372:4294967295:1000:1006:1013:1021:1047:3011 -373:4294967295:1000:1006:1013:1021:1047:3011 -374:4294967295:1000:1006:1013:1021:1047:3011 -375:4294967295:1000:1006:1013:1021:1047:3011 -376:4294967295:1000:1006:1013:1021:1047:3011 -377:4294967295:1000:1006:1013:1021:1047:3011 -378:4294967295:1000:1006:1013:1021:1047:3011 -379:4294967295:1000:1006:1013:1021:1047:3011 -380:4294967295:1000:1006:1013:1021:1047:3011 -381:4294967295:1000:1006:1013:1021:1047:3011 -382:4294967295:1000:1006:1013:1021:1047:3011 -383:4294967295:1000:1006:1013:1021:1047:3011 -384:4294967295:1000:1006:1013:1021:1047:3011 -385:4294967295:1000:1006:1013:1021:1047:3011 -386:4294967295:1000:1006:1013:1021:1047:3011 -387:4294967295:1000:1006:1013:1021:1047:3011 -388:4294967295:1000:1006:1013:1021:1047:3011 -389:4294967295:1000:1006:1013:1021:1047:3011 -390:4294967295:1000:1006:1013:1021:1047:3011 -391:4294967295:1000:1006:1013:1021:1047:3011 -392:4294967295:1000:1006:1013:1021:1047:3011 -393:4294967295:1000:1006:1013:1021:1047:3011 -394:4294967295:1000:1006:1013:1021:1047:3011 -395:4294967295:1000:1006:1013:1021:1047:3011 -396:4294967295:1000:1006:1013:1021:1047:3011 -397:4294967295:1000:1006:1013:1021:1047:3011 -398:4294967295:1000:1006:1013:1021:1047:3011 -399:4294967295:1000:1006:1013:1021:1047:3011 -400:4294967295:1000:1006:1013:1021:1047:3011 -401:4294967295:1000:1006:1013:1021:1047:3011 -402:4294967295:1000:1006:1013:1021:1047:3011 -403:4294967295:1000:1006:1013:1021:1047:3011 -404:4294967295:1000:1006:1013:1021:1047:3011 -405:4294967295:1000:1006:1013:1021:1047:3011 -406:4294967295:1000:1006:1013:1021:1047:3011 -407:4294967295:1000:1006:1013:1021:1047:3011 -408:4294967295:1000:1006:1013:1021:1047:3011 -409:4294967295:1000:1006:1013:1021:1047:3011 -410:4294967295:1000:1006:1013:1021:1047:3011 -411:4294967295:1000:1006:1013:1021:1047:3011 -412:4294967295:1000:1006:1013:1021:1047:3011 -413:4294967295:1000:1006:1013:1021:1047:3011 -414:4294967295:1000:1006:1013:1021:1047:3011 -415:4294967295:1000:1006:1013:1021:1047:3011 -416:4294967295:1000:1006:1013:1021:1047:3011 -417:4294967295:1000:1006:1013:1021:1047:3011 -418:4294967295:1000:1006:1013:1021:1047:3011 -419:4294967295:1000:1006:1013:1021:1047:3011 -420:4294967295:1000:1006:1013:1021:1047:3011 -421:4294967295:1000:1006:1013:1021:1047:3011 -422:4294967295:1000:1006:1013:1021:1047:3011 -423:4294967295:1000:1006:1013:1021:1047:3011 -424:4294967295:1000:1006:1013:1021:1047:3011 -425:4294967295:1000:1006:1013:1021:1047:3011 -426:4294967295:1000:1006:1013:1021:1047:3011 -427:4294967295:1000:1006:1013:1021:1047:3011 -428:4294967295:1000:1006:1013:1021:1047:3011 -429:4294967295:1000:1006:1013:1021:1047:3011 -430:4294967295:1000:1006:1013:1021:1047:3011 -431:4294967295:1000:1006:1013:1021:1047:3011 -432:4294967295:1000:1006:1013:1021:1047:3011 -433:4294967295:1000:1006:1013:1021:1047:3011 -434:4294967295:1000:1006:1013:1021:1047:3011 -435:4294967295:1000:1006:1013:1021:1047:3011 -436:4294967295:1000:1006:1013:1021:1047:3011 -437:4294967295:1000:1006:1013:1021:1047:3011 -438:4294967295:1000:1006:1013:1021:1047:3011 -439:4294967295:1000:1006:1013:1021:1047:3011 -440:4294967295:1000:1006:1013:1021:1047:3011 -441:4294967295:1000:1006:1013:1021:1047:3011 -442:4294967295:1000:1006:1013:1021:1047:3011 -443:4294967295:1000:1006:1013:1021:1047:3011 -444:4294967295:1000:1006:1013:1021:1047:3011 -445:4294967295:1000:1006:1013:1021:1047:3011 -446:4294967295:1000:1006:1013:1021:1047:3011 -447:4294967295:1000:1006:1013:1021:1047:3011 -448:4294967295:1000:1006:1013:1021:1047:3011 -449:4294967295:1000:1006:1013:1021:1047:3011 -450:4294967295:1000:1006:1013:1021:1047:3011 -451:4294967295:1000:1006:1013:1021:1047:3011 -452:4294967295:1000:1006:1013:1021:1047:3011 -453:4294967295:1000:1006:1013:1021:1047:3011 -454:4294967295:1000:1006:1013:1021:1047:3011 -455:4294967295:1000:1006:1013:1021:1047:3011 -456:4294967295:1000:1006:1013:1021:1047:3011 -457:4294967295:1000:1006:1013:1021:1047:3011 -458:4294967295:1000:1006:1013:1021:1047:3011 -459:4294967295:1000:1006:1013:1021:1047:3011 -460:4294967295:1000:1006:1013:1021:1047:3011 -461:4294967295:1000:1006:1013:1021:1047:3011 -462:4294967295:1000:1006:1013:1021:1047:3011 -463:4294967295:1000:1006:1013:1021:1047:3011 -464:4294967295:1000:1006:1013:1021:1047:3011 -465:4294967295:1000:1006:1013:1021:1047:3011 -466:4294967295:1000:1006:1013:1021:1047:3011 -467:4294967295:1000:1006:1013:1021:1047:3011 -468:4294967295:1000:1006:1013:1021:1047:3011 -469:4294967295:1000:1006:1013:1021:1047:3011 -470:4294967295:1000:1006:1013:1021:1047:3011 -471:4294967295:1000:1006:1013:1021:1047:3011 -472:4294967295:1000:1006:1013:1021:1047:3011 -473:4294967295:1000:1006:1013:1021:1047:3011 -474:4294967295:1000:1006:1013:1021:1047:3011 -475:4294967295:1000:1006:1013:1021:1047:3011 -476:4294967295:1000:1006:1013:1021:1047:3011 -477:4294967295:1000:1006:1013:1021:1047:3011 -478:4294967295:1000:1006:1013:1021:1047:3011 -479:4294967295:1000:1006:1013:1021:1047:3011 -480:4294967295:1000:1006:1013:1021:1047:3011 -481:4294967295:1000:1006:1013:1021:1047:3011 -482:4294967295:1000:1006:1013:1021:1047:3011 -483:4294967295:1000:1006:1013:1021:1047:3011 -484:4294967295:1000:1006:1013:1021:1047:3011 -485:4294967295:1000:1006:1013:1021:1047:3011 -486:4294967295:1000:1006:1013:1021:1047:3011 -487:4294967295:1000:1006:1013:1021:1047:3011 -488:4294967295:1000:1006:1013:1021:1047:3011 -489:4294967295:1000:1006:1013:1021:1047:3011 -490:4294967295:1000:1006:1013:1021:1047:3011 -491:4294967295:1000:1006:1013:1021:1047:3011 -492:4294967295:1000:1006:1013:1021:1047:3011 -493:4294967295:1000:1006:1013:1021:1047:3011 -494:4294967295:1000:1006:1013:1021:1047:3011 -495:4294967295:1000:1006:1013:1021:1047:3011 -496:4294967295:1000:1006:1013:1021:1047:3011 -497:4294967295:1000:1006:1013:1021:1047:3011 -498:4294967295:1000:1006:1013:1021:1047:3011 -499:4294967295:1000:1006:1013:1021:1047:3011 -500:4294967295:1000:1006:1013:1021:1047:3011 -501:4294967295:1000:1006:1013:1021:1047:3011 -502:4294967295:1000:1006:1013:1021:1047:3011 -503:4294967295:1000:1006:1013:1021:1047:3011 -504:4294967295:1000:1006:1013:1021:1047:3011 -505:4294967295:1000:1006:1013:1021:1047:3011 -506:4294967295:1000:1006:1013:1021:1047:3011 -507:4294967295:1000:1006:1013:1021:1047:3011 -508:4294967295:1000:1006:1013:1021:1047:3011 -509:4294967295:1000:1006:1013:1021:1047:3011 -510:4294967295:1000:1006:1013:1021:1047:3011 -511:4294967295:1000:1006:1013:1021:1047:3011 -/* Allow RCS service to aquire net_raw permission */ -18:4294967295:1001:3004 -/* Allow QMID service to aquire net_raw permission */ -3:4294967295:1001:3004 -2:4294967295:1000:1001:3004 -42:4294967295:1001:3004 -18:4294967295:1001:3004 -9:4294967295:1001:3004 -1:4294967295:1001:3004:1000 -4:4294967295:1001:3004 -7:4294967295:1001:3004 -8:4294967295:1001:3004:1000 -68:4294967295:1001:3004 -/* DPM */ -47:4294967295:1001:3004 -/* Allow communication to some QMI services with radio privilages */ -/* Format is :: */ -/* PBM */ -12:4294967295:1001 -/* WMS */ -5:4294967295:1001 -/* IMS VT */ -32:4294967295:1001 -/* IMSP */ -31:4294967295:1001 -/* PDC */ -36:4294967295:1001 -/* SAR */ -17:4294967295:1001 -/* RFRPE */ -41:4294967295:1001 -/*UIM*/ -11:4294967295:1001 -/*CAT*/ -10:4294967295:1001 -/*IMSA*/ -33:4294967295:1001 -/* CSVT */ -29:4294967295:1001 -/*LTE*/ -70:4294967295:1001 -/* Allow Data dpmd to access QMI DFS */ -48:4294967295:1000:3004 -/* DIAG */ -4097:4294967295:2002:2950:3009 -/* :: */ -69:4294967295:1000 -/* :: */ -57:4294967295:1000 \ No newline at end of file diff --git a/configs/sensors/hals.conf b/configs/sensors/hals.conf deleted file mode 100644 index 5f3a14b..0000000 --- a/configs/sensors/hals.conf +++ /dev/null @@ -1 +0,0 @@ -sensors.ssc.so diff --git a/configs/sensors/sensor_def_qcomdev.conf b/configs/sensors/sensor_def_qcomdev.conf deleted file mode 100644 index 80dcaee..0000000 --- a/configs/sensors/sensor_def_qcomdev.conf +++ /dev/null @@ -1,351 +0,0 @@ -# -# File: sensor_def_qcomdev.conf -# -# Tihs file contains default sensor registry values for Qualcomm development -# test platforms. -# -# Copyright (c) 2013-2016 Qualcomm Technologies, Inc. -# All Rights Reserved. -# Confidential and Proprietary - Qualcomm Technologies, Inc. - - -# File format: -# -# Lines starting with "#" are comments and ignored. -# -# File metadata uses this format: -# :key value1 value2 -# -# The following keys are defined: -# - "version" : value1 is non-zero positive version number of the file. This -# number will be stored in the sensors registry. It should be equal to the -# largest version of any item. It will be saved in the sensors registry for -# later use when initializing values. See the item format below. -# This value should only be specified once in the file. -# -# - "hardware" : The value1 will be compared to the "Hardware" string from -# the property of ro.board.platform. -# Items will only be used as default values in the registry if the hardware -# string value is a substring of the ro.board.platform string. -# This metadata key can be used more than once, so that one file can support -# more than one type of hardware. -# The value may be NULL, indicating common item values for all hardware. -# Common conf entries for multiple hardware can be mentioned as below. -# configuration below this string is common for 8952,8956 and 8974 -# :hardware 8952 8956 8974 -# hardware list gets overwritten with the new one every time when "hardware" -# tag appears while parsing conf file. -# -# - "platform" : Similar to the "hardware" key, but this string will need to -# match the text of either /sys/devices/soc0/hw_platform or -# /sys/devices/soc0/platform_subtype. -# Common conf entries for multiple platform can be mentioned as below. -# configuration below this string is common for MTP and QRD -# :platfrom MTP QRD -# platform list gets overwritten with the new one every time when "platfrom" -# tag appears while parsing conf file. -# -# -# - "soc_id" : Similar to the "hardware" key, but this string will need to -# match the text of /sys/devices/soc0/soc_id. -# Common conf entries for multiple soc_id can be mentioned as below. -# configuration below this string is common for soc_id 264 and 278 -# :soc_id 264 278 -# soc_id list gets overwritten with the new one every time when "soc_id" -# tag appears while parsing conf file. -# -# - "subtype" : Similar to the "hardware" key, but this string will need to -# match the text of /sys/devices/soc0/platform_subtype. -# Common conf entries for multiple subtype can be mentioned as below. -# configuration below this string is common for subtype X and Y -# :subtype X Y -# subtype list gets overwritten with the new one every time when "subtype" -# tag appears while parsing conf file. -# -# - "sub_id" : Similar to the "hardware" key, but this string will need to -# match the text of /sys/devices/soc0/platform_subtype_id. -# Common conf entries for multiple sub_id can be mentioned as below. -# configuration below this string is common for sub_id -# :sub_id 0 10 -# sub_id list gets overwritten with the new one every time when "sub_id" -# tag appears while parsing conf file. -# -# - "soc_rev" : Similar to the "hardware" key, but this string will need to -# match the text of /sys/devices/soc0/revision. -# Common conf entries for multiple soc_rev can be mentioned as below. -# configuration below this string is common for soc_rev 1.0,2.0 and 3.0 -# :soc_rev 1.0 2.0 3.0 -# soc_rev list gets overwritten with the new one every time when "soc_rev" -# tag appears while parsing conf file. -# -# - "plat_ver" : Similar to the "hardware" key, but this string will need to -# match the text of /sys/devices/soc0/platform_version. -# Common conf entries for multiple plat_ver can be mentioned as below. -# configuration below this string is common for plat_ver 131072 and 1179648 -# :plat_ver 131072 1179648 -# plat_ver list gets overwritten with the new one every time when "plat_ver" -# tag appears while parsing conf file. -# -# - "property" : value1 is the Android system property key, and value2 is -# the desired property value. If the system property value matches the -# desired property value, then the following items will be applied. -# This metadata key can be used more than once, in which case the new -# property value overrides the old. -# value1 and 2 may be NULL, indicating common item values for all properties. -# -# Registry items are in lines with the following format: -# -# Where: -# itemID is the numeric item ID defined in sns_reg_api_v02.h -# -# "value" is the numeric value of the item. -# -# "version" is a non-zero version of the item value. -# The version field will be compared against the previous saved -# value in the sensors registry. If this value is greater than the -# saved value, the default will be applied. Otherwise, the default -# will be skipped. -# -# Registry item values will only be applied if the hardware, platform, and -# property values match for the current hardware configuration. -# -# The numeric fields are parsed with the strtoull function, base 0. -# - -:version 0x00010003 - -####################################################################### -### MSM8940, MSM8937 and MSM8917 Chipsets -####################################################################### -# MSM8940, MSM8937 and MSM8917 share the same property(ro.board.platfrom) as 8937. -# In this configuration, MSM8940, MSM8937 and MSM8917 share same sensor -# configuration because sensors are same in reference design. -# The identification of MSM8940, MSM8937 and MSM8917 can be done by soc_id -# which is unique. -# - : -# MSM8940 - 313 -# MSM8937 - 294 APQ8037 - 295 -# MSM8917 - 303 APQ8017 - 307 MSM8217 - 308 MSM8617 - 309 -# MSM8920 - 320 - -:hardware 8937 -:platform -:property -:soc_id -# Orientation of sensors -# accel x/y/z -700 -1 0x00010003 #accel-x-axis -701 -2 0x00010003 #accel-y-axis -702 3 0x00010003 #accel-z-axis -# gyro x/y/z -800 -1 0x00010003 #gyro-x-axis -801 -2 0x00010003 #gyro-y-axis -802 3 0x00010003 #gyro-z-axis -# mag x/y/z -900 1 0x00010003 #mag-x-axis -901 -2 0x00010003 #mag-y-axis -902 -3 0x00010003 #mag-z-axis -# SSI SMGR Version -1900 1 0x00010003 #Maj Ver -1901 2 0x00010003 #Min Ver - -2000 1 0x00010003 # set to 1 to enable -2001 2 0x00010003 # number of accel sensors - -2100 1 0x00010003 # set to 1 to enable -2101 2 0x00010003 # number of gyro sensors - -2200 1 0x00010003 # set to 1 to enable -2201 2 0x00010003 # number of mag sensors - -2300 1 0x00010003 # set to 1 to enable -2301 3 0x00010003 # number of plsensors - -# SAM config -# -203 65536 0x00010003 # AMD -225 983040 0x00010003 # RMD -504 65536 0x00010003 # Gyro Cal -1703 65536 0x00010003 # Ped -2800 983040 0x00010003 # basic ges -2900 983040 0x00010003 # Facing -3400 65536 0x00010003 # CMC -609 983040 0x00010003 # FMV -1005 983040 0x00010003 # Grav -1103 983040 0x00010003 # orientation -3000 983040 0x00010003 # gyro quat -3100 983040 0x00010003 # rot vec -3500 983040 0x00010003 # game rv -4112 65536 0x00010003 # SMD -4103 5 0x00010001 # SMD_ACC_WIN_TIME - -# SSI SMGR Cfg 0 BMI160 ACCEL -2003 0x0f4d0fd654c7eab5 0x00010003 #UUID -2002 0xd646cb83ec0cd5a5 0x00010003 #UUID -2004 30000 0x00010003 #off_to_idle -2005 5000 0x00010003 #idle_to_ready -2006 42 0x00010003 #gpio1 -2007 1000 0x00010003 #reg_group_id -2008 0 0x00010003 #cal_grp_id -2009 4 0x00010003 #i2c_bus -2010 0x68 0x00010003 #i2c_address -2011 1 0x00010003 #sens_default -2012 0xD0 0x00010003 #flags -2068 0xff 0x00010003 #vdd -2069 0xff 0x00010003 #vddio - -# SSI SMGR Cfg 1: ICM20607 Accel FIFO -2014 0x8e13a32aa65f6521 0x00010003 #UUID -2013 0xa3524f726703c251 0x00010003 #UUID -2015 30000 0x00010003 #off_to_idle -2016 5000 0x00010003 #idle_to_ready -2017 42 0x00010003 #gpio1 -2018 1000 0x00010003 #reg_group_id -2019 0 0x00010003 #cal_grp_id -2020 4 0x00010003 #i2c_bus -2021 0x68 0x00010003 #i2c_address -2022 1 0x00010003 #sens_default -2023 0x80 0x00010003 #flags -2070 0xff 0x00010003 #vdd -2071 0xff 0x00010003 #vddio - -# SSI SMGR Cfg 0 BMI160 GYRO -2103 0x0f4d0fd654c7eab5 0x00010003 #UUID -2102 0xd646cb83ec0cd5a5 0x00010003 #UUID -2104 30000 0x00010003 #off_to_idle -2105 5000 0x00010003 #idle_to_ready -2106 42 0x00010003 #gpio1 -2107 1010 0x00010003 #reg_group_id -2108 10 0x00010003 #cal_grp_id -2109 4 0x00010003 #i2c_bus -2110 0x68 0x00010003 #i2c_address -2111 4 0x00010003 #sens_default -2112 0xD0 0x00010003 #flags -2168 0xff 0x00010003 #vdd -2169 0xff 0x00010003 #vddio - -# SSI SMGR Cfg 1: ICM20607 Gyro FIFO -2114 0x8e13a32aa65f6521 0x00010003 #UUID -2113 0xa3524f726703c251 0x00010003 #UUID -2115 30000 0x00010003 #off_to_idle -2116 5000 0x00010003 #idle_to_ready -2117 42 0x00010003 #gpio1 -2118 1010 0x00010003 #reg_group_id -2119 10 0x00010003 #cal_grp_id -2120 4 0x00010003 #i2c_bus -2121 0x68 0x00010003 #i2c_address -2122 3 0x00010003 #sens_default -2123 0x80 0x00010003 #flags -2170 0xff 0x00010003 #vdd -2171 0xff 0x00010003 #vddio - -# SSI SMGR Cfg 1 ST480 -2203 0x2e94aafbde68bd9d 0x00010003 #UUID -2202 0xc04992988b1365e3 0x00010003 #UUID -2204 1500 0x00010003 #off_to_idle -2205 10000 0x00010003 #idle_to_ready -2206 0xFFFF 0x00010003 #gpio1 -2207 1020 0x00010003 #reg_group_id -2208 0xFFFF 0x00010003 #cal_grp_id -2209 4 0x00010003 #i2c_bus -2210 0x0C 0x00010003 #i2c_address -2211 1 0x00010003 #sens_default -2212 0x00 0x00010003 #flags -2268 0xff 0x00010003 #vdd -2269 0xff 0x00010003 #vddio - -# SSI SMGR Cfg 0 YAS530 -2214 0x1dc79ad346a827b3 0x00010003 #UUID -2213 0xbd403129b15b7905 0x00010003 #UUID -2215 5 0x00010003 #off_to_idle -2216 10 0x00010003 #idle_to_ready -2217 0xFFFF 0x00010003 #gpio1 -2218 1020 0x00010003 #reg_group_id -2219 0xFFFF 0x00010003 #cal_grp_id -2220 4 0x00010003 #i2c_bus -2221 0x2E 0x00010003 #i2c_address -2222 1 0x00010003 #sens_default -2223 0x00 0x00010003 #flags -2270 0xff 0x00010003 #vdd -2271 0xff 0x00010003 #vddio - -# SSI SMGR Cfg 1 ltr559 -2303 0x2f1531647b9aa8b3 0x00010003 #UUID should same to ADSP -2302 0x194a7a549019f36d 0x00010003 #UUID -2304 5700 0x00010003 #off_to_idle -2305 10000 0x00010003 #idle_to_ready -2306 0xFFFF 0x00010003 #gpio1 -2307 1040 0x00010003 #reg_group_id -2308 0xFFFF 0x00010003 #cal_grp_id -2309 4 0x00010003 #i2c_bus -2310 0x23 0x00010003 #i2c_address -2311 0 0x00010003 #sens_default -2312 0x00 0x00010003 #flags -2368 0xff 0x00010003 #vdd -2369 0xff 0x00010003 #vddio - -# SSI SMGR Cfg 0 STK3x1x -2314 0x8b11a21aa55e6586 0x00010003 #UUID should same to ADSP -2313 0xa4524f726702e351 0x00010003 #UUID -2315 5700 0x00010003 #off_to_idle -2316 0 0x00010003 #idle_to_ready -2317 43 0x00010003 #gpio1 -2318 1040 0x00010003 #reg_group_id -2319 0xFFFF 0x00010003 #cal_grp_id -2320 4 0x00010003 #i2c_bus -2321 0x48 0x00010003 #i2c_address -2322 0 0x00010003 #sens_default -2323 0x00 0x00010003 #flags -2370 0xff 0x00010003 #vdd -2371 0xff 0x00010003 #vddio - -# SSI SMGR Cfg 2 ltr578 -2325 0x8f11a32aa65f6586 0x00010003 #UUID should same to ADSP -2324 0xa4524f726703e252 0x00010003 #UUID -2326 5700 0x00010003 #off_to_idle -2327 10000 0x00010003 #idle_to_ready -2328 0xFFFF 0x00010003 #gpio1 -2329 1040 0x00010003 #reg_group_id -2330 0xFFFF 0x00010003 #cal_grp_id -2331 4 0x00010003 #i2c_bus -2332 0x53 0x00010003 #i2c_address -2333 0 0x00010003 #sens_default -2334 0x00 0x00010003 #flags -2372 0xff 0x00010003 #vdd -2373 0xff 0x00010003 #vddio - -# SSI SMGR Version -3600 1 0x00010001 #Maj Ver -3601 2 0x00010001 #Min Ver - -# QMAG_CAL Configuration -3801 1 0x00010001 -3804 0x000A0000 0x00010001 #Sample Rate - -# -# SSI GPIO configuration -#----------------------------- -2700 1 0x00010001 #maj ver -2701 1 0x00010001 #min ver -2702 14 0x00010001 #I2C SDA_1 -2703 15 0x00010001 #I2C SCL_1 -2704 0xFFFF 0x00010001 #I2C SDA_2 -2705 0xFFFF 0x00010001 #I2C SCL_2 -2706 59 0x00010001 #RESET pin -2709 42 0x00010001 #ACCEL DRI -2710 45 0x00010001 #GYRO DRI -2711 44 0x00010001 #MAG DRI -2712 43 0x00010001 #ALS/PRX INT -2714 46 0x00010001 #PRESS INT - -# AMD Cfg -200 0x000A0000 0x00010001 #AMD Default Sample rate -201 0x00000CDC 0x00010001 #AMD INT Cfg param1 -202 0x00008000 0x00010001 #AMD INT Cfg param2 - -# RMD Cfg -220 0x001E0000 0x00010001 #RMD Default Sample rate -221 0X0001B333 0x00010001 #RMD INT Cfg param1 -222 0x00003333 0x00010001 #RMD INT Cfg param2 -223 0x00001657 0x00010001 #RMD INT Cfg param3 -224 0x00003333 0x00010001 #RMD INT Cfg param4 diff --git a/configs/thermal-engine.conf b/configs/thermal-engine.conf deleted file mode 100644 index 49968db..0000000 --- a/configs/thermal-engine.conf +++ /dev/null @@ -1,230 +0,0 @@ -# SENSOR : ALIAS -# tsens_tz_sensor2 : pop_mem -# tsens_tz_sensor10 : gpu -# tsens_tz_sensor9 : cpu4-cpu5-cpu6-cpu7 -# tsens_tz_sensor8 : cpu3 -# tsens_tz_sensor7 : cpu2 -# tsens_tz_sensor6 : cpu1 -# tsens_tz_sensor5 : cpu0 -# tsens_tz_sensor4 : L2_cache_1 - -#Conf file: /system/etc/thermal-engine.conf - -[CAMERA_CAMCORDER_MONITOR] -algo_type monitor -sampling 1000 -sensor case_therm -thresholds 43000 45000 -thresholds_clr 42000 43000 -actions camera+camcorder camera+camcorder -action_info 1+1 2+2 - -[BATTERY_CHARGING_CTL] -algo_type monitor -sampling 10000 -sensor case_therm -thresholds 42000 44000 46000 -thresholds_clr 39000 42000 44000 -actions battery battery battery battery -action_info 1 2 3 - -[LCD_SKIN_MANAGEMENT] -algo_type monitor -sampling 5000 -sensor case_therm -thresholds 56000 66000 -thresholds_clr 52000 56000 -actions lcd lcd -action_info 110 90 - -[CPU2_HOTPLUG_MONITOR] -algo_type monitor -sampling 1000 -sensor case_therm -thresholds 43000 -thresholds_clr 41000 -actions hotplug_2 -action_info 1 - -[CPU1_HOTPLUG_MONITOR] -algo_type monitor -sampling 1000 -sensor case_therm -thresholds 46000 -thresholds_clr 43000 -actions hotplug_1 -action_info 1 - -[CPU5_HOTPLUG_MONITOR] -algo_type monitor -sampling 1000 -sensor case_therm -thresholds 50000 -thresholds_clr 48000 -actions hotplug_5 -action_info 1 - -[SS-CASE-THERM-LOW] -algo_type ss -sampling 1000 -sensor case_therm -device cluster0 -set_point 46000 -set_point_clr 44000 -time_constant 3 -device_max_limit 902400 - -[VIRTUAL-CPUS] -#algo_type virtual -trip_sensor tsens_tz_sensor5 -set_point 75000 -set_point_clr 65000 -sensors tsens_tz_sensor5 tsens_tz_sensor6 tsens_tz_sensor7 tsens_tz_sensor8 tsens_tz_sensor9 -weights -sampling 50 -math 2 - -[SS-GPU] -#algo_type ss -sampling 250 -sensor gpu -device gpu -set_point 95000 -set_point_clr 65000 -time_constant 0 - -[SS-POPMEM] -#algo_type ss -sampling 250 -sensor pop_mem -device cpu_voltage -set_point 70000 -set_point_clr 55000 -time_constant 2 - -[SS-CPUS] -#algo_type ss -sampling 50 -sensor VIRTUAL-CPUS -device cpu_voltage -set_point 85000 -set_point_clr 55000 -time_constant 0 - -[SPEAKER-CAL] -sampling 30000 30000 10 1800000 -sensor pm8937_tz -sensors tsens_tz_sensor1 tsens_tz_sensor2 tsens_tz_sensor3 tsens_tz_sensor10 -temp_range 6000 10000 2000 -max_temp 45000 -offset -4000 - -[VDD_RSTR_MONITOR-TSENS10] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor10 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS9] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor9 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS8] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor8 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS7] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor7 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS6] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor6 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS5] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor5 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS4] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor4 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS3] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor3 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS2] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor2 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS1] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor1 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending - -[VDD_RSTR_MONITOR-TSENS0] -#algo_type monitor -sampling 1000 -sensor tsens_tz_sensor0 -thresholds 5000 -thresholds_clr 10000 -actions vdd_restriction -action_info 1 -descending diff --git a/device.mk b/device.mk index 18ea63e..5a5d9d7 100644 --- a/device.mk +++ b/device.mk @@ -1,5 +1,6 @@ # # Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-18 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,13 +17,11 @@ DEVICE_PATH := device/xiaomi/land -# Overlay -DEVICE_PACKAGE_OVERLAYS += \ - $(DEVICE_PATH)/overlay \ - $(DEVICE_PATH)/overlay-lineage +# Inherit proprietary files +$(call inherit-product-if-exists, vendor/xiaomi/land/land-vendor.mk) # Include device-specific product fragments include $(DEVICE_PATH)/product/*.mk -# Inherit proprietary files -$(call inherit-product-if-exists, vendor/xiaomi/land/land-vendor.mk) +# Inherit from msm8937-common +$(call inherit-product, device/xiaomi/msm8937-common/msm8937.mk) diff --git a/doze/Android.mk b/doze/Android.mk deleted file mode 100644 index abe80bd..0000000 --- a/doze/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := CMDoze -LOCAL_CERTIFICATE := platform -LOCAL_PRIVILEGED_MODULE := true - -LOCAL_PROGUARD_FLAG_FILES := proguard.flags - -include $(BUILD_PACKAGE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/doze/AndroidManifest.xml b/doze/AndroidManifest.xml deleted file mode 100644 index e16ec89..0000000 --- a/doze/AndroidManifest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/doze/proguard.flags b/doze/proguard.flags deleted file mode 100644 index 12f2bff..0000000 --- a/doze/proguard.flags +++ /dev/null @@ -1,3 +0,0 @@ --keep class org.cyanogenmod.doze.* { - *; -} diff --git a/doze/res/values/strings.xml b/doze/res/values/strings.xml deleted file mode 100644 index 1c5e2d9..0000000 --- a/doze/res/values/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - CMDoze - diff --git a/doze/src/org/cyanogenmod/doze/BootCompletedReceiver.java b/doze/src/org/cyanogenmod/doze/BootCompletedReceiver.java deleted file mode 100644 index 941d4c7..0000000 --- a/doze/src/org/cyanogenmod/doze/BootCompletedReceiver.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2015-2016 The CyanogenMod Project - * - * 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. - */ -package org.cyanogenmod.doze; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.util.Log; - -public class BootCompletedReceiver extends BroadcastReceiver { - - private static final boolean DEBUG = false; - private static final String TAG = BootCompletedReceiver.class.getSimpleName(); - - @Override - public void onReceive(final Context context, Intent intent) { - if (DEBUG) Log.d(TAG, "Starting service"); - context.startService(new Intent(context, DozeService.class)); - } -} diff --git a/doze/src/org/cyanogenmod/doze/CMSensor.java b/doze/src/org/cyanogenmod/doze/CMSensor.java deleted file mode 100644 index 371cda2..0000000 --- a/doze/src/org/cyanogenmod/doze/CMSensor.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (c) 2015-2016 The CyanogenMod Project - * - * 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. - */ -package org.cyanogenmod.doze; - -import android.content.Context; -import android.content.Intent; -import android.hardware.Sensor; -import android.hardware.SensorEvent; -import android.hardware.SensorEventListener; -import android.hardware.SensorManager; -import android.os.UserHandle; -import android.util.Log; - -public abstract class CMSensor { - - private static final boolean DEBUG = false; - private static final String TAG = CMSensor.class.getSimpleName(); - - private static final String DOZE_INTENT = "com.android.systemui.doze.pulse"; - private static final int BATCH_LATENCY_IN_MS = 100; - - private Context mContext; - private SensorManager mSensorManager; - private Sensor mSensor; - - private SensorEventListener mSensorEventListener = new SensorEventListener() { - @Override - public void onSensorChanged(SensorEvent event) { - onSensorEvent(event); - } - - @Override - public void onAccuracyChanged(Sensor sensor, int accuracy) { - // Do nothing - } - }; - - CMSensor(Context context, int type) { - mContext = context; - mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE); - mSensor = mSensorManager.getDefaultSensor(type); - } - - void launchDozePulse() { - Log.d(TAG, "Launch doze pulse"); - mContext.sendBroadcastAsUser(new Intent(DOZE_INTENT), - new UserHandle(UserHandle.USER_CURRENT)); - } - - void enable() { - if (DEBUG) Log.d(TAG, "Enabling"); - mSensorManager.registerListener(mSensorEventListener, mSensor, - SensorManager.SENSOR_DELAY_NORMAL, BATCH_LATENCY_IN_MS * 1000); - } - - void disable() { - if (DEBUG) Log.d(TAG, "Disabling"); - mSensorManager.unregisterListener(mSensorEventListener); - } - - void onSensorEvent(SensorEvent event) { - if (DEBUG) Log.d(TAG, "Got sensor event: " + event.values[0]); - } -} diff --git a/doze/src/org/cyanogenmod/doze/DozeService.java b/doze/src/org/cyanogenmod/doze/DozeService.java deleted file mode 100644 index 6eb9006..0000000 --- a/doze/src/org/cyanogenmod/doze/DozeService.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (c) 2015-2016 The CyanogenMod Project - * - * 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. - */ -package org.cyanogenmod.doze; - -import android.app.Service; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.os.IBinder; -import android.provider.Settings; -import android.util.Log; - -public class DozeService extends Service { - - private static final boolean DEBUG = false; - private static final String TAG = DozeService.class.getSimpleName(); - - private Context mContext; - private TiltSensor mTiltSensor; - - private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { - onDisplayOff(); - } else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) { - onDisplayOn(); - } - } - }; - - @Override - public void onCreate() { - if (DEBUG) Log.d(TAG, "Creating service"); - super.onCreate(); - mContext = this; - mTiltSensor = new TiltSensor(mContext); - } - - @Override - public int onStartCommand(Intent intent, int flags, int startId) { - if (DEBUG) Log.d(TAG, "Starting service"); - IntentFilter screenStateFilter = new IntentFilter(Intent.ACTION_SCREEN_ON); - screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF); - mContext.registerReceiver(mScreenStateReceiver, screenStateFilter); - return START_STICKY; - } - - @Override - public void onDestroy() { - if (DEBUG) Log.d(TAG, "Destroying service"); - super.onDestroy(); - mTiltSensor.disable(); - } - - @Override - public IBinder onBind(Intent intent) { - return null; - } - - private boolean isDozeEnabled() { - return Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.DOZE_ENABLED, 1) != 0; - } - - private void onDisplayOn() { - if (DEBUG) Log.d(TAG, "Display on"); - mTiltSensor.disable(); - } - - private void onDisplayOff() { - if (DEBUG) Log.d(TAG, "Display off"); - if (isDozeEnabled()) { - mTiltSensor.enable(); - } - } -} diff --git a/doze/src/org/cyanogenmod/doze/TiltSensor.java b/doze/src/org/cyanogenmod/doze/TiltSensor.java deleted file mode 100644 index 485c647..0000000 --- a/doze/src/org/cyanogenmod/doze/TiltSensor.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) 2015-2016 The CyanogenMod Project - * - * 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. - */ -package org.cyanogenmod.doze; - -import android.content.Context; -import android.hardware.Sensor; -import android.hardware.SensorEvent; -import android.os.SystemClock; -import android.util.Log; - -public class TiltSensor extends CMSensor { - - private static final int MIN_PULSE_INTERVAL_MS = 2500; - - private long mEntryTimestamp; - - TiltSensor(Context context) { - super(context, Sensor.TYPE_TILT_DETECTOR); - } - - @Override - void onSensorEvent(SensorEvent event) { - super.onSensorEvent(event); - - if (SystemClock.elapsedRealtime() - mEntryTimestamp < MIN_PULSE_INTERVAL_MS) { - return; - } - - mEntryTimestamp = SystemClock.elapsedRealtime(); - - if (event.values[0] == 1) { - launchDozePulse(); - } - } -} diff --git a/extract-files.sh b/extract-files.sh index 7ece27f..e71f576 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -58,7 +58,6 @@ fi # Initialize the helper setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false "$CLEAN_VENDOR" -extract "$MY_DIR"/proprietary-files-qc.txt "$SRC" "$SECTION" extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION" "$MY_DIR"/setup-makefiles.sh diff --git a/gps/Android.mk b/gps/Android.mk deleted file mode 100644 index 2498c3e..0000000 --- a/gps/Android.mk +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (C) 2017 The LineageOS Project -# -# 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. -# - -LOCAL_PATH := $(call my-dir) - -ifeq ($(TARGET_DEVICE),land) -include $(call all-subdir-makefiles,$(LOCAL_PATH)) -endif diff --git a/gps/CleanSpec.mk b/gps/CleanSpec.mk deleted file mode 100644 index dd1849d..0000000 --- a/gps/CleanSpec.mk +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) 2007 The Android Open Source Project -# -# 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. -# - -# If you don't need to do a full clean build but would like to touch -# a file or delete some intermediate files, add a clean step to the end -# of the list. These steps will only be run once, if they haven't been -# run before. -# -# E.g.: -# $(call add-clean-step, touch -c external/sqlite/sqlite3.h) -# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) -# -# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with -# files that are missing or have been moved. -# -# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. -# Use $(OUT_DIR) to refer to the "out" directory. -# -# If you need to re-do something that's already mentioned, just copy -# the command and add it to the bottom of the list. E.g., if a change -# that you made last week required touching a file and a change you -# made today requires touching the same file, just copy the old -# touch step and add it to the end of the list. -# -# ************************************************ -# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST -# ************************************************ - -# For example: -#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) -#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) -#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) -#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) - -# ************************************************ -# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST -# ************************************************ -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*) diff --git a/gps/Makefile.am b/gps/Makefile.am deleted file mode 100644 index 3b4b595..0000000 --- a/gps/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile.am - Automake script for gps loc_api -# - -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = utils core loc_api - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = loc-hal.pc -EXTRA_DIST = $(pkgconfig_DATA) diff --git a/gps/configure.ac b/gps/configure.ac deleted file mode 100644 index 4ef39ee..0000000 --- a/gps/configure.ac +++ /dev/null @@ -1,97 +0,0 @@ -# configure.ac -- Autoconf script for gps loc_hal -# -# Process this file with autoconf to produce a configure script - -# Requires autoconf tool later than 2.61 -AC_PREREQ(2.61) -# Initialize the gps loc-hal package version 1.0.0 -AC_INIT([loc-hal],1.0.0) -# Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) -# Disables auto rebuilding of configure, Makefile.ins -AM_MAINTAINER_MODE -# Verifies the --srcdir is correct by checking for the path -AC_CONFIG_SRCDIR([utils/loc_cfg.cpp]) -# defines some macros variable to be included by source -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# Checks for programs. -AC_PROG_LIBTOOL -AC_PROG_CXX -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_AWK -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG - -# Checks for libraries. -PKG_CHECK_MODULES([QMI], [qmi]) -AC_SUBST([QMI_CFLAGS]) -AC_SUBST([QMI_LIBS]) - -PKG_CHECK_MODULES([QMIF], [qmi-framework]) -AC_SUBST([QMIF_CFLAGS]) -AC_SUBST([QMIF_LIBS]) - -PKG_CHECK_MODULES([DATA], [data]) -AC_SUBST([DATA_CFLAGS]) -AC_SUBST([DATA_LIBS]) - -PKG_CHECK_MODULES([LOCPLA], [loc-pla]) -AC_SUBST([LOCPLA_CFLAGS]) -AC_SUBST([LOCPLA_LIBS]) - -AC_ARG_WITH([libhardware_includes], - AC_HELP_STRING([--with-libhardware-includes=@<:@dir@:>@], - [Specify the location of the libhardware headers]), - [libhardware_incdir=$withval], - with_libhardware_includes=no) - -if test "x$with_libhardware_includes" != "xno"; then - CPPFLAGS="${CPPFLAGS} -I${libhardware_incdir}" -fi - -AC_ARG_WITH([core_includes], - AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], - [Specify the location of the core headers]), - [core_incdir=$withval], - with_core_includes=no) - -if test "x$with_core_includes" != "xno"; then - CPPFLAGS="${CPPFLAGS} -I${core_incdir}" -fi - -AC_SUBST([CPPFLAGS]) - -AC_ARG_WITH([glib], - AC_HELP_STRING([--with-glib], - [enable glib, building HLOS systems which use glib])) - -if (test "x${with_glib}" = "xyes"); then - AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) - PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GThread >= 2.16 is required)) - PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GLib >= 2.16 is required)) - GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" - GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" - - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) -fi - -AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") - -AC_CONFIG_FILES([ \ - Makefile \ - utils/Makefile \ - core/Makefile \ - loc_api/Makefile \ - loc-hal.pc \ - ]) - -AC_OUTPUT diff --git a/gps/core/Android.mk b/gps/core/Android.mk deleted file mode 100644 index 9649f00..0000000 --- a/gps/core/Android.mk +++ /dev/null @@ -1,58 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_core -LOCAL_MODULE_OWNER := qcom - -LOCAL_MODULE_TAGS := optional - -ifeq ($(TARGET_DEVICE),apq8026_lw) -LOCAL_CFLAGS += -DPDK_FEATURE_SET -else ifeq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET),true) -LOCAL_CFLAGS += -DPDK_FEATURE_SET -endif - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libgps.utils \ - libdl \ - libloc_pla - -LOCAL_SRC_FILES += \ - LocApiBase.cpp \ - LocAdapterBase.cpp \ - ContextBase.cpp \ - LocDualContext.cpp \ - loc_core_log.cpp - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libflp \ - $(TARGET_OUT_HEADERS)/libloc_pla - -LOCAL_COPY_HEADERS_TO:= libloc_core/ -LOCAL_COPY_HEADERS:= \ - LocApiBase.h \ - LocAdapterBase.h \ - ContextBase.h \ - LocDualContext.h \ - LBSProxyBase.h \ - UlpProxyBase.h \ - gps_extended_c.h \ - gps_extended.h \ - loc_core_log.h \ - LocAdapterProxyBase.h - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/gps/core/ContextBase.cpp b/gps/core/ContextBase.cpp deleted file mode 100644 index d2f9070..0000000 --- a/gps/core/ContextBase.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_CtxBase" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace loc_core { - -loc_gps_cfg_s_type ContextBase::mGps_conf {0}; -loc_sap_cfg_s_type ContextBase::mSap_conf {0}; - -uint32_t ContextBase::getCarrierCapabilities() { - #define carrierMSA (uint32_t)0x2 - #define carrierMSB (uint32_t)0x1 - #define gpsConfMSA (uint32_t)0x4 - #define gpsConfMSB (uint32_t)0x2 - uint32_t capabilities = mGps_conf.CAPABILITIES; - if ((mGps_conf.SUPL_MODE & carrierMSA) != carrierMSA) { - capabilities &= ~gpsConfMSA; - } - if ((mGps_conf.SUPL_MODE & carrierMSB) != carrierMSB) { - capabilities &= ~gpsConfMSB; - } - - LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x", - mGps_conf.CAPABILITIES, mGps_conf.SUPL_MODE, capabilities); - return capabilities; -} - -LBSProxyBase* ContextBase::getLBSProxy(const char* libName) -{ - LBSProxyBase* proxy = NULL; - LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName); - void* lib = dlopen(libName, RTLD_NOW); - - if ((void*)NULL != lib) { - getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy"); - if (NULL != getter) { - proxy = (*getter)(); - } - } - else - { - LOC_LOGW("%s:%d]: FAILED TO LOAD libname: %s\n", __func__, __LINE__, libName); - } - if (NULL == proxy) { - proxy = new LBSProxyBase(); - } - LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__); - return proxy; -} - -LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) -{ - LocApiBase* locApi = NULL; - - if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { - void *handle = NULL; - //try to see if LocApiV02 is present - if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) { - LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__); - getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi"); - if (getter != NULL) { - LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, - __LINE__); - locApi = (*getter)(mMsgTask, exMask, this); - } - } - // only RPC is the option now - else { - LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC", - __func__, __LINE__); - handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); - if (NULL != handle) { - getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi"); - if (NULL != getter) { - LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, - __LINE__); - locApi = (*getter)(mMsgTask, exMask, this); - } - } - } - } - - // locApi could still be NULL at this time - // we would then create a dummy one - if (NULL == locApi) { - locApi = new LocApiBase(mMsgTask, exMask, this); - } - - return locApi; -} - -ContextBase::ContextBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - const char* libName) : - mLBSProxy(getLBSProxy(libName)), - mMsgTask(msgTask), - mLocApi(createLocApi(exMask)), - mLocApiProxy(mLocApi->getLocApiProxy()) -{ -} - -} diff --git a/gps/core/ContextBase.h b/gps/core/ContextBase.h deleted file mode 100644 index 87d2acf..0000000 --- a/gps/core/ContextBase.h +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef __LOC_CONTEXT_BASE__ -#define __LOC_CONTEXT_BASE__ - -#include -#include -#include -#include -#include - -#define MAX_XTRA_SERVER_URL_LENGTH 256 - -/* GPS.conf support */ -/* NOTE: the implementaiton of the parser casts number - fields to 32 bit. To ensure all 'n' fields working, - they must all be 32 bit fields. */ -typedef struct loc_gps_cfg_s -{ - uint32_t INTERMEDIATE_POS; - uint32_t ACCURACY_THRES; - uint32_t SUPL_VER; - uint32_t SUPL_MODE; - uint32_t SUPL_ES; - uint32_t CAPABILITIES; - uint32_t LPP_PROFILE; - uint32_t XTRA_VERSION_CHECK; - char XTRA_SERVER_1[MAX_XTRA_SERVER_URL_LENGTH]; - char XTRA_SERVER_2[MAX_XTRA_SERVER_URL_LENGTH]; - char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH]; - uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL; - uint32_t NMEA_PROVIDER; - uint32_t GPS_LOCK; - uint32_t A_GLONASS_POS_PROTOCOL_SELECT; - uint32_t AGPS_CERT_WRITABLE_MASK; - uint32_t AGPS_CONFIG_INJECT; - uint32_t LPPE_CP_TECHNOLOGY; - uint32_t LPPE_UP_TECHNOLOGY; - uint32_t EXTERNAL_DR_ENABLED; -} loc_gps_cfg_s_type; - -/* NOTE: the implementaiton of the parser casts number - fields to 32 bit. To ensure all 'n' fields working, - they must all be 32 bit fields. */ -/* Meanwhile, *_valid fields are 8 bit fields, and 'f' - fields are double. Rigid as they are, it is the - the status quo, until the parsing mechanism is - change, that is. */ -typedef struct -{ - uint8_t GYRO_BIAS_RANDOM_WALK_VALID; - double GYRO_BIAS_RANDOM_WALK; - uint32_t SENSOR_ACCEL_BATCHES_PER_SEC; - uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH; - uint32_t SENSOR_GYRO_BATCHES_PER_SEC; - uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH; - uint32_t SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; - uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; - uint32_t SENSOR_GYRO_BATCHES_PER_SEC_HIGH; - uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; - uint32_t SENSOR_CONTROL_MODE; - uint32_t SENSOR_USAGE; - uint32_t SENSOR_ALGORITHM_CONFIG_MASK; - uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID; - double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY; - uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID; - double ANGLE_RANDOM_WALK_SPECTRAL_DENSITY; - uint8_t RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID; - double RATE_RANDOM_WALK_SPECTRAL_DENSITY; - uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID; - double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY; - uint32_t SENSOR_PROVIDER; -} loc_sap_cfg_s_type; - -namespace loc_core { - -class LocAdapterBase; - -class ContextBase { - static LBSProxyBase* getLBSProxy(const char* libName); - LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask); -protected: - const LBSProxyBase* mLBSProxy; - const MsgTask* mMsgTask; - LocApiBase* mLocApi; - LocApiProxyBase *mLocApiProxy; -public: - ContextBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - const char* libName); - inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; } - - inline const MsgTask* getMsgTask() { return mMsgTask; } - inline LocApiBase* getLocApi() { return mLocApi; } - inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } - inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); } - inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); } - inline bool hasNativeXtraClient() { return mLBSProxy->hasNativeXtraClient(); } - inline void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); } - inline void requestUlp(LocAdapterBase* adapter, - unsigned long capabilities) { - mLBSProxy->requestUlp(adapter, capabilities); - } - inline IzatDevId_t getIzatDevId() const { - return mLBSProxy->getIzatDevId(); - } - inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); } - - static loc_gps_cfg_s_type mGps_conf; - static loc_sap_cfg_s_type mSap_conf; - - static uint32_t getCarrierCapabilities(); - -}; - -} // namespace loc_core - -#endif //__LOC_CONTEXT_BASE__ diff --git a/gps/core/LBSProxyBase.h b/gps/core/LBSProxyBase.h deleted file mode 100644 index 94ddd0f..0000000 --- a/gps/core/LBSProxyBase.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef IZAT_PROXY_BASE_H -#define IZAT_PROXY_BASE_H -#include -#include - -namespace loc_core { - -class LocApiBase; -class LocAdapterBase; -class ContextBase; - -class LBSProxyBase { - friend class ContextBase; - inline virtual LocApiBase* - getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - ContextBase* context) const { - - (void)msgTask; - (void)exMask; - (void)context; - return NULL; - } -protected: - inline LBSProxyBase() {} -public: - inline virtual ~LBSProxyBase() {} - inline virtual void requestUlp(LocAdapterBase* adapter, - unsigned long capabilities) const { - - (void)adapter; - (void)capabilities; - } - inline virtual bool hasAgpsExtendedCapabilities() const { return false; } - inline virtual bool hasCPIExtendedCapabilities() const { return false; } - inline virtual void modemPowerVote(bool power) const { - - (void)power; - } - virtual void injectFeatureConfig(ContextBase* context) const { - - (void)context; - } - inline virtual bool hasNativeXtraClient() const { return false; } - inline virtual IzatDevId_t getIzatDevId() const { return 0; } -}; - -typedef LBSProxyBase* (getLBSProxy_t)(); - -} // namespace loc_core - -#endif // IZAT_PROXY_BASE_H diff --git a/gps/core/LocAdapterBase.cpp b/gps/core/LocAdapterBase.cpp deleted file mode 100644 index 6a3f969..0000000 --- a/gps/core/LocAdapterBase.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_LocAdapterBase" - -#include -#include -#include -#include -#include - -namespace loc_core { - -// This is the top level class, so the constructor will -// always gets called. Here we prepare for the default. -// But if getLocApi(targetEnumType target) is overriden, -// the right locApi should get created. -LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context, LocAdapterProxyBase *adapterProxyBase) : - mEvtMask(mask), mContext(context), - mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), - mMsgTask(context->getMsgTask()) -{ - mLocApi->addAdapter(this); -} - -void LocAdapterBase::handleEngineUpEvent() -{ - if (mLocAdapterProxyBase) { - mLocAdapterProxyBase->handleEngineUpEvent(); - } -} - -void LocAdapterBase::handleEngineDownEvent() -{ - if (mLocAdapterProxyBase) { - mLocAdapterProxyBase->handleEngineDownEvent(); - } -} - -void LocAdapterBase:: - reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask) { - if (mLocAdapterProxyBase == NULL || - !mLocAdapterProxyBase->reportPosition(location, - locationExtended, - status, - loc_technology_mask)) { - DEFAULT_IMPL() - } -} - -void LocAdapterBase:: - reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) -DEFAULT_IMPL() - -void LocAdapterBase:: - reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) -DEFAULT_IMPL() - -void LocAdapterBase:: - reportSvPolynomial(GnssSvPolynomial &svPolynomial) -DEFAULT_IMPL() - -void LocAdapterBase:: - reportStatus(GpsStatusValue status) -DEFAULT_IMPL() - - -void LocAdapterBase:: - reportNmea(const char* nmea, int length) -DEFAULT_IMPL() - -bool LocAdapterBase:: - reportXtraServer(const char* url1, const char* url2, - const char* url3, const int maxlength) -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - requestXtraData() -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - requestTime() -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - requestLocation() -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - requestATL(int connHandle, AGpsType agps_type) -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - releaseATL(int connHandle) -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - requestSuplES(int connHandle) -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - reportDataCallOpened() -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - reportDataCallClosed() -DEFAULT_IMPL(false) - -bool LocAdapterBase:: - requestNiNotify(GpsNiNotification ¬ify, const void* data) -DEFAULT_IMPL(false) - -void LocAdapterBase:: - reportGnssMeasurementData(GnssData &gnssMeasurementData) -DEFAULT_IMPL() -} // namespace loc_core diff --git a/gps/core/LocAdapterBase.h b/gps/core/LocAdapterBase.h deleted file mode 100644 index af25138..0000000 --- a/gps/core/LocAdapterBase.h +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright (c) 2011-2014,2016 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_API_ADAPTER_BASE_H -#define LOC_API_ADAPTER_BASE_H - -#include -#include -#include - -namespace loc_core { - -class LocAdapterProxyBase; - -class LocAdapterBase { -protected: - LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; - ContextBase* mContext; - LocApiBase* mLocApi; - LocAdapterProxyBase* mLocAdapterProxyBase; - const MsgTask* mMsgTask; - - inline LocAdapterBase(const MsgTask* msgTask) : - mEvtMask(0), mContext(NULL), mLocApi(NULL), - mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {} -public: - inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } - LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL); - inline LOC_API_ADAPTER_EVENT_MASK_T - checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { - return mEvtMask & mask; - } - - inline LOC_API_ADAPTER_EVENT_MASK_T getEvtMask() const { - return mEvtMask; - } - - inline void sendMsg(const LocMsg* msg) const { - mMsgTask->sendMsg(msg); - } - - inline void sendMsg(const LocMsg* msg) { - mMsgTask->sendMsg(msg); - } - - inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled) - { - mEvtMask = - isEnabled == LOC_REGISTRATION_MASK_ENABLED ? (mEvtMask|event):(mEvtMask&~event); - - mLocApi->updateEvtMask(); - } - - inline bool isFeatureSupported(uint8_t featureVal) { - return mLocApi->isFeatureSupported(featureVal); - } - - // This will be overridden by the individual adapters - // if necessary. - inline virtual void setUlpProxy(UlpProxyBase* ulp) { - - (void)ulp; - } - virtual void handleEngineUpEvent(); - virtual void handleEngineDownEvent(); - inline virtual void setPositionModeInt(LocPosMode& posMode) { - - (void)posMode; - } - virtual void startFixInt() {} - virtual void stopFixInt() {} - virtual void getZppInt() {} - virtual void reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); - virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial); - virtual void reportStatus(GpsStatusValue status); - virtual void reportNmea(const char* nmea, int length); - virtual bool reportXtraServer(const char* url1, const char* url2, - const char* url3, const int maxlength); - virtual bool requestXtraData(); - virtual bool requestTime(); - virtual bool requestLocation(); - virtual bool requestATL(int connHandle, AGpsType agps_type); - virtual bool releaseATL(int connHandle); - virtual bool requestSuplES(int connHandle); - virtual bool reportDataCallOpened(); - virtual bool reportDataCallClosed(); - virtual bool requestNiNotify(GpsNiNotification ¬ify, - const void* data); - inline virtual bool isInSession() { return false; } - ContextBase* getContext() const { return mContext; } - virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData); -}; - -} // namespace loc_core - -#endif //LOC_API_ADAPTER_BASE_H diff --git a/gps/core/LocAdapterProxyBase.h b/gps/core/LocAdapterProxyBase.h deleted file mode 100644 index 82cba6b..0000000 --- a/gps/core/LocAdapterProxyBase.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (c) 2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_ADAPTER_PROXY_BASE_H -#define LOC_ADAPTER_PROXY_BASE_H - -#include -#include - -namespace loc_core { - -class LocAdapterProxyBase { -private: - LocAdapterBase *mLocAdapterBase; -protected: - inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, - ContextBase* context): - mLocAdapterBase(new LocAdapterBase(mask, context, this)) { - } - inline virtual ~LocAdapterProxyBase() { - delete mLocAdapterBase; - } - inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, - loc_registration_mask_status isEnabled) { - mLocAdapterBase->updateEvtMask(event,isEnabled); - } - -public: - inline ContextBase* getContext() const { - return mLocAdapterBase->getContext(); - } - inline virtual void handleEngineUpEvent() {}; - inline virtual void handleEngineDownEvent() {}; - inline virtual bool reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask) { - - (void)location; - (void)locationExtended; - (void)status; - (void)loc_technology_mask; - return false; - } -}; - -} // namespace loc_core - -#endif //LOC_ADAPTER_PROXY_BASE_H diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp deleted file mode 100644 index 36f1bb0..0000000 --- a/gps/core/LocApiBase.cpp +++ /dev/null @@ -1,598 +0,0 @@ -/* Copyright (c) 2011-2014,2016 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_LocApiBase" - -#include -#include -#include -#include -#include - -namespace loc_core { - -#define TO_ALL_LOCADAPTERS(call) TO_ALL_ADAPTERS(mLocAdapters, (call)) -#define TO_1ST_HANDLING_LOCADAPTERS(call) TO_1ST_HANDLING_ADAPTER(mLocAdapters, (call)) - -int hexcode(char *hexstring, int string_size, - const char *data, int data_size) -{ - int i; - for (i = 0; i < data_size; i++) - { - char ch = data[i]; - if (i*2 + 3 <= string_size) - { - snprintf(&hexstring[i*2], 3, "%02X", ch); - } - else { - break; - } - } - return i; -} - -int decodeAddress(char *addr_string, int string_size, - const char *data, int data_size) -{ - const char addr_prefix = 0x91; - int i, idxOutput = 0; - - if (!data || !addr_string) { return 0; } - - if (data[0] != addr_prefix) - { - LOC_LOGW("decodeAddress: address prefix is not 0x%x but 0x%x", addr_prefix, data[0]); - addr_string[0] = '\0'; - return 0; // prefix not correct - } - - for (i = 1; i < data_size; i++) - { - unsigned char ch = data[i], low = ch & 0x0F, hi = ch >> 4; - if (low <= 9 && idxOutput < string_size - 1) { addr_string[idxOutput++] = low + '0'; } - if (hi <= 9 && idxOutput < string_size - 1) { addr_string[idxOutput++] = hi + '0'; } - } - - addr_string[idxOutput] = '\0'; // Terminates the string - - return idxOutput; -} - -struct LocSsrMsg : public LocMsg { - LocApiBase* mLocApi; - inline LocSsrMsg(LocApiBase* locApi) : - LocMsg(), mLocApi(locApi) - { - locallog(); - } - inline virtual void proc() const { - mLocApi->close(); - mLocApi->open(mLocApi->getEvtMask()); - } - inline void locallog() { - LOC_LOGV("LocSsrMsg"); - } - inline virtual void log() { - locallog(); - } -}; - -struct LocOpenMsg : public LocMsg { - LocApiBase* mLocApi; - LOC_API_ADAPTER_EVENT_MASK_T mMask; - inline LocOpenMsg(LocApiBase* locApi, - LOC_API_ADAPTER_EVENT_MASK_T mask) : - LocMsg(), mLocApi(locApi), mMask(mask) - { - locallog(); - } - inline virtual void proc() const { - mLocApi->open(mMask); - } - inline void locallog() { - LOC_LOGV("%s:%d]: LocOpen Mask: %x\n", - __func__, __LINE__, mMask); - } - inline virtual void log() { - locallog(); - } -}; - -LocApiBase::LocApiBase(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T excludedMask, - ContextBase* context) : - mExcludedMask(excludedMask), mMsgTask(msgTask), - mMask(0), mSupportedMsg(0), mContext(context) -{ - memset(mLocAdapters, 0, sizeof(mLocAdapters)); - memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported)); -} - -LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask() -{ - LOC_API_ADAPTER_EVENT_MASK_T mask = 0; - - TO_ALL_LOCADAPTERS(mask |= mLocAdapters[i]->getEvtMask()); - - return mask & ~mExcludedMask; -} - -bool LocApiBase::isInSession() -{ - bool inSession = false; - - for (int i = 0; - !inSession && i < MAX_ADAPTERS && NULL != mLocAdapters[i]; - i++) { - inSession = mLocAdapters[i]->isInSession(); - } - - return inSession; -} - -void LocApiBase::addAdapter(LocAdapterBase* adapter) -{ - for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) { - if (mLocAdapters[i] == NULL) { - mLocAdapters[i] = adapter; - mMsgTask->sendMsg(new LocOpenMsg(this, - (adapter->getEvtMask()))); - break; - } - } -} - -void LocApiBase::removeAdapter(LocAdapterBase* adapter) -{ - for (int i = 0; - i < MAX_ADAPTERS && NULL != mLocAdapters[i]; - i++) { - if (mLocAdapters[i] == adapter) { - mLocAdapters[i] = NULL; - - // shift the rest of the adapters up so that the pointers - // in the array do not have holes. This should be more - // performant, because the array maintenance is much much - // less frequent than event handlings, which need to linear - // search all the adapters - int j = i; - while (++i < MAX_ADAPTERS && mLocAdapters[i] != NULL); - - // i would be MAX_ADAPTERS or point to a NULL - i--; - // i now should point to a none NULL adapter within valid - // range although i could be equal to j, but it won't hurt. - // No need to check it, as it gains nothing. - mLocAdapters[j] = mLocAdapters[i]; - // this makes sure that we exit the for loop - mLocAdapters[i] = NULL; - - // if we have an empty list of adapters - if (0 == i) { - close(); - } else { - // else we need to remove the bit - mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); - } - } - } -} - -void LocApiBase::updateEvtMask() -{ - mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); -} - -void LocApiBase::handleEngineUpEvent() -{ - // This will take care of renegotiating the loc handle - mMsgTask->sendMsg(new LocSsrMsg(this)); - - LocDualContext::injectFeatureConfig(mContext); - - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineUpEvent()); -} - -void LocApiBase::handleEngineDownEvent() -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent()); -} - -void LocApiBase::reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask) -{ - // print the location info before delivering - LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n " - "altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n " - "timestamp: %lld\n rawDataSize: %d\n rawData: %p\n " - "Session status: %d\n Technology mask: %u\n " - "SV used in fix (gps/glo/bds/gal) : (%x/%x/%x/%x)", - location.gpsLocation.flags, location.position_source, - location.gpsLocation.latitude, location.gpsLocation.longitude, - location.gpsLocation.altitude, location.gpsLocation.speed, - location.gpsLocation.bearing, location.gpsLocation.accuracy, - location.gpsLocation.timestamp, location.rawDataSize, - location.rawData, status, loc_technology_mask, - locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask, - locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask, - locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask, - locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask); - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportPosition(location, - locationExtended, - locationExt, - status, - loc_technology_mask) - ); -} - -void LocApiBase::reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) -{ - const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", - "QZSS", "BEIDOU", "GALILEO" }; - - // print the SV info before delivering - LOC_LOGV("num sv: %d\n" - " sv: constellation svid cN0" - " elevation azimuth flags", - svStatus.num_svs); - for (int i = 0; i < svStatus.num_svs && i < GNSS_MAX_SVS; i++) { - if (svStatus.gnss_sv_list[i].constellation > - sizeof(constellationString) / sizeof(constellationString[0]) - 1) { - svStatus.gnss_sv_list[i].constellation = 0; - } - LOC_LOGV(" %03d: %*s %02d %f %f %f 0x%02X", - i, - 13, - constellationString[svStatus.gnss_sv_list[i].constellation], - svStatus.gnss_sv_list[i].svid, - svStatus.gnss_sv_list[i].c_n0_dbhz, - svStatus.gnss_sv_list[i].elevation, - svStatus.gnss_sv_list[i].azimuth, - svStatus.gnss_sv_list[i].flags); - } - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSv(svStatus, - locationExtended, - svExt) - ); -} - -void LocApiBase::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSvMeasurement(svMeasurementSet) - ); -} - -void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSvPolynomial(svPolynomial) - ); -} - -void LocApiBase::reportStatus(GpsStatusValue status) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportStatus(status)); -} - -void LocApiBase::reportNmea(const char* nmea, int length) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportNmea(nmea, length)); -} - -void LocApiBase::reportXtraServer(const char* url1, const char* url2, - const char* url3, const int maxlength) -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportXtraServer(url1, url2, url3, maxlength)); - -} - -void LocApiBase::requestXtraData() -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestXtraData()); -} - -void LocApiBase::requestTime() -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestTime()); -} - -void LocApiBase::requestLocation() -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation()); -} - -void LocApiBase::requestATL(int connHandle, AGpsType agps_type) -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type)); -} - -void LocApiBase::releaseATL(int connHandle) -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle)); -} - -void LocApiBase::requestSuplES(int connHandle) -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle)); -} - -void LocApiBase::reportDataCallOpened() -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallOpened()); -} - -void LocApiBase::reportDataCallClosed() -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallClosed()); -} - -void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) -{ - // loop through adapters, and deliver to the first handling adapter. - TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); -} - -void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList) -{ - mSupportedMsg = supportedMsgList; -} - -void LocApiBase::saveSupportedFeatureList(uint8_t *featureList) -{ - memcpy((void *)mFeaturesSupported, (void *)featureList, sizeof(mFeaturesSupported)); -} - -void* LocApiBase :: getSibling() - DEFAULT_IMPL(NULL) - -LocApiProxyBase* LocApiBase :: getLocApiProxy() - DEFAULT_IMPL(NULL) - -void LocApiBase::reportGnssMeasurementData(GnssData &gnssMeasurementData) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementData(gnssMeasurementData)); -} - -enum loc_api_adapter_err LocApiBase:: - open(LOC_API_ADAPTER_EVENT_MASK_T mask) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - close() -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - startFix(const LocPosMode& posMode) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - stopFix() -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - deleteAidingData(GpsAidingData f) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - enableData(int enable) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setAPN(char* apn, int len) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - injectPosition(double latitude, double longitude, float accuracy) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setXtraData(char* data, int length) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - requestXtraServer() -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - atlOpenStatus(int handle, int is_succ, char* apn, - AGpsBearerType bear, AGpsType agpsType) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - atlCloseStatus(int handle, int is_succ) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setPositionMode(const LocPosMode& posMode) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setServer(const char* url, int len) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setServer(unsigned int ip, int port, - LocServerType type) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - informNiResponse(GpsUserResponseType userResponse, - const void* passThroughData) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setSUPLVersion(uint32_t version) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setNMEATypes (uint32_t typesMask) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setLPPConfig(uint32_t profile) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setSensorControlConfig(int sensorUsage, - int sensorProvider) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, - float gyroBiasVarianceRandomWalk, - bool accelBiasVarianceRandomWalk_valid, - float accelBiasVarianceRandomWalk, - bool angleBiasVarianceRandomWalk_valid, - float angleBiasVarianceRandomWalk, - bool rateBiasVarianceRandomWalk_valid, - float rateBiasVarianceRandomWalk, - bool velocityBiasVarianceRandomWalk_valid, - float velocityBiasVarianceRandomWalk) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setSensorPerfControlConfig(int controlMode, - int accelSamplesPerBatch, - int accelBatchesPerSec, - int gyroSamplesPerBatch, - int gyroBatchesPerSec, - int accelSamplesPerBatchHigh, - int accelBatchesPerSecHigh, - int gyroSamplesPerBatchHigh, - int gyroBatchesPerSecHigh, - int algorithmConfig) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setAGLONASSProtocol(unsigned long aGlonassProtocol) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP) - DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - getWwanZppFix(GpsLocation& zppLoc) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(GpsLocation& zppLoc) -{ - memset(&zppLoc, 0, sizeof(zppLoc)); - DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -} - -enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) -{ - memset(&zppLoc, 0, sizeof(zppLoc)); - memset(&tech_mask, 0, sizeof(tech_mask)); - DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) -} - -int LocApiBase:: - initDataServiceClient() -DEFAULT_IMPL(-1) - -int LocApiBase:: - openAndStartDataCall() -DEFAULT_IMPL(-1) - -void LocApiBase:: - stopDataCall() -DEFAULT_IMPL() - -void LocApiBase:: - closeDataCall() -DEFAULT_IMPL() - -int LocApiBase:: - setGpsLock(LOC_GPS_LOCK_MASK lock) -DEFAULT_IMPL(-1) - -void LocApiBase:: - installAGpsCert(const DerEncodedCertificate* pData, - size_t length, - uint32_t slotBitMask) -DEFAULT_IMPL() - -int LocApiBase:: - getGpsLock() -DEFAULT_IMPL(-1) - -enum loc_api_adapter_err LocApiBase:: - setXtraVersionCheck(enum xtra_version_check check) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) - -bool LocApiBase:: - gnssConstellationConfig() -DEFAULT_IMPL(false) - -bool LocApiBase:: - isFeatureSupported(uint8_t featureVal) -{ - uint8_t arrayIndex = featureVal >> 3; - uint8_t bitPos = featureVal & 7; - - if (arrayIndex >= MAX_FEATURE_LENGTH) return false; - return ((mFeaturesSupported[arrayIndex] >> bitPos ) & 0x1); -} - -} // namespace loc_core diff --git a/gps/core/LocApiBase.h b/gps/core/LocApiBase.h deleted file mode 100644 index 066695c..0000000 --- a/gps/core/LocApiBase.h +++ /dev/null @@ -1,274 +0,0 @@ -/* Copyright (c) 2011-2014, 2016 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_API_BASE_H -#define LOC_API_BASE_H - -#include -#include -#include -#include -#include - -namespace loc_core { -class ContextBase; - -int hexcode(char *hexstring, int string_size, - const char *data, int data_size); -int decodeAddress(char *addr_string, int string_size, - const char *data, int data_size); - -#define MAX_ADAPTERS 10 -#define MAX_FEATURE_LENGTH 100 - -#define TO_ALL_ADAPTERS(adapters, call) \ - for (int i = 0; i < MAX_ADAPTERS && NULL != (adapters)[i]; i++) { \ - call; \ - } - -#define TO_1ST_HANDLING_ADAPTER(adapters, call) \ - for (int i = 0; i sendMsg(msg); - } - - void addAdapter(LocAdapterBase* adapter); - void removeAdapter(LocAdapterBase* adapter); - - // upward calls - void handleEngineUpEvent(); - void handleEngineDownEvent(); - void reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask = - LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); - void reportSvPolynomial(GnssSvPolynomial &svPolynomial); - void reportStatus(GpsStatusValue status); - void reportNmea(const char* nmea, int length); - void reportXtraServer(const char* url1, const char* url2, - const char* url3, const int maxlength); - void requestXtraData(); - void requestTime(); - void requestLocation(); - void requestATL(int connHandle, AGpsType agps_type); - void releaseATL(int connHandle); - void requestSuplES(int connHandle); - void reportDataCallOpened(); - void reportDataCallClosed(); - void requestNiNotify(GpsNiNotification ¬ify, const void* data); - void saveSupportedMsgList(uint64_t supportedMsgList); - void reportGnssMeasurementData(GnssData &gnssMeasurementData); - void saveSupportedFeatureList(uint8_t *featureList); - - // downward calls - // All below functions are to be defined by adapter specific modules: - // RPC, QMI, etc. The default implementation is empty. - - virtual void* getSibling(); - virtual LocApiProxyBase* getLocApiProxy(); - virtual enum loc_api_adapter_err - startFix(const LocPosMode& posMode); - virtual enum loc_api_adapter_err - stopFix(); - virtual enum loc_api_adapter_err - deleteAidingData(GpsAidingData f); - virtual enum loc_api_adapter_err - enableData(int enable); - virtual enum loc_api_adapter_err - setAPN(char* apn, int len); - virtual enum loc_api_adapter_err - injectPosition(double latitude, double longitude, float accuracy); - virtual enum loc_api_adapter_err - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty); - virtual enum loc_api_adapter_err - setXtraData(char* data, int length); - virtual enum loc_api_adapter_err - requestXtraServer(); - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType); - virtual enum loc_api_adapter_err - atlCloseStatus(int handle, int is_succ); - virtual enum loc_api_adapter_err - setPositionMode(const LocPosMode& posMode); - virtual enum loc_api_adapter_err - setServer(const char* url, int len); - virtual enum loc_api_adapter_err - setServer(unsigned int ip, int port, - LocServerType type); - virtual enum loc_api_adapter_err - informNiResponse(GpsUserResponseType userResponse, const void* passThroughData); - virtual enum loc_api_adapter_err - setSUPLVersion(uint32_t version); - virtual enum loc_api_adapter_err - setNMEATypes (uint32_t typesMask); - virtual enum loc_api_adapter_err - setLPPConfig(uint32_t profile); - virtual enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage, int sensorProvider); - virtual enum loc_api_adapter_err - setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, - float gyroBiasVarianceRandomWalk, - bool accelBiasVarianceRandomWalk_valid, - float accelBiasVarianceRandomWalk, - bool angleBiasVarianceRandomWalk_valid, - float angleBiasVarianceRandomWalk, - bool rateBiasVarianceRandomWalk_valid, - float rateBiasVarianceRandomWalk, - bool velocityBiasVarianceRandomWalk_valid, - float velocityBiasVarianceRandomWalk); - virtual enum loc_api_adapter_err - setSensorPerfControlConfig(int controlMode, - int accelSamplesPerBatch, - int accelBatchesPerSec, - int gyroSamplesPerBatch, - int gyroBatchesPerSec, - int accelSamplesPerBatchHigh, - int accelBatchesPerSecHigh, - int gyroSamplesPerBatchHigh, - int gyroBatchesPerSecHigh, - int algorithmConfig); - virtual enum loc_api_adapter_err - setAGLONASSProtocol(unsigned long aGlonassProtocol); - virtual enum loc_api_adapter_err - setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP); - virtual enum loc_api_adapter_err - getWwanZppFix(GpsLocation & zppLoc); - virtual enum loc_api_adapter_err - getBestAvailableZppFix(GpsLocation & zppLoc); - virtual enum loc_api_adapter_err - getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); - virtual int initDataServiceClient(); - virtual int openAndStartDataCall(); - virtual void stopDataCall(); - virtual void closeDataCall(); - virtual void installAGpsCert(const DerEncodedCertificate* pData, - size_t length, - uint32_t slotBitMask); - inline virtual void setInSession(bool inSession) { - - (void)inSession; - } - inline bool isMessageSupported (LocCheckingMessagesID msgID) const { - - // confirm if msgID is not larger than the number of bits in - // mSupportedMsg - if ((uint64_t)msgID > (sizeof(mSupportedMsg) << 3)) { - return false; - } else { - uint32_t messageChecker = 1 << msgID; - return (messageChecker & mSupportedMsg) == messageChecker; - } - } - void updateEvtMask(); - - /*Values for lock - 1 = Do not lock any position sessions - 2 = Lock MI position sessions - 3 = Lock MT position sessions - 4 = Lock all position sessions - */ - virtual int setGpsLock(LOC_GPS_LOCK_MASK lock); - /* - Returns - Current value of GPS Lock on success - -1 on failure - */ - virtual int getGpsLock(void); - - virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check); - - /* - Check if the modem support the service - */ - virtual bool gnssConstellationConfig(); - - /* - Check if a feature is supported - */ - bool isFeatureSupported(uint8_t featureVal); -}; - -typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - ContextBase *context); - -} // namespace loc_core - -#endif //LOC_API_BASE_H diff --git a/gps/core/LocDualContext.cpp b/gps/core/LocDualContext.cpp deleted file mode 100644 index 74b2903..0000000 --- a/gps/core/LocDualContext.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_DualCtx" - -#include -#include -#include -#include -#include -#include - -namespace loc_core { - -// nothing exclude for foreground -const LOC_API_ADAPTER_EVENT_MASK_T -LocDualContext::mFgExclMask = 0; -// excluded events for background clients -const LOC_API_ADAPTER_EVENT_MASK_T -LocDualContext::mBgExclMask = - (LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | - LOC_API_ADAPTER_BIT_SATELLITE_REPORT | - LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | - LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT | - LOC_API_ADAPTER_BIT_IOCTL_REPORT | - LOC_API_ADAPTER_BIT_STATUS_REPORT | - LOC_API_ADAPTER_BIT_GEOFENCE_GEN_ALERT | - LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT); - -const MsgTask* LocDualContext::mMsgTask = NULL; -ContextBase* LocDualContext::mFgContext = NULL; -ContextBase* LocDualContext::mBgContext = NULL; -ContextBase* LocDualContext::mInjectContext = NULL; -// the name must be shorter than 15 chars -const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; -#ifndef USE_GLIB -const char* LocDualContext::mLBSLibName = "liblbs_core.so"; -#else -const char* LocDualContext::mLBSLibName = "liblbs_core.so.1"; -#endif - -pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER; - -const MsgTask* LocDualContext::getMsgTask(LocThread::tCreate tCreator, - const char* name, bool joinable) -{ - if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tCreator, name, joinable); - } - return mMsgTask; -} - -inline -const MsgTask* LocDualContext::getMsgTask(const char* name, bool joinable) { - return getMsgTask((LocThread::tCreate)NULL, name, joinable); -} - -ContextBase* LocDualContext::getLocFgContext(LocThread::tCreate tCreator, - LocMsg* firstMsg, const char* name, bool joinable) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - LOC_LOGD("%s:%d]: querying ContextBase with tCreator", __func__, __LINE__); - if (NULL == mFgContext) { - LOC_LOGD("%s:%d]: creating msgTask with tCreator", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); - mFgContext = new LocDualContext(msgTask, - mFgExclMask); - } - if(NULL == mInjectContext) { - LOC_LOGD("%s:%d]: mInjectContext is FgContext", __func__, __LINE__); - mInjectContext = mFgContext; - injectFeatureConfig(mInjectContext); - } - pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); - - if (firstMsg) { - mFgContext->sendMsg(firstMsg); - } - - return mFgContext; -} - -ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator, - LocMsg* firstMsg, const char* name, bool joinable) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - LOC_LOGD("%s:%d]: querying ContextBase with tCreator", __func__, __LINE__); - if (NULL == mBgContext) { - LOC_LOGD("%s:%d]: creating msgTask with tCreator", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); - mBgContext = new LocDualContext(msgTask, - mBgExclMask); - } - if(NULL == mInjectContext) { - LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__); - mInjectContext = mBgContext; - injectFeatureConfig(mInjectContext); - } - pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); - - if (firstMsg) { - mBgContext->sendMsg(firstMsg); - } - - return mBgContext; -} - -void LocDualContext :: injectFeatureConfig(ContextBase *curContext) -{ - LOC_LOGD("%s:%d]: Enter", __func__, __LINE__); - if(curContext == mInjectContext) { - LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config", - __func__, __LINE__, ((LocDualContext *)mInjectContext)->mLBSProxy); - ((LocDualContext *)mInjectContext)->mLBSProxy->injectFeatureConfig(curContext); - } - LOC_LOGD("%s:%d]: Exit", __func__, __LINE__); -} - -LocDualContext::LocDualContext(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask) : - ContextBase(msgTask, exMask, mLBSLibName) -{ -} - -} diff --git a/gps/core/LocDualContext.h b/gps/core/LocDualContext.h deleted file mode 100644 index ce77a1a..0000000 --- a/gps/core/LocDualContext.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef __LOC_ENG_CONTEXT__ -#define __LOC_ENG_CONTEXT__ - -#include -#include -#include -#include - -namespace loc_core { - -class LocDualContext : public ContextBase { - static const MsgTask* mMsgTask; - static ContextBase* mFgContext; - static ContextBase* mBgContext; - static ContextBase* mInjectContext; - static const MsgTask* getMsgTask(LocThread::tCreate tCreator, - const char* name, bool joinable = true); - static const MsgTask* getMsgTask(const char* name, bool joinable = true); - static pthread_mutex_t mGetLocContextMutex; - -protected: - LocDualContext(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); - inline virtual ~LocDualContext() {} - -public: - static const char* mLBSLibName; - static const LOC_API_ADAPTER_EVENT_MASK_T mFgExclMask; - static const LOC_API_ADAPTER_EVENT_MASK_T mBgExclMask; - static const char* mLocationHalName; - - static ContextBase* getLocFgContext(LocThread::tCreate tCreator, LocMsg* firstMsg, - const char* name, bool joinable = true); - inline static ContextBase* getLocFgContext(const char* name, bool joinable = true) { - return getLocFgContext(NULL, NULL, name, joinable); - } - static ContextBase* getLocBgContext(LocThread::tCreate tCreator, LocMsg* firstMsg, - const char* name, bool joinable = true); - inline static ContextBase* getLocBgContext(const char* name, bool joinable = true) { - return getLocBgContext(NULL, NULL, name, joinable); - } - - static void injectFeatureConfig(ContextBase *context); -}; - -} - -#endif //__LOC_ENG_CONTEXT__ diff --git a/gps/core/Makefile.am b/gps/core/Makefile.am deleted file mode 100644 index 341153a..0000000 --- a/gps/core/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -AM_CFLAGS = -I./ \ - -I../utils \ - $(LOCPLA_CFLAGS) \ - -I$(WORKSPACE)/gps-noship/flp \ - -D__func__=__PRETTY_FUNCTION__ \ - -fno-short-enums - -libloc_core_la_h_sources = \ - LocApiBase.h \ - LocAdapterBase.h \ - ContextBase.h \ - LocDualContext.h \ - LBSProxyBase.h \ - UlpProxyBase.h \ - gps_extended_c.h \ - gps_extended.h \ - loc_core_log.h \ - LocAdapterProxyBase.h - -libloc_core_la_c_sources = \ - LocApiBase.cpp \ - LocAdapterBase.cpp \ - ContextBase.cpp \ - LocDualContext.cpp \ - loc_core_log.cpp - -library_includedir = $(pkgincludedir)/core - -library_include_HEADERS = $(libloc_core_la_h_sources) - -libloc_core_la_SOURCES = $(libloc_core_la_c_sources) - -if USE_GLIB -libloc_core_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_core_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_core_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_core_la_CFLAGS = $(AM_CFLAGS) -libloc_core_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_core_la_LIBADD = -lstdc++ -ldl $(LOCPLA_LIBS) ../utils/libgps_utils_so.la - -#Create and Install libraries -lib_LTLIBRARIES = libloc_core.la diff --git a/gps/core/UlpProxyBase.h b/gps/core/UlpProxyBase.h deleted file mode 100644 index 2e92bed..0000000 --- a/gps/core/UlpProxyBase.h +++ /dev/null @@ -1,122 +0,0 @@ -/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef ULP_PROXY_BASE_H -#define ULP_PROXY_BASE_H - -#include - -struct FlpExtLocation_s; -struct FlpExtBatchOptions; - -namespace loc_core { - -class LocAdapterBase; - -class UlpProxyBase { -public: - LocPosMode mPosMode; - bool mFixSet; - inline UlpProxyBase() { - mPosMode.mode = LOC_POSITION_MODE_INVALID; - mFixSet = false; - } - inline virtual ~UlpProxyBase() {} - inline virtual bool sendStartFix() { mFixSet = true; return false; } - inline virtual bool sendStopFix() { mFixSet = false; return false; } - inline virtual bool sendFixMode(LocPosMode ¶ms) { - mPosMode = params; - return false; - } - - inline virtual bool reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask) { - (void)location; - (void)locationExtended; - (void)locationExt; - (void)status; - (void)loc_technology_mask; - return false; - } - inline virtual bool reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) { - (void)svStatus; - (void)locationExtended; - (void)svExt; - return false; - } - inline virtual bool reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) { - (void)svMeasurementSet; - return false; - } - - inline virtual bool reportSvPolynomial(GnssSvPolynomial &svPolynomial) - { - (void)svPolynomial; - return false; - } - inline virtual bool reportStatus(GpsStatusValue status) { - - (void)status; - return false; - } - inline virtual void setAdapter(LocAdapterBase* adapter) { - - (void)adapter; - } - inline virtual void setCapabilities(unsigned long capabilities) { - - (void)capabilities; - } - inline virtual bool reportBatchingSession(FlpExtBatchOptions &options, - bool active) { - - (void)options; - (void)active; - return false; - } - inline virtual bool reportPositions(const struct FlpExtLocation_s* locations, - int32_t number_of_locations) { - (void)locations; - (void)number_of_locations; - return false; - } - inline virtual bool reportDeleteAidingData(GpsAidingData aidingData) - { - (void)aidingData; - return false; - } -}; - -} // namespace loc_core - -#endif // ULP_PROXY_BASE_H diff --git a/gps/core/gps_extended.h b/gps/core/gps_extended.h deleted file mode 100644 index 9460d4e..0000000 --- a/gps/core/gps_extended.h +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef GPS_EXTENDED_H -#define GPS_EXTENDED_H - -#include -/** - * @file - * @brief C++ declarations for GPS types - */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#if defined(USE_GLIB) || defined(OFF_TARGET) -#include -#endif - -struct LocPosMode -{ - LocPositionMode mode; - GpsPositionRecurrence recurrence; - uint32_t min_interval; - uint32_t preferred_accuracy; - uint32_t preferred_time; - bool share_position; - char credentials[14]; - char provider[8]; - LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, - uint32_t gap, uint32_t accu, uint32_t time, - bool sp, const char* cred, const char* prov) : - mode(m), recurrence(recr), - min_interval(gap < GPS_MIN_POSSIBLE_FIX_INTERVAL_MS ? - GPS_MIN_POSSIBLE_FIX_INTERVAL_MS : gap), - preferred_accuracy(accu), preferred_time(time), - share_position(sp) { - memset(credentials, 0, sizeof(credentials)); - memset(provider, 0, sizeof(provider)); - if (NULL != cred) { - memcpy(credentials, cred, sizeof(credentials)-1); - } - if (NULL != prov) { - memcpy(provider, prov, sizeof(provider)-1); - } - } - - inline LocPosMode() : - mode(LOC_POSITION_MODE_MS_BASED), - recurrence(GPS_POSITION_RECURRENCE_PERIODIC), - min_interval(GPS_DEFAULT_FIX_INTERVAL_MS), - preferred_accuracy(50), preferred_time(120000), - share_position(true) { - memset(credentials, 0, sizeof(credentials)); - memset(provider, 0, sizeof(provider)); - } - - inline bool equals(const LocPosMode &anotherMode) const - { - return anotherMode.mode == mode && - anotherMode.recurrence == recurrence && - anotherMode.min_interval == min_interval && - anotherMode.preferred_accuracy == preferred_accuracy && - anotherMode.preferred_time == preferred_time && - !strncmp(anotherMode.credentials, credentials, sizeof(credentials)-1) && - !strncmp(anotherMode.provider, provider, sizeof(provider)-1); - } - - void logv() const; -}; - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* GPS_EXTENDED_H */ - diff --git a/gps/core/gps_extended_c.h b/gps/core/gps_extended_c.h deleted file mode 100644 index 6d507d6..0000000 --- a/gps/core/gps_extended_c.h +++ /dev/null @@ -1,1088 +0,0 @@ -/* Copyright (c) 2013-2015, 2016 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef GPS_EXTENDED_C_H -#define GPS_EXTENDED_C_H - -#include -#include -#include -#include -#include -#include - -/** - * @file - * @brief C++ declarations for GPS types - */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** Location has valid source information. */ -#define LOCATION_HAS_SOURCE_INFO 0x0020 -/** GpsLocation has valid "is indoor?" flag */ -#define GPS_LOCATION_HAS_IS_INDOOR 0x0040 -/** GpsLocation has valid floor number */ -#define GPS_LOCATION_HAS_FLOOR_NUMBER 0x0080 -/** GpsLocation has valid map URL*/ -#define GPS_LOCATION_HAS_MAP_URL 0x0100 -/** GpsLocation has valid map index */ -#define GPS_LOCATION_HAS_MAP_INDEX 0x0200 - -/** Sizes for indoor fields */ -#define GPS_LOCATION_MAP_URL_SIZE 400 -#define GPS_LOCATION_MAP_INDEX_SIZE 16 - -/** Position source is ULP */ -#define ULP_LOCATION_IS_FROM_HYBRID 0x0001 -/** Position source is GNSS only */ -#define ULP_LOCATION_IS_FROM_GNSS 0x0002 -/** Position source is ZPP only */ -#define ULP_LOCATION_IS_FROM_ZPP 0x0004 -/** Position is from a Geofence Breach Event */ -#define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 -/** Position is from Hardware FLP */ -#define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 -/** Position is from NLP */ -#define ULP_LOCATION_IS_FROM_NLP 0x0020 -/** Position is from PIP */ -#define ULP_LOCATION_IS_FROM_PIP 0x0040 -/** Position is from external DR solution*/ -#define ULP_LOCATION_IS_FROM_EXT_DR 0X0080 - -#define ULP_MIN_INTERVAL_INVALID 0xffffffff - -/*Emergency SUPL*/ -#define GPS_NI_TYPE_EMERGENCY_SUPL 4 - -#define AGPS_CERTIFICATE_MAX_LENGTH 2000 -#define AGPS_CERTIFICATE_MAX_SLOTS 10 - -enum loc_registration_mask_status { - LOC_REGISTRATION_MASK_ENABLED, - LOC_REGISTRATION_MASK_DISABLED -}; - -typedef enum { - LOC_SUPPORTED_FEATURE_ODCPI_2_V02 = 0, /**< Support ODCPI version 2 feature */ - LOC_SUPPORTED_FEATURE_WIFI_AP_DATA_INJECT_2_V02 /**< Support Wifi AP data inject version 2 feature */ -} loc_supported_feature_enum; - -typedef struct { - /** set to sizeof(UlpLocation) */ - size_t size; - GpsLocation gpsLocation; - /* Provider indicator for HYBRID or GPS */ - uint16_t position_source; - /*allows HAL to pass additional information related to the location */ - int rawDataSize; /* in # of bytes */ - void * rawData; - bool is_indoor; - float floor_number; - char map_url[GPS_LOCATION_MAP_URL_SIZE]; - unsigned char map_index[GPS_LOCATION_MAP_INDEX_SIZE]; -} UlpLocation; - -/** AGPS type */ -typedef int16_t AGpsExtType; -#define AGPS_TYPE_INVALID -1 -#define AGPS_TYPE_ANY 0 -#define AGPS_TYPE_SUPL 1 -#define AGPS_TYPE_C2K 2 -#define AGPS_TYPE_WWAN_ANY 3 -#define AGPS_TYPE_WIFI 4 -#define AGPS_TYPE_SUPL_ES 5 - -/** SSID length */ -#define SSID_BUF_SIZE (32+1) - -typedef int16_t AGpsBearerType; -#define AGPS_APN_BEARER_INVALID -1 -#define AGPS_APN_BEARER_IPV4 0 -#define AGPS_APN_BEARER_IPV6 1 -#define AGPS_APN_BEARER_IPV4V6 2 - -/** GPS extended callback structure. */ -typedef struct { - /** set to sizeof(GpsCallbacks) */ - size_t size; - gps_set_capabilities set_capabilities_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - gps_create_thread create_thread_cb; - gps_request_utc_time request_utc_time_cb; -} GpsExtCallbacks; - -/** Callback to report the xtra server url to the client. - * The client should use this url when downloading xtra unless overwritten - * in the gps.conf file - */ -typedef void (* report_xtra_server)(const char*, const char*, const char*); - -/** Callback structure for the XTRA interface. */ -typedef struct { - gps_xtra_download_request download_request_cb; - gps_create_thread create_thread_cb; - report_xtra_server report_xtra_server_cb; -} GpsXtraExtCallbacks; - -/** Represents the status of AGPS. */ -typedef struct { - /** set to sizeof(AGpsExtStatus) */ - size_t size; - - AGpsExtType type; - AGpsStatusValue status; - uint32_t ipv4_addr; - struct sockaddr_storage addr; - char ssid[SSID_BUF_SIZE]; - char password[SSID_BUF_SIZE]; -} AGpsExtStatus; - -/** Callback with AGPS status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* agps_status_extended)(AGpsExtStatus* status); - -/** Callback structure for the AGPS interface. */ -typedef struct { - agps_status_extended status_cb; - gps_create_thread create_thread_cb; -} AGpsExtCallbacks; - - -typedef void (*loc_ni_notify_callback)(GpsNiNotification *notification, bool esEnalbed); -/** GPS NI callback structure. */ -typedef struct -{ - /** - * Sends the notification request from HAL to GPSLocationProvider. - */ - loc_ni_notify_callback notify_cb; -} GpsNiExtCallbacks; - -typedef enum loc_server_type { - LOC_AGPS_CDMA_PDE_SERVER, - LOC_AGPS_CUSTOM_PDE_SERVER, - LOC_AGPS_MPC_SERVER, - LOC_AGPS_SUPL_SERVER -} LocServerType; - -typedef enum loc_position_mode_type { - LOC_POSITION_MODE_INVALID = -1, - LOC_POSITION_MODE_STANDALONE = 0, - LOC_POSITION_MODE_MS_BASED, - LOC_POSITION_MODE_MS_ASSISTED, - LOC_POSITION_MODE_RESERVED_1, - LOC_POSITION_MODE_RESERVED_2, - LOC_POSITION_MODE_RESERVED_3, - LOC_POSITION_MODE_RESERVED_4, - LOC_POSITION_MODE_RESERVED_5 - -} LocPositionMode; - -/** - * @brief Minimum allowed value for fix interval. - * - * This value is a sanity limit in GPS framework. The hardware has own internal - * limits that may not match this value - * - * @sa GPS_DEFAULT_FIX_INTERVAL_MS - */ - -#define GPS_MIN_POSSIBLE_FIX_INTERVAL_MS 100 -/** - * @brief Default value for fix interval. - * - * This value is used by default whenever appropriate. - * - * @sa GPS_MIN_POSSIBLE_FIX_INTERVAL_MS - */ -#define GPS_DEFAULT_FIX_INTERVAL_MS 1000 - -/** Flags to indicate which values are valid in a GpsLocationExtended. */ -typedef uint16_t GpsLocationExtendedFlags; -/** GpsLocationExtended has valid pdop, hdop, vdop. */ -#define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001 -/** GpsLocationExtended has valid altitude mean sea level. */ -#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL 0x0002 -/** UlpLocation has valid magnetic deviation. */ -#define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004 -/** UlpLocation has valid mode indicator. */ -#define GPS_LOCATION_EXTENDED_HAS_MODE_IND 0x0008 -/** GpsLocationExtended has valid vertical uncertainty */ -#define GPS_LOCATION_EXTENDED_HAS_VERT_UNC 0x0010 -/** GpsLocationExtended has valid speed uncertainty */ -#define GPS_LOCATION_EXTENDED_HAS_SPEED_UNC 0x0020 -/** GpsLocationExtended has valid heading uncertainty */ -#define GPS_LOCATION_EXTENDED_HAS_BEARING_UNC 0x0040 -/** GpsLocationExtended has valid horizontal reliability */ -#define GPS_LOCATION_EXTENDED_HAS_HOR_RELIABILITY 0x0080 -/** GpsLocationExtended has valid vertical reliability */ -#define GPS_LOCATION_EXTENDED_HAS_VERT_RELIABILITY 0x0100 -/** GpsLocationExtended has valid Horizontal Elliptical Uncertainty (Semi-Major Axis) */ -#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MAJOR 0x0200 -/** GpsLocationExtended has valid Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ -#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MINOR 0x0400 -/** GpsLocationExtended has valid Elliptical Horizontal Uncertainty Azimuth */ -#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_AZIMUTH 0x0800 -/** GpsLocationExtended has valid gnss sv used in position data */ -#define GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA 0x1000 - -/** GPS PRN Range */ -#define GPS_SV_PRN_MIN 1 -#define GPS_SV_PRN_MAX 32 -#define GLO_SV_PRN_MIN 65 -#define GLO_SV_PRN_MAX 96 -#define BDS_SV_PRN_MIN 201 -#define BDS_SV_PRN_MAX 235 -#define GAL_SV_PRN_MIN 301 -#define GAL_SV_PRN_MAX 336 - -typedef enum { - LOC_RELIABILITY_NOT_SET = 0, - LOC_RELIABILITY_VERY_LOW = 1, - LOC_RELIABILITY_LOW = 2, - LOC_RELIABILITY_MEDIUM = 3, - LOC_RELIABILITY_HIGH = 4 -}LocReliability; - -typedef struct { - struct timespec apTimeStamp; - /*boottime received from pps-ktimer*/ - float apTimeStampUncertaintyMs; - /* timestamp uncertainty in milli seconds */ -}Gnss_ApTimeStampStructType; - -typedef struct { - uint64_t gps_sv_used_ids_mask; - uint64_t glo_sv_used_ids_mask; - uint64_t gal_sv_used_ids_mask; - uint64_t bds_sv_used_ids_mask; -} GnssSvUsedInPosition; - -/** Represents gps location extended. */ -typedef struct { - /** set to sizeof(GpsLocationExtended) */ - size_t size; - /** Contains GpsLocationExtendedFlags bits. */ - uint16_t flags; - /** Contains the Altitude wrt mean sea level */ - float altitudeMeanSeaLevel; - /** Contains Position Dilusion of Precision. */ - float pdop; - /** Contains Horizontal Dilusion of Precision. */ - float hdop; - /** Contains Vertical Dilusion of Precision. */ - float vdop; - /** Contains Magnetic Deviation. */ - float magneticDeviation; - /** vertical uncertainty in meters */ - float vert_unc; - /** speed uncertainty in m/s */ - float speed_unc; - /** heading uncertainty in degrees (0 to 359.999) */ - float bearing_unc; - /** horizontal reliability. */ - LocReliability horizontal_reliability; - /** vertical reliability. */ - LocReliability vertical_reliability; - /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ - float horUncEllipseSemiMajor; - /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ - float horUncEllipseSemiMinor; - /* Elliptical Horizontal Uncertainty Azimuth */ - float horUncEllipseOrientAzimuth; - - Gnss_ApTimeStampStructType timeStamp; - /** Gnss sv used in position data */ - GnssSvUsedInPosition gnss_sv_used_ids; -} GpsLocationExtended; - -enum loc_sess_status { - LOC_SESS_SUCCESS, - LOC_SESS_INTERMEDIATE, - LOC_SESS_FAILURE -}; - -typedef uint32_t LocPosTechMask; -#define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000) -#define LOC_POS_TECH_MASK_SATELLITE ((LocPosTechMask)0x00000001) -#define LOC_POS_TECH_MASK_CELLID ((LocPosTechMask)0x00000002) -#define LOC_POS_TECH_MASK_WIFI ((LocPosTechMask)0x00000004) -#define LOC_POS_TECH_MASK_SENSORS ((LocPosTechMask)0x00000008) -#define LOC_POS_TECH_MASK_REFERENCE_LOCATION ((LocPosTechMask)0x00000010) -#define LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION ((LocPosTechMask)0x00000020) -#define LOC_POS_TECH_MASK_AFLT ((LocPosTechMask)0x00000040) -#define LOC_POS_TECH_MASK_HYBRID ((LocPosTechMask)0x00000080) - -// Nmea sentence types mask -typedef uint32_t NmeaSentenceTypesMask; -#define LOC_NMEA_MASK_GGA_V02 ((NmeaSentenceTypesMask)0x00000001) /**< Enable GGA type */ -#define LOC_NMEA_MASK_RMC_V02 ((NmeaSentenceTypesMask)0x00000002) /**< Enable RMC type */ -#define LOC_NMEA_MASK_GSV_V02 ((NmeaSentenceTypesMask)0x00000004) /**< Enable GSV type */ -#define LOC_NMEA_MASK_GSA_V02 ((NmeaSentenceTypesMask)0x00000008) /**< Enable GSA type */ -#define LOC_NMEA_MASK_VTG_V02 ((NmeaSentenceTypesMask)0x00000010) /**< Enable VTG type */ -#define LOC_NMEA_MASK_PQXFI_V02 ((NmeaSentenceTypesMask)0x00000020) /**< Enable PQXFI type */ -#define LOC_NMEA_MASK_PSTIS_V02 ((NmeaSentenceTypesMask)0x00000040) /**< Enable PSTIS type */ -#define LOC_NMEA_MASK_GLGSV_V02 ((NmeaSentenceTypesMask)0x00000080) /**< Enable GLGSV type */ -#define LOC_NMEA_MASK_GNGSA_V02 ((NmeaSentenceTypesMask)0x00000100) /**< Enable GNGSA type */ -#define LOC_NMEA_MASK_GNGNS_V02 ((NmeaSentenceTypesMask)0x00000200) /**< Enable GNGNS type */ -#define LOC_NMEA_MASK_GARMC_V02 ((NmeaSentenceTypesMask)0x00000400) /**< Enable GARMC type */ -#define LOC_NMEA_MASK_GAGSV_V02 ((NmeaSentenceTypesMask)0x00000800) /**< Enable GAGSV type */ -#define LOC_NMEA_MASK_GAGSA_V02 ((NmeaSentenceTypesMask)0x00001000) /**< Enable GAGSA type */ -#define LOC_NMEA_MASK_GAVTG_V02 ((NmeaSentenceTypesMask)0x00002000) /**< Enable GAVTG type */ -#define LOC_NMEA_MASK_GAGGA_V02 ((NmeaSentenceTypesMask)0x00004000) /**< Enable GAGGA type */ -#define LOC_NMEA_MASK_PQGSA_V02 ((NmeaSentenceTypesMask)0x00008000) /**< Enable PQGSA type */ -#define LOC_NMEA_MASK_PQGSV_V02 ((NmeaSentenceTypesMask)0x00010000) /**< Enable PQGSV type */ -#define LOC_NMEA_ALL_SUPPORTED_MASK (LOC_NMEA_MASK_GGA_V02 | LOC_NMEA_MASK_RMC_V02 | \ - LOC_NMEA_MASK_GSV_V02 | LOC_NMEA_MASK_GSA_V02 | LOC_NMEA_MASK_VTG_V02 | \ - LOC_NMEA_MASK_PQXFI_V02 | LOC_NMEA_MASK_PSTIS_V02 | LOC_NMEA_MASK_GLGSV_V02 | \ - LOC_NMEA_MASK_GNGSA_V02 | LOC_NMEA_MASK_GNGNS_V02 | LOC_NMEA_MASK_GARMC_V02 | \ - LOC_NMEA_MASK_GAGSV_V02 | LOC_NMEA_MASK_GAGSA_V02 | LOC_NMEA_MASK_GAVTG_V02 | \ - LOC_NMEA_MASK_GAGGA_V02 | LOC_NMEA_MASK_PQGSA_V02 | LOC_NMEA_MASK_PQGSV_V02 ) - - - -typedef enum { - LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0, - LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM, - LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU, - LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, - LOC_ENG_IF_REQUEST_SENDER_ID_MODEM, - LOC_ENG_IF_REQUEST_SENDER_ID_UNKNOWN -} loc_if_req_sender_id_e_type; - - -#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) -#define MAX_APN_LEN 100 - -// This will be overridden by the individual adapters -// if necessary. -#define DEFAULT_IMPL(rtv) \ -{ \ - LOC_LOGD("%s: default implementation invoked", __func__); \ - return rtv; \ -} - -enum loc_api_adapter_err { - LOC_API_ADAPTER_ERR_SUCCESS = 0, - LOC_API_ADAPTER_ERR_GENERAL_FAILURE = 1, - LOC_API_ADAPTER_ERR_UNSUPPORTED = 2, - LOC_API_ADAPTER_ERR_INVALID_HANDLE = 4, - LOC_API_ADAPTER_ERR_INVALID_PARAMETER = 5, - LOC_API_ADAPTER_ERR_ENGINE_BUSY = 6, - LOC_API_ADAPTER_ERR_PHONE_OFFLINE = 7, - LOC_API_ADAPTER_ERR_TIMEOUT = 8, - LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT = 9, - LOC_API_ADAPTER_ERR_INTERNAL = 10, - - /* equating engine down to phone offline, as they are the same errror */ - LOC_API_ADAPTER_ERR_ENGINE_DOWN = LOC_API_ADAPTER_ERR_PHONE_OFFLINE, - LOC_API_ADAPTER_ERR_FAILURE = 101, - LOC_API_ADAPTER_ERR_UNKNOWN -}; - -enum loc_api_adapter_event_index { - LOC_API_ADAPTER_REPORT_POSITION = 0, // Position report comes in loc_parsed_position_s_type - LOC_API_ADAPTER_REPORT_SATELLITE, // Satellite in view report - LOC_API_ADAPTER_REPORT_NMEA_1HZ, // NMEA report at 1HZ rate - LOC_API_ADAPTER_REPORT_NMEA_POSITION, // NMEA report at position report rate - LOC_API_ADAPTER_REQUEST_NI_NOTIFY_VERIFY, // NI notification/verification request - LOC_API_ADAPTER_REQUEST_ASSISTANCE_DATA, // Assistance data, eg: time, predicted orbits request - LOC_API_ADAPTER_REQUEST_LOCATION_SERVER, // Request for location server - LOC_API_ADAPTER_REPORT_IOCTL, // Callback report for loc_ioctl - LOC_API_ADAPTER_REPORT_STATUS, // Misc status report: eg, engine state - LOC_API_ADAPTER_REQUEST_WIFI, // - LOC_API_ADAPTER_SENSOR_STATUS, // - LOC_API_ADAPTER_REQUEST_TIME_SYNC, // - LOC_API_ADAPTER_REPORT_SPI, // - LOC_API_ADAPTER_REPORT_NI_GEOFENCE, // - LOC_API_ADAPTER_GEOFENCE_GEN_ALERT, // - LOC_API_ADAPTER_REPORT_GENFENCE_BREACH, // - LOC_API_ADAPTER_PEDOMETER_CTRL, // - LOC_API_ADAPTER_MOTION_CTRL, // - LOC_API_ADAPTER_REQUEST_WIFI_AP_DATA, // Wifi ap data - LOC_API_ADAPTER_BATCH_FULL, // Batching on full - LOC_API_ADAPTER_BATCHED_POSITION_REPORT, // Batching on fix - LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT, // - LOC_API_ADAPTER_GNSS_MEASUREMENT_REPORT, //GNSS Measurement Report - LOC_API_ADAPTER_GNSS_SV_POLYNOMIAL_REPORT, //GNSS SV Polynomial Report - LOC_API_ADAPTER_GDT_UPLOAD_BEGIN_REQ, // GDT upload start request - LOC_API_ADAPTER_GDT_UPLOAD_END_REQ, // GDT upload end request - LOC_API_ADAPTER_GNSS_MEASUREMENT, // GNSS Measurement report - LOC_API_ADAPTER_REQUEST_TIMEZONE, // Timezone injection request - LOC_API_ADAPTER_REPORT_GENFENCE_DWELL_REPORT, // Geofence dwell report - LOC_API_ADAPTER_EVENT_MAX -}; - -#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< -#include -#include - -void LocPosMode::logv() const -{ - LOC_LOGV ("Position mode: %s\n Position recurrence: %s\n " - "min interval: %d\n preferred accuracy: %d\n " - "preferred time: %d\n credentials: %s provider: %s", - loc_get_position_mode_name(mode), - loc_get_position_recurrence_name(recurrence), - min_interval, - preferred_accuracy, - preferred_time, - credentials, - provider); -} - -/* GPS status names */ -static const loc_name_val_s_type gps_status_name[] = -{ - NAME_VAL( GPS_STATUS_NONE ), - NAME_VAL( GPS_STATUS_SESSION_BEGIN ), - NAME_VAL( GPS_STATUS_SESSION_END ), - NAME_VAL( GPS_STATUS_ENGINE_ON ), - NAME_VAL( GPS_STATUS_ENGINE_OFF ), -}; -static const int gps_status_num = sizeof(gps_status_name) / sizeof(loc_name_val_s_type); - -/* Find Android GPS status name */ -const char* loc_get_gps_status_name(GpsStatusValue gps_status) -{ - return loc_get_name_from_val(gps_status_name, gps_status_num, - (long) gps_status); -} - - - -static const loc_name_val_s_type loc_eng_position_modes[] = -{ - NAME_VAL( LOC_POSITION_MODE_STANDALONE ), - NAME_VAL( LOC_POSITION_MODE_MS_BASED ), - NAME_VAL( LOC_POSITION_MODE_MS_ASSISTED ), - NAME_VAL( LOC_POSITION_MODE_RESERVED_1 ), - NAME_VAL( LOC_POSITION_MODE_RESERVED_2 ), - NAME_VAL( LOC_POSITION_MODE_RESERVED_3 ), - NAME_VAL( LOC_POSITION_MODE_RESERVED_4 ), - NAME_VAL( LOC_POSITION_MODE_RESERVED_5 ) -}; -static const int loc_eng_position_mode_num = sizeof(loc_eng_position_modes) / sizeof(loc_name_val_s_type); - -const char* loc_get_position_mode_name(GpsPositionMode mode) -{ - return loc_get_name_from_val(loc_eng_position_modes, loc_eng_position_mode_num, (long) mode); -} - - - -static const loc_name_val_s_type loc_eng_position_recurrences[] = -{ - NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), - NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) -}; -static const int loc_eng_position_recurrence_num = sizeof(loc_eng_position_recurrences) / sizeof(loc_name_val_s_type); - -const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur) -{ - return loc_get_name_from_val(loc_eng_position_recurrences, loc_eng_position_recurrence_num, (long) recur); -} - - - -static const loc_name_val_s_type loc_eng_aiding_data_bits[] = -{ - NAME_VAL( GPS_DELETE_EPHEMERIS ), - NAME_VAL( GPS_DELETE_ALMANAC ), - NAME_VAL( GPS_DELETE_POSITION ), - NAME_VAL( GPS_DELETE_TIME ), - NAME_VAL( GPS_DELETE_IONO ), - NAME_VAL( GPS_DELETE_UTC ), - NAME_VAL( GPS_DELETE_HEALTH ), - NAME_VAL( GPS_DELETE_SVDIR ), - NAME_VAL( GPS_DELETE_SVSTEER ), - NAME_VAL( GPS_DELETE_SADATA ), - NAME_VAL( GPS_DELETE_RTI ), - NAME_VAL( GPS_DELETE_CELLDB_INFO ), - NAME_VAL( GPS_DELETE_ALL) -}; -static const int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); - -const char* loc_get_aiding_data_mask_names(GpsAidingData data) -{ - return NULL; -} - - -static const loc_name_val_s_type loc_eng_agps_types[] = -{ - NAME_VAL( AGPS_TYPE_INVALID ), - NAME_VAL( AGPS_TYPE_ANY ), - NAME_VAL( AGPS_TYPE_SUPL ), - NAME_VAL( AGPS_TYPE_C2K ), - NAME_VAL( AGPS_TYPE_WWAN_ANY ) -}; -static const int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type); - -const char* loc_get_agps_type_name(AGpsType type) -{ - return loc_get_name_from_val(loc_eng_agps_types, loc_eng_agps_type_num, (long) type); -} - - -static const loc_name_val_s_type loc_eng_ni_types[] = -{ - NAME_VAL( GPS_NI_TYPE_VOICE ), - NAME_VAL( GPS_NI_TYPE_UMTS_SUPL ), - NAME_VAL( GPS_NI_TYPE_UMTS_CTRL_PLANE ), - NAME_VAL( GPS_NI_TYPE_EMERGENCY_SUPL ) -}; -static const int loc_eng_ni_type_num = sizeof(loc_eng_ni_types) / sizeof(loc_name_val_s_type); - -const char* loc_get_ni_type_name(GpsNiType type) -{ - return loc_get_name_from_val(loc_eng_ni_types, loc_eng_ni_type_num, (long) type); -} - - -static const loc_name_val_s_type loc_eng_ni_responses[] = -{ - NAME_VAL( GPS_NI_RESPONSE_ACCEPT ), - NAME_VAL( GPS_NI_RESPONSE_DENY ), - NAME_VAL( GPS_NI_RESPONSE_DENY ) -}; -static const int loc_eng_ni_reponse_num = sizeof(loc_eng_ni_responses) / sizeof(loc_name_val_s_type); - -const char* loc_get_ni_response_name(GpsUserResponseType response) -{ - return loc_get_name_from_val(loc_eng_ni_responses, loc_eng_ni_reponse_num, (long) response); -} - - -static const loc_name_val_s_type loc_eng_ni_encodings[] = -{ - NAME_VAL( GPS_ENC_NONE ), - NAME_VAL( GPS_ENC_SUPL_GSM_DEFAULT ), - NAME_VAL( GPS_ENC_SUPL_UTF8 ), - NAME_VAL( GPS_ENC_SUPL_UCS2 ), - NAME_VAL( GPS_ENC_UNKNOWN ) -}; -static const int loc_eng_ni_encoding_num = sizeof(loc_eng_ni_encodings) / sizeof(loc_name_val_s_type); - -const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding) -{ - return loc_get_name_from_val(loc_eng_ni_encodings, loc_eng_ni_encoding_num, (long) encoding); -} - -static const loc_name_val_s_type loc_eng_agps_bears[] = -{ - NAME_VAL( AGPS_APN_BEARER_INVALID ), - NAME_VAL( AGPS_APN_BEARER_IPV4 ), - NAME_VAL( AGPS_APN_BEARER_IPV6 ), - NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) -}; -static const int loc_eng_agps_bears_num = sizeof(loc_eng_agps_bears) / sizeof(loc_name_val_s_type); - -const char* loc_get_agps_bear_name(AGpsBearerType bearer) -{ - return loc_get_name_from_val(loc_eng_agps_bears, loc_eng_agps_bears_num, (long) bearer); -} - -static const loc_name_val_s_type loc_eng_server_types[] = -{ - NAME_VAL( LOC_AGPS_CDMA_PDE_SERVER ), - NAME_VAL( LOC_AGPS_CUSTOM_PDE_SERVER ), - NAME_VAL( LOC_AGPS_MPC_SERVER ), - NAME_VAL( LOC_AGPS_SUPL_SERVER ) -}; -static const int loc_eng_server_types_num = sizeof(loc_eng_server_types) / sizeof(loc_name_val_s_type); - -const char* loc_get_server_type_name(LocServerType type) -{ - return loc_get_name_from_val(loc_eng_server_types, loc_eng_server_types_num, (long) type); -} - -static const loc_name_val_s_type loc_eng_position_sess_status_types[] = -{ - NAME_VAL( LOC_SESS_SUCCESS ), - NAME_VAL( LOC_SESS_INTERMEDIATE ), - NAME_VAL( LOC_SESS_FAILURE ) -}; -static const int loc_eng_position_sess_status_num = sizeof(loc_eng_position_sess_status_types) / sizeof(loc_name_val_s_type); - -const char* loc_get_position_sess_status_name(enum loc_sess_status status) -{ - return loc_get_name_from_val(loc_eng_position_sess_status_types, loc_eng_position_sess_status_num, (long) status); -} - -static const loc_name_val_s_type loc_eng_agps_status_names[] = -{ - NAME_VAL( GPS_REQUEST_AGPS_DATA_CONN ), - NAME_VAL( GPS_RELEASE_AGPS_DATA_CONN ), - NAME_VAL( GPS_AGPS_DATA_CONNECTED ), - NAME_VAL( GPS_AGPS_DATA_CONN_DONE ), - NAME_VAL( GPS_AGPS_DATA_CONN_FAILED ) -}; -static const int loc_eng_agps_status_num = sizeof(loc_eng_agps_status_names) / sizeof(loc_name_val_s_type); - -const char* loc_get_agps_status_name(AGpsStatusValue status) -{ - return loc_get_name_from_val(loc_eng_agps_status_names, loc_eng_agps_status_num, (long) status); -} diff --git a/gps/core/loc_core_log.h b/gps/core/loc_core_log.h deleted file mode 100644 index 8a1825a..0000000 --- a/gps/core/loc_core_log.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_CORE_LOG_H -#define LOC_CORE_LOG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include - -const char* loc_get_gps_status_name(GpsStatusValue gps_status); -const char* loc_get_position_mode_name(GpsPositionMode mode); -const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur); -const char* loc_get_aiding_data_mask_names(GpsAidingData data); -const char* loc_get_agps_type_name(AGpsType type); -const char* loc_get_ni_type_name(GpsNiType type); -const char* loc_get_ni_response_name(GpsUserResponseType response); -const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding); -const char* loc_get_agps_bear_name(AGpsBearerType bear); -const char* loc_get_server_type_name(LocServerType type); -const char* loc_get_position_sess_status_name(enum loc_sess_status status); -const char* loc_get_agps_status_name(AGpsStatusValue status); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_CORE_LOG_H */ diff --git a/gps/etc/flp.conf b/gps/etc/flp.conf deleted file mode 100644 index a424121..0000000 --- a/gps/etc/flp.conf +++ /dev/null @@ -1,60 +0,0 @@ -################################### -##### FLP settings ##### -################################### - -################################### -# FLP BATCHING SIZE -################################### -# The number of batched locations -# requested to modem. The desired number -# defined below may not be satisfied, as -# the modem can only return the number -# of batched locations that can be allocated, -# which is limited by memory. The default -# batch size defined as 20 as below. -BATCH_SIZE=20 - -################################### -# FLP BATCHING SESSION TIMEOUT -################################### -# Duration with which batch session timeout -# happens in milliseconds. If not specified -# or set to zero, batching session timeout -# defaults to 20 seconds by the modem. -# BATCH_SESSION_TIMEOUT=20000 - -################################### -# FLP CAPABILITIES BIT MASK -################################### -# GEOFENCE = 0x01 -# BATCHING = 0x02 -# default = GEOFENCE | BATCHING -CAPABILITIES=0x03 - -################################### -# FLP BATCHING ACCURACY -################################### -# Set to one of the defined values below -# to define the accuracy of batching. -# If not specified, accuracy defaults -# to LOW. -# FLP BATCHING ACCURACY values: -# Low accuracy = 0 -# Medium accuracy = 1 -# High accuracy = 2 -ACCURACY=1 - -################################### -# FLP GEOFENCE RESPONSIVENESS -################################### -# If set to one of the defined values below, -# it will override the responsiveness for -# FLP geofence, which implements the fused -# location API. If not set to a value defined -# below, which is default, it will not -# override the responsivness. -# FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE Values: -# 1: LOW responsiveness -# 2: MEDIUM responsiveness -# 3: HIGH responsiveness -FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE = 0 diff --git a/gps/etc/gps.conf b/gps/etc/gps.conf deleted file mode 100644 index df27575..0000000 --- a/gps/etc/gps.conf +++ /dev/null @@ -1,182 +0,0 @@ -#URLs from which to download XTRA data -XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin -XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin -XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin - -#Version check for XTRA -#DISABLE = 0 -#AUTO = 1 -#XTRA2 = 2 -#XTRA3 = 3 -XTRA_VERSION_CHECK=1 - -# Error Estimate -# _SET = 1 -# _CLEAR = 0 -ERR_ESTIMATE=0 - -#NTP server -NTP_SERVER=time.izatcloud.net - -#XTRA CA path -XTRA_CA_PATH=/system/etc/security/cacerts - -# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info -# 4 - Debug, 5 - Verbose -# If DEBUG_LEVEL is commented, Android's logging levels will be used -DEBUG_LEVEL = 3 - -# Intermediate position report, 1=enable, 0=disable -INTERMEDIATE_POS=0 - -# Below bit mask configures how GPS functionalities -# should be locked when user turns off GPS on Settings -# Set bit 0x1 if MO GPS functionalities are to be locked -# Set bit 0x2 if NI GPS functionalities are to be locked -# default - non is locked for backward compatibility -#GPS_LOCK = 0 - -# supl version 1.0 -SUPL_VER=0x10000 - -# Emergency SUPL, 1=enable, 0=disable -SUPL_ES=0 - -#Choose PDN for Emergency SUPL -#1 - Use emergency PDN -#0 - Use regular SUPL PDN for Emergency SUPL -USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=0 - -#SUPL_MODE is a bit mask set in config.xml per carrier by default. -#If it is uncommented here, this value will overwrite the value from -#config.xml. -#MSA=0X2 -#MSB=0X1 -#SUPL_MODE= - -# GPS Capabilities bit mask -# SCHEDULING = 0x01 -# MSB = 0x02 -# MSA = 0x04 -# ON_DEMAND_TIME = 0x10 -# GEOFENCE = 0x20 -# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE -CAPABILITIES=0x37 - -# Accuracy threshold for intermediate positions -# less accurate positions are ignored, 0 for passing all positions -# ACCURACY_THRES=5000 - -################################ -##### AGPS server settings ##### -################################ - -# FOR SUPL SUPPORT, set the following -# SUPL_HOST=supl.host.com or IP -# SUPL_PORT=1234 - -# FOR C2K PDE SUPPORT, set the following -# C2K_HOST=c2k.pde.com or IP -# C2K_PORT=1234 - -# Bitmask of slots that are available -# for write/install to, where 1s indicate writable, -# and the default value is 0 where no slots -# are writable. For example, AGPS_CERT_WRITABLE_MASK -# of b1000001010 makes 3 slots available -# and the remaining 7 slots unwritable. -#AGPS_CERT_WRITABLE_MASK=0 - -#################################### -# LTE Positioning Profile Settings -#################################### -# 0: Enable RRLP on LTE(Default) -# 1: Enable LPP_User_Plane on LTE -# 2: Enable LPP_Control_Plane -# 3: Enable both LPP_User_Plane and LPP_Control_Plane -LPP_PROFILE = 2 - -################################ -# EXTRA SETTINGS -################################ -# NMEA provider (1=Modem Processor, 0=Application Processor) -NMEA_PROVIDER=0 -# Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE) -SGLTE_TARGET=0 - -################################################## -# Select Positioning Protocol on A-GLONASS system -################################################## -# 0x1: RRC CPlane -# 0x2: RRLP UPlane -# 0x4: LLP Uplane -A_GLONASS_POS_PROTOCOL_SELECT = 0 - -################################################## -# Select technology for LPPe Control Plane -################################################## -# 0x1: DBH for LPPe CP -# 0x2: WLAN AP Measurements for LPPe CP -LPPE_CP_TECHNOLOGY = 0 - -################################################## -# Select technology for LPPe User Plane -################################################## -# 0x1: DBH for LPPe UP -# 0x2: WLAN AP Measurements for LPPe UP -LPPE_UP_TECHNOLOGY = 0 - -################################################## -# AGPS_CONFIG_INJECT -################################################## -# enable/disable injection of AGPS configurations: -# SUPL_VER -# SUPL_HOST -# SUPL_PORT -# C2K_HOST -# C2K_PORT -# LPP_PROFILE -# A_GLONASS_POS_PROTOCOL_SELECT -# 0: disable -# 1: enable -AGPS_CONFIG_INJECT = 1 -# AP Coarse Timestamp Uncertainty -################################################## -# default : 10 -# or as per clock uncertainty of product -AP_TIMESTAMP_UNCERTAINTY = 10 - -##################################### -# GNSS PPS settings -##################################### -#AP DR engine availability status -# 0 : NO AP DR (default) -# 1 : AP DR enabled -#EXTERNAL_DR_ENABLED = 0 - -##################################### -#DR_SYNC Pulse Availability -##################################### -# 0 : DR_SYNC pulse not available (default) -# 1 : DR_SYNC pulse available -DR_SYNC_ENABLED = 0 - -##################################### -#PPS Device name -##################################### -PPS_DEVICENAME = /dev/pps0 - -##################################### -#AP Clock Accuracy -##################################### -AP_CLOCK_PPM = 100 - -##################################### -#MAX ms difference to detect missing pulse -##################################### -MISSING_PULSE_TIME_DELTA = 900 - -##################################### -#Propagation time uncertainty -##################################### -PROPAGATION_TIME_UNCERTAINTY = 1 diff --git a/gps/etc/izat.conf b/gps/etc/izat.conf deleted file mode 100644 index 3149719..0000000 --- a/gps/etc/izat.conf +++ /dev/null @@ -1,233 +0,0 @@ -######################################### -# Log verbosity control for izat modules -######################################### -# OFF = 0, ERROR = 1, WARNING = 2, INFO = 3, DEBUG = 4, VERBOSE = 5 -IZAT_DEBUG_LEVEL = 2 - -################################################## -# Select WIFI Wait Timeout value in seconds for SUPL -################################################## -WIFI_WAIT_TIMEOUT_SELECT = 0 - -################################ -# NLP Settings -################################ -# NLP_MODE 1: OSNLP Only, 2: QNP Only, 3: Combo, 4: QNP preferred -# NLP_TOLERANCE_TIME_FIRST: Time in ms used in Combo mode -# to determine how much Tolerance for first position -# NLP_TOLERANCE_TIME_AFTER: Time in ms used in Combo mode -# to determine how much Tolerance for positions after first -# NLP_THRESHOLD: Sets how many failures needed before -# switching preferred NLP in Combo mode -# NLP_ACCURACY_MULTIPLE: Determines how far off the accuracy -# must be, in multiples, between two NLP location reports to -# be considered much worse accuracy. Used in switching logic -# NLP COMBO MODE USES QNP WITH NO EULA CONSENT: Determines -# whether or not to still send network location requests to -# QNP when the EULA is not consented to by the user. QNP can -# still return ZPP locations or injected locations even -# without EULA consent, but the uncertainty can be high. -# QNP preferred mode prefers QNP when there is EULA consent, -# otherwise OSNLP is used. -NLP_MODE = 3 -NLP_MODE_EMERGENCY = 2 -NLP_TOLERANCE_TIME_FIRST = 5000 -NLP_TOLERANCE_TIME_AFTER = 20000 -NLP_THRESHOLD = 3 -NLP_ACCURACY_MULTIPLE = 2 -NLP_COMBO_MODE_USES_QNP_WITH_NO_EULA_CONSENT = 1 - -######################################### -# NLP PACKAGE AND ACTION SETTINGS -######################################### -# OSNLP_PACKAGE/OSNLP_ACTION: name/action of default NLP package -OSNLP_PACKAGE = com.google.android.gms -OSNLP_ACTION = com.android.location.service.v3.NetworkLocationProvider -# REGION_OSNLP_PACKAGE/REGION_OSNLP_ACTION: -# These two values will be used as alternative -# for particular region where default NLP is not functional. -#REGION_OSNLP_PACKAGE = com.baidu.map.location -#REGION_OSNLP_ACTION = com.android.location.service.v3.NetworkLocationProvider - -# Threshold period for ZPP triggers -ZPP_TRIGGER_THRESHOLD=60000 - -################################### -# GEOFENCE SERVICES -################################### -# If set to one of the defined values below, it will override -# the responsiveness for geofence services, which implements -# the Proximity Alert API. If not set to a value defined below, -# which is default, it will not override the responsivness. -# The geofence HAL API is unaffected by this value. -# GEOFENCE_SERVICES_RESPONSIVENESS_OVERRIDE Values: -# 1: LOW responsiveness -# 2: MEDIUM responsiveness -# 3: HIGH responsiveness -GEOFENCE_SERVICES_RESPONSIVENESS_OVERRIDE = 0 - -##################################### -# IZAT PREMIUM FEATURE SETTINGS -##################################### -#Possible states of a feature: -#DISABLED -#BASIC -#PREMIUM - -#GTP_CELL_PROC valid options: -# AP -# MODEM -GTP_CELL_PROC=MODEM - -#GTP_CELL valid modes: -# DISABLED -# BASIC -GTP_CELL=BASIC - -#GTP_WIFI valid modes: -# DISABLED -# BASIC -GTP_WIFI=BASIC - -#GTP_WAA valid modes: -# DISABLED -# BASIC -GTP_WAA=DISABLED - -#SAP valid modes: -# DISABLED -# BASIC -# PREMIUM -SAP=BASIC - -#ODCPI valid modes: -#DISABLED -#BASIC -ODCPI=BASIC - -#FREE_WIFI_SCAN_INJECT valid modes: -#DISABLED -#BASIC -FREE_WIFI_SCAN_INJECT=BASIC - -#SUPL_WIFI valid modes: -#DISABLED -#BASIC -SUPL_WIFI=BASIC - -#WIFI_SUPPLICANT_INFO valid modes: -#DISABLED -#BASIC -WIFI_SUPPLICANT_INFO=BASIC - -##################################### -# Location process launcher settings -##################################### - -# DO NOT MODIFY -# Modifying below attributes without -# caution can have serious implications. - -#Values for PROCESS_STATE: -# ENABLED -# DISABLED - -#FEATURE MASKS: -# GTP-WIFI 0X03 -# GTP-AP-CELL 0X0c -# GTP-MP-CELL 0xc00 -# GTP-WAA 0X300 -# SAP 0Xc0 -# ODCPI 0x1000 -# FREE_WIFI_SCAN_INJECT 0x2000 -# SUPL_WIFI 0x4000 -# WIFI_SUPPLICANT_INFO 0x8000 - -#Values for PLATFORMS can be: -#1. Any valid values obtained from ro.board.platform separated by single space. For example: msm8960 msm8226 -#2. 'all' or 'all exclude' -> for All platforms -#3. 'all exclude XXXX' -> All platforms exclude XXXX. For example: all exclude msm8937 - -#Values for BASEBAND can be: -#1. Any valid values obtained from ro.baseband separated by single space. For example: sglte sglte2 -#2. 'all' or 'all exclude' -> for all basebands -#3. 'all exclude XXXX' -> All basebands exclude XXXX. For example: all exclude sglte -PROCESS_NAME=/system/bin/DR_AP_Service -PROCESS_ARGUMENT= -PROCESS_STATE=DISABLED -PROCESS_GROUPS=gps net_raw diag qcom_diag -PREMIUM_FEATURE=0 -IZAT_FEATURE_MASK=0 -PLATFORMS=all -BASEBAND=all -LEAN_TARGETS=DISABLED -HARDWARE_TYPE=automotive - -#Valyes for LEAN_TARGETS can be: -#ENABLED -> if this process is supposed to run on lean and mean targets -#DISABLED -> if this process is to be disabled on lean and mean targets -PROCESS_NAME=/system/bin/garden_app -PROCESS_ARGUMENT=-u 0 -q 0 -j 0 -g 0 -l 0 -Z 0 -T 1 -PROCESS_STATE=ENABLED -PROCESS_GROUPS=gps -PREMIUM_FEATURE=0 -IZAT_FEATURE_MASK=0 -PLATFORMS=all -BASEBAND=all -LEAN_TARGETS=DISABLED -HARDWARE_TYPE=automotive - -PROCESS_NAME=/system/bin/gpsone_daemon -PROCESS_ARGUMENT= -PROCESS_STATE=ENABLED -PROCESS_GROUPS=inet -PREMIUM_FEATURE=0 -IZAT_FEATURE_MASK=0 -PLATFORMS=msm7630_fusion -BASEBAND=svlte2a sglte sglte2 -LEAN_TARGETS=DISABLED -HARDWARE_TYPE=all - -PROCESS_NAME=/system/bin/lowi-server -PROCESS_ARGUMENT= -PROCESS_STATE=ENABLED -PROCESS_GROUPS=gps net_admin wifi inet qcom_diag -PREMIUM_FEATURE=0 -IZAT_FEATURE_MASK=0xf303 -PLATFORMS=all -BASEBAND=all -LEAN_TARGETS=DISABLED -HARDWARE_TYPE=all - -PROCESS_NAME=/system/bin/xtwifi-inet-agent -PROCESS_ARGUMENT= -PROCESS_STATE=ENABLED -PROCESS_GROUPS=inet gps -PREMIUM_FEATURE=1 -IZAT_FEATURE_MASK=0xc0f -PLATFORMS=all -BASEBAND=all -LEAN_TARGETS=DISABLED -HARDWARE_TYPE=all - -PROCESS_NAME=/system/bin/xtwifi-client -PROCESS_ARGUMENT= -PROCESS_STATE=ENABLED -PROCESS_GROUPS=wifi inet gps rfs_shared system -PREMIUM_FEATURE=1 -IZAT_FEATURE_MASK=0xf0f -PLATFORMS=all -BASEBAND=all -LEAN_TARGETS=DISABLED -HARDWARE_TYPE=all - -PROCESS_NAME=/system/vendor/bin/slim_daemon -PROCESS_ARGUMENT= -PROCESS_STATE=ENABLED -PROCESS_GROUPS=gps qcom_diag can -PREMIUM_FEATURE=1 -IZAT_FEATURE_MASK=0xf0 -PLATFORMS=all -BASEBAND=all -LEAN_TARGETS=DISABLED -HARDWARE_TYPE=all diff --git a/gps/etc/lowi.conf b/gps/etc/lowi.conf deleted file mode 100644 index cfadcb2..0000000 --- a/gps/etc/lowi.conf +++ /dev/null @@ -1,51 +0,0 @@ -#*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* -# -# LOWI Config file -# -# GENERAL DESCRIPTION -# This file contains the config params for LOWI -# -# Copyright (c) 2012-2013 Qualcomm Atheros, Inc. -# All Rights Reserved. -# Qualcomm Atheros Confidential and Proprietary. -# -# Export of this technology or software is regulated by the U.S. Government. -# Diversion contrary to U.S. law prohibited. -#=============================================================================*/ - -# X86 ONLY - UBUNTU: -# Copy this file in the same directory where the executable is - -# The RSSI threshold used in the RTT outlier detection in half decibels. Default value recommended by the -# system team currently is -140 (corresponding to -70 dB). -LOWI_RSSI_THRESHOLD_FOR_RTT = -140 - -# Number of measurment per AP for RTS/CTS -LOWI_RTS_CTS_NUM_MEAS = 5 - -# Maximum Number of Outstanding Requests supported -LOWI_MAX_OUTSTANDING_REQUEST = 255 - -# Maximum number of records in Cache -LOWI_MAX_NUM_CACHE_RECORDS = 200 - -# Default threshold before issuing another fresh scan (ms) -LOWI_FRESH_SCAN_THRESHOLD = 500 - -# Timeout in case no result is reported by the driver (seconds) -LOWI_NO_RESULT_WAIT_TOLERANCE = 10 - -# Use Fake Wifi driver. Only valid for engineering builds -LOWI_USE_FAKE_WIFI_DRIVER = 0 - -# Use ROME Wifi driver. Only valid for engineering builds -# Will be removed later only for development support -LOWI_USE_ROME_WIFI_DRIVER = 0 - -# Use LOWI LP. -# When enabled the Discovery Request will be routed to LOWI-LP -LOWI_USE_LOWI_LP = 1 - -# Log level -# EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 -LOWI_LOG_LEVEL = 2 diff --git a/gps/etc/sap.conf b/gps/etc/sap.conf deleted file mode 100644 index 2e377af..0000000 --- a/gps/etc/sap.conf +++ /dev/null @@ -1,67 +0,0 @@ -################################ -# Sensor Settings -################################ -#The following parameters are optional. -#Internal defaults support MEMS sensors -#native to most handset devices. -#Device specific sensor characterization -#for improved performance is possible as -#described in SAP application notes. -#GYRO_BIAS_RANDOM_WALK= -#ACCEL_RANDOM_WALK_SPECTRAL_DENSITY= -#ANGLE_RANDOM_WALK_SPECTRAL_DENSITY= -#RATE_RANDOM_WALK_SPECTRAL_DENSITY= -#VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY= - -# Sensor Sampling Rate Parameters for Low-Data Rate Filter (should be greater than 0) -# used in loc_eng_reinit -SENSOR_ACCEL_BATCHES_PER_SEC=2 -SENSOR_ACCEL_SAMPLES_PER_BATCH=5 -SENSOR_GYRO_BATCHES_PER_SEC=2 -SENSOR_GYRO_SAMPLES_PER_BATCH=5 -# Sensor Sampling Rate Parameters for High-Data Rate Filter (should be greater than 0) -SENSOR_ACCEL_BATCHES_PER_SEC_HIGH=4 -SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH=25 -SENSOR_GYRO_BATCHES_PER_SEC_HIGH=4 -SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH=25 - -# Sensor Control Mode (0=AUTO, 1=FORCE_ON) -# used in loc_eng_reinit -SENSOR_CONTROL_MODE=0 - -# Enable or Disable Sensors for GPS use (0=Enable, 1=Disable) -# used in loc_eng_reinit -SENSOR_USAGE=0 - -# Choose GSIFF sensor provider (1=Snapdragon Sensors Core, 2=Android NDK) -SENSOR_PROVIDER=1 - -# Bit mask used to define which sensor algorithms are used. -# Setting each bit has the following definition: -# 0x1 - DISABLE_INS_POSITIONING_FILTER -# 0x0 - ENABLE_INS_POSITIONING_FILTER -SENSOR_ALGORITHM_CONFIG_MASK=0x1 - -#Vehicle Network Provider configuration - -#Service configuration strings -#The number before colon in VN_X items defines version of the format of the rest of the string -#VN_ACCEL_CFG=0:5 -#VN_GYRO_CFG=0:5.5 -#VN_ODOMETRY_CFG=0:2,4.5 -VN_ACCEL_CFG=1:128,0,12,0.0048828125,12,12,0.0048828125,24,12,0.0048828125 -VN_GYRO_CFG=1:129,0,16,0.00006103515625,16,16,0.00006103515625,32,16,0.00006103515625 -VN_ODOMETRY_CFG=1:130,0,1,5,6,32 - -#Procesors clock ratio: AP and CAN bus microcontroller -VN_PROC_CLOCK_RATIO=1.93165618815148 - -# Time source used by Sensor HAL -# Setting this value controls accuracy of location sensor services. -# 0 - Unknown -# 1 - CLOCK_BOOTTIME -# 2 - CLOCK_MONOTONIC -# 3 - CLOCK_REALTIME -# 4 - CLOCK_BOOTTIME using Alarm timer interface -NDK_PROVIDER_TIME_SOURCE=1 - diff --git a/gps/etc/xtwifi.conf b/gps/etc/xtwifi.conf deleted file mode 100644 index fc17faa..0000000 --- a/gps/etc/xtwifi.conf +++ /dev/null @@ -1,82 +0,0 @@ -#GTP AP Project client core config file -# -#GENERAL DESCRIPTION -#This is used by client core -# -#Copyright (c) 2012-2014 Qualcomm Atheros, Inc. -#All Rights Reserved. -#Qualcomm Atheros Confidential and Proprietary. - -# Log verbosity control for most of the GTP WiFi system, including native and -# Java componenets -# OFF = 0, ERROR = 1, WARNING = 2, INFO = 3, DEBUG = 4, VERBOSE = 5, ALL = 100 -DEBUG_GLOBAL_LOG_LEVEL = 2 - -# this is used at the server side to distinguish uploads from different maker/model -# default "Qualcomm" -OEM_ID_IN_REQUEST_TO_SERVER = "Qualcomm" - -# this is used at the server side to distinguish uploads from different maker/model -# default "UNKNOWN" -MODEL_ID_IN_REQUEST_TO_SERVER = "UNKNOWN" - -############################################################################## -# GTP-WiFi positioning config # -############################################################################## - -# URL for the server position request -XT_SERVER_ROOT_URL = https://gtpa1.izatcloud.net:443/uds/v2 - -# size, in bytes, of the cache on device -SIZE_BYTE_TOTAL_CACHE = 5000000 - -# value 0: (default) use the async LOWI wifi scanner -# value 10: FAKE AP wifi scanner -WIFI_SCANNER_CHOICE = 0 - -############################################################################## -# XT-WiFi crowd sourcing config # -############################################################################## -# Use server suggestion for crowd sourcing configuration -ENABLE_SERVER_SUGGESTION_FOR_CROWD_SOURCING = 1 - -# Maximum number of APs to be collected for upload -NUM_MAX_AP_PER_UPLOAD = 16383 -# Number of minutes between upload: 24 hours -INTERVAL_MIN_UPLOAD = 1440 -# Number of minutes between forced upload: 5 days -INTERVAL_MIN_FORCED_UPLOAD = 7200 - -# The minimum time between two collected AP data sets in seconds -INTERVAL_SEC_AP_SETS_COLLECT = 10 -# Timeout for scan interval when phone is on: 600 seconds (10 minute) -INTERVAL_SEC_SCAN = 600 -# Timeout for scan interval when phone has not continusouly on for INTERVAL_MIN_SCAN -INTERVAL_MIN_FORCED_SCAN = 480 - -# Maximum number of Cell DB records for upload -WWAN_MAX_CELLDB_RECORDS_PER_UPLOAD = 1000 - -############################################################################## -# GTP AP cell config # -############################################################################## -# This item specifies the RIL server name. -# This configure item can not be removed in Android target. -XTRAT_WWAN_LITE_LOC_RIL_SERVER_NAME = "OS-Agent" - -# Maximum total number of SNA records cached in mobile storage. -# Max allowed value is 10000 -# Min value is 100 -XTRAT_WWAN_LITE_MAX_DL_SNA = 10000 - -# Maximum total number of BSA records cached in mobile storage. -# Max allowed value is 65000 -# Min value is 100 -XTRAT_WWAN_LITE_MAX_DL_BSA = 65000 - -############################################################################## -# Qualcomm Network Location Provider config # -############################################################################## -# Accuracy Threshold for NLP position. Position exceeds thsi threshold will be filtered out. -# Default is 25000 meters. -LARGE_ACCURACY_THRESHOLD_TO_FILTER_NLP_POSITION = 25000 \ No newline at end of file diff --git a/gps/gnsspps/Android.mk b/gps/gnsspps/Android.mk deleted file mode 100644 index 70005ff..0000000 --- a/gps/gnsspps/Android.mk +++ /dev/null @@ -1,32 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libgnsspps - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libgps.utils \ - liblog - -LOCAL_SRC_FILES += \ - gnsspps.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -LOCAL_COPY_HEADERS_TO:= libgnsspps/ - -LOCAL_COPY_HEADERS:= \ - gnsspps.h - -## Includes -LOCAL_C_INCLUDES := \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_pla - -include $(BUILD_SHARED_LIBRARY) diff --git a/gps/gnsspps/Makefile.am b/gps/gnsspps/Makefile.am deleted file mode 100644 index 728ac14..0000000 --- a/gps/gnsspps/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -AM_CFLAGS = \ - $(LOCPLA_CFLAGS) \ - -I./ - -ACLOCAL_AMFLAGS = -I m4 - -libgnsspps_la_SOURCES = \ - gnsspps.c - -if USE_GLIB -libgnsspps_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libgnsspps_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libgnsspps_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libgnsspps_la_CFLAGS = $(AM_CFLAGS) -libgnsspps_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libgnsspps_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libgnsspps_la_LIBADD = -lstdc++ - -library_include_HEADERS = \ - gnsspps.h - -#Create and Install libraries -lib_LTLIBRARIES = libgnsspps.la - -library_includedir = $(pkgincludedir) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gnsspps.pc -EXTRA_DIST = $(pkgconfig_DATA) - - - - diff --git a/gps/gnsspps/configure.ac b/gps/gnsspps/configure.ac deleted file mode 100644 index cb66fc7..0000000 --- a/gps/gnsspps/configure.ac +++ /dev/null @@ -1,60 +0,0 @@ -# configure.ac -- Autoconf script for gps lbs-core -# -# Process this file with autoconf to produce a configure script - -# Requires autoconf tool later than 2.61 -AC_PREREQ(2.61) -# Initialize the gps lbs-core package version 1.0.0 -AC_INIT([gnsspps],1.0.0) -# Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) -# Disables auto rebuilding of configure, Makefile.ins -AM_MAINTAINER_MODE -# Verifies the --srcdir is correct by checking for the path -AC_CONFIG_SRCDIR([Makefile.am]) -# defines some macros variable to be included by source -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# Checks for programs. -AC_PROG_LIBTOOL -AC_PROG_CXX -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_AWK -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG - -# Checks for libraries. -PKG_CHECK_MODULES([LOCPLA], [loc-pla]) -AC_SUBST([LOCPLA_CFLAGS]) -AC_SUBST([LOCPLA_LIBS]) - -AC_ARG_WITH([glib], - AC_HELP_STRING([--with-glib], - [enable glib, building HLOS systems which use glib])) - -if (test "x${with_glib}" = "xyes"); then - AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) - PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GThread >= 2.16 is required)) - PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GLib >= 2.16 is required)) - GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" - GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" - - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) -fi - -AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") - -AC_CONFIG_FILES([ \ - Makefile \ - gnsspps.pc - ]) - -AC_OUTPUT diff --git a/gps/gnsspps/gnsspps.c b/gps/gnsspps/gnsspps.c deleted file mode 100644 index f92a862..0000000 --- a/gps/gnsspps/gnsspps.c +++ /dev/null @@ -1,194 +0,0 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundatoin, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//DRsync kernel timestamp -static struct timespec drsyncKernelTs = {0,0}; -//DRsync userspace timestamp -static struct timespec drsyncUserTs = {0,0}; -//flag to stop fetching timestamp -static int isActive = 0; -static pps_handle handle; - -static pthread_mutex_t ts_lock; - - /* checks the PPS source and opens it */ -int check_device(char *path, pps_handle *handle) -{ - int ret; - - /* Try to find the source by using the supplied "path" name */ - ret = open(path, O_RDWR); - if (ret < 0) - { - LOC_LOGV("%s:%d unable to open device %s", __func__, __LINE__, path); - return ret; - } - - /* Open the PPS source */ - ret = pps_create(ret, handle); - if (ret < 0) - { - LOC_LOGV( "%s:%d cannot create a PPS source from device %s", __func__, __LINE__, path); - return -1; - } - return 0; -} - -/* fetches the timestamp from the PPS source */ -int read_pps(pps_handle *handle) -{ - struct timespec timeout; - pps_info infobuf; - int ret; - // 3sec timeout - timeout.tv_sec = 3; - timeout.tv_nsec = 0; - - ret = pps_fetch(*handle, PPS_TSFMT_TSPEC, &infobuf,&timeout); - - if (ret < 0 && ret !=-EINTR) - { - LOC_LOGV("%s:%d pps_fetch() error %d", __func__, __LINE__, ret); - return -1; - } - - pthread_mutex_lock(&ts_lock); - drsyncKernelTs.tv_sec = infobuf.tv_sec; - drsyncKernelTs.tv_nsec = infobuf.tv_nsec; - ret = clock_gettime(CLOCK_BOOTTIME,&drsyncUserTs); - pthread_mutex_unlock(&ts_lock); - - if(ret != 0) - { - LOC_LOGV("%s:%d clock_gettime() error",__func__,__LINE__); - } - return 0; -} - -#ifdef __cplusplus -extern "C" { -#endif -/* infinitely calls read_pps() */ -void *thread_handle(void *input) -{ - int ret; - if(input != NULL) - { - LOC_LOGV("%s:%d Thread Input is present", __func__, __LINE__); - } - while(isActive) - { - ret = read_pps(&handle); - - if (ret == -1 && errno != ETIMEDOUT ) - { - LOC_LOGV("%s:%d Could not fetch PPS source", __func__, __LINE__); - } - } - return NULL; -} - -/* opens the device and fetches from PPS source */ -int initPPS(char *devname) -{ - int ret,pid; - pthread_t thread; - isActive = 1; - - ret = check_device(devname, &handle); - if (ret < 0) - { - LOC_LOGV("%s:%d Could not find PPS source", __func__, __LINE__); - return 0; - } - - pthread_mutex_init(&ts_lock,NULL); - - pid = pthread_create(&thread,NULL,&thread_handle,NULL); - if(pid != 0) - { - LOC_LOGV("%s:%d Could not create thread in InitPPS", __func__, __LINE__); - return 0; - } - return 1; -} - -/* stops fetching and closes the device */ -void deInitPPS() -{ - pthread_mutex_lock(&ts_lock); - isActive = 0; - pthread_mutex_unlock(&ts_lock); - - pthread_mutex_destroy(&ts_lock); - pps_destroy(handle); -} - -/* retrieves DRsync kernel timestamp,DRsync userspace timestamp - and updates current timestamp */ -/* Returns: - * 1. @Param out DRsync kernel timestamp - * 2. @Param out DRsync userspace timestamp - * 3. @Param out current timestamp - */ -int getPPS(struct timespec *fineKernelTs ,struct timespec *currentTs, - struct timespec *fineUserTs) -{ - int ret; - - pthread_mutex_lock(&ts_lock); - fineKernelTs->tv_sec = drsyncKernelTs.tv_sec; - fineKernelTs->tv_nsec = drsyncKernelTs.tv_nsec; - - fineUserTs->tv_sec = drsyncUserTs.tv_sec; - fineUserTs->tv_nsec = drsyncUserTs.tv_nsec; - - ret = clock_gettime(CLOCK_BOOTTIME,currentTs); - pthread_mutex_unlock(&ts_lock); - if(ret != 0) - { - LOC_LOGV("%s:%d clock_gettime() error",__func__,__LINE__); - return 0; - } - return 1; -} - -#ifdef __cplusplus -} -#endif - diff --git a/gps/gnsspps/gnsspps.h b/gps/gnsspps/gnsspps.h deleted file mode 100644 index 3642f3b..0000000 --- a/gps/gnsspps/gnsspps.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundatoin, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef _GNSSPPS_H -#define _GNSSPPS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* opens the device and fetches from PPS source */ -int initPPS(char *devname); -/* updates the fine time stamp */ -int getPPS(struct timespec *current_ts, struct timespec *current_boottime, struct timespec *last_boottime); -/* stops fetching and closes the device */ -void deInitPPS(); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/gps/gnsspps/gnsspps.pc.in b/gps/gnsspps/gnsspps.pc.in deleted file mode 100644 index 604eedd..0000000 --- a/gps/gnsspps/gnsspps.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnsspps -Description: QTI GPS drplugin-client -Version: @VERSION -Libs: -L${libdir} -lgnsspps -Cflags: -I${includedir}/gnsspps diff --git a/gps/gnsspps/timepps.h b/gps/gnsspps/timepps.h deleted file mode 100644 index fe0d8f0..0000000 --- a/gps/gnsspps/timepps.h +++ /dev/null @@ -1,106 +0,0 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundatoin, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include -#include -#include -#include -#include - -#ifndef _TIMEPPS_H -#define _TIMEPPS_H - -#ifdef __cplusplus -extern "C" { -#endif -/* time of assert event */ -typedef struct timespec pps_info; -/* represents pps source */ -typedef int pps_handle; - - /* Open the PPS source */ -static __inline int pps_create(int source, pps_handle *handle) -{ - int ret; - struct pps_kparams dummy; - - if (!handle) - { - errno = EINVAL; - return -1; - } - /* check if current device is valid pps */ - ret = ioctl(source, PPS_GETPARAMS, &dummy); - if (ret) - { - errno = EOPNOTSUPP; - return -1; - } - *handle = source; - - return 0; -} -/* close the pps source */ -static __inline int pps_destroy(pps_handle handle) -{ - return close(handle); -} -/*reads timestamp from pps device*/ -static __inline int pps_fetch(pps_handle handle, const int tsformat, - pps_info *ppsinfobuf, - const struct timespec *timeout) -{ - struct pps_fdata fdata; - int ret; - - if (tsformat != PPS_TSFMT_TSPEC) - { - errno = EINVAL; - return -1; - } - if (timeout) - { - fdata.timeout.sec = timeout->tv_sec; - fdata.timeout.nsec = timeout->tv_nsec; - fdata.timeout.flags = ~PPS_TIME_INVALID; - } - else - { - fdata.timeout.flags = PPS_TIME_INVALID; - } - ret = ioctl(handle, PPS_FETCH, &fdata); - - ppsinfobuf->tv_sec = fdata.info.assert_tu.sec; - ppsinfobuf->tv_nsec = fdata.info.assert_tu.nsec; - - return ret; -} - -#ifdef __cplusplus -} -#endif -#endif diff --git a/gps/loc-hal.pc.in b/gps/loc-hal.pc.in deleted file mode 100644 index 36cd4e7..0000000 --- a/gps/loc-hal.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: loc-hal -Description: QTI GPS Loc HAL -Version: @VERSION -Libs: -L${libdir} -lgps_utils_so -lloc_core -lloc_eng_so -lgps_default_so -lloc_ds_api -lloc_api_v02 -Cflags: -I${includedir} -I${includedir}/loc-hal/utils -I${includedir}/loc-hal/core -I${includedir}/loc-hal diff --git a/gps/loc_api/Android.mk b/gps/loc_api/Android.mk deleted file mode 100644 index 8bfdd1b..0000000 --- a/gps/loc_api/Android.mk +++ /dev/null @@ -1,13 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -# add RPC dirs if RPC is available -ifneq ($(TARGET_NO_RPC),true) - -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/ - -endif #TARGET_NO_RPC - -GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/ - -#call the subfolders -include $(addsuffix Android.mk, $(GPS_DIR_LIST)) diff --git a/gps/loc_api/Makefile.am b/gps/loc_api/Makefile.am deleted file mode 100644 index a5f529b..0000000 --- a/gps/loc_api/Makefile.am +++ /dev/null @@ -1,133 +0,0 @@ -AM_CFLAGS = \ - -I./ \ - -I../core \ - -I./libloc_api_50001 \ - -I../utils \ - $(LOCPLA_CFLAGS) \ - -fno-short-enums \ - -D__func__=__PRETTY_FUNCTION__ \ - -DTARGET_USES_QCOM_BSP - -libloc_eng_so_la_h_sources = \ - loc_eng_dmn_conn_glue_msg.h \ - loc_eng_dmn_conn_glue_pipe.h \ - loc_eng_dmn_conn.h \ - loc_eng_dmn_conn_handler.h \ - loc_eng_dmn_conn_thread_helper.h - -libloc_eng_so_la_SOURCES = \ - libloc_api_50001/loc_eng.cpp \ - libloc_api_50001/loc_eng_agps.cpp \ - libloc_api_50001/loc_eng_xtra.cpp \ - libloc_api_50001/loc_eng_ni.cpp \ - libloc_api_50001/loc_eng_log.cpp \ - libloc_api_50001/loc_eng_nmea.cpp \ - libloc_api_50001/LocEngAdapter.cpp \ - libloc_api_50001/loc_eng_dmn_conn.cpp \ - libloc_api_50001/loc_eng_dmn_conn_handler.cpp \ - libloc_api_50001/loc_eng_dmn_conn_thread_helper.c \ - libloc_api_50001/loc_eng_dmn_conn_glue_msg.c \ - libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c - -libloc_eng_so_la_SOURCES += libloc_eng_so_la_h_sources - -if USE_GLIB -libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_eng_so_la_CFLAGS = $(AM_CFLAGS) -libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_eng_so_la_LIBADD = -lstdc++ -ldl -llog $(LOCPLA_LIBS) ../utils/libgps_utils_so.la ../core/libloc_core.la - - -libgps_default_so_la_SOURCES = \ - libloc_api_50001/loc.cpp \ - libloc_api_50001/gps.c - -if USE_GLIB -libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libgps_default_so_la_CFLAGS = $(AM_CFLAGS) -libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libgps_default_so_la_LIBADD = -lstdc++ -llog $(LOCPLA_LIBS) ../utils/libgps_utils_so.la ../core/libloc_core.la -ldl libloc_eng_so.la - - -libloc_ds_api_CFLAGS = \ - $(QMIF_CFLAGS) \ - $(QMI_CFLAGS) \ - $(DATA_CFLAGS) \ - -I$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api - -libloc_ds_api_la_SOURCES = \ - $(WORKSPACE)/qcom-opensource/location/loc_api/ds_api/ds_client.c - -if USE_GLIB -libloc_ds_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_ds_api_CFLAGS) @GLIB_CFLAGS@ -libloc_ds_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_ds_api_la_LDFLAGS += -Wl,--export-dynamic -libloc_ds_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_ds_api_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_ds_api_la_CFLAGS = $(AM_CFLAGS) $(libloc_ds_api_CFLAGS) -libloc_ds_api_la_LDFLAGS = -lstdc++ -lpthread -Wl,--export-dynamic -shared -version-info 1:0:0 -libloc_ds_api_la_LDFLAGS += -Wl,--export-dynamic -libloc_ds_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) $(libloc_ds_api_CFLAGS) -endif - -libloc_ds_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) -lqmiservices -ldsi_netctrl $(LOCPLA_LIBS) ../utils/libgps_utils_so.la -#libloc_ds_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) -lqmiservices $(LOCPLA_LIBS) ../utils/libgps_utils_so.la - -libloc_api_v02_CFLAGS = \ - $(QMIF_CFLAGS) \ - -I$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api \ - -I$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02 - -libloc_api_v02_la_SOURCES = \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/LocApiV02.cpp \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_log.c \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_client.c \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_sync_req.c \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/location_service_v02.c - -if USE_GLIB -libloc_api_v02_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_api_v02_CFLAGS) @GLIB_CFLAGS@ -libloc_api_v02_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_api_v02_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_api_v02_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_api_v02_la_CFLAGS = $(AM_CFLAGS) $(libloc_api_v02_CFLAGS) -libloc_api_v02_la_LDFLAGS = -lstdc++ -lpthread -shared -version-info 1:0:0 -libloc_api_v02_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) $(libloc_api_v02_CFLAGS) -endif - -libloc_api_v02_la_CXXFLAGS = -std=c++0x -libloc_api_v02_la_LIBADD = -lstdc++ -lqmi_cci -lqmi_common_so $(QMIF_LIBS) $(LOCPLA_LIBS) ../core/libloc_core.la ../utils/libgps_utils_so.la libloc_ds_api.la - -library_include_HEADERS = \ - libloc_api_50001/LocEngAdapter.h \ - libloc_api_50001/loc.h \ - libloc_api_50001/loc_eng.h \ - libloc_api_50001/loc_eng_xtra.h \ - libloc_api_50001/loc_eng_ni.h \ - libloc_api_50001/loc_eng_agps.h \ - libloc_api_50001/loc_eng_msg.h \ - libloc_api_50001/loc_eng_log.h \ - $(WORKSPACE)/qcom-opensource/location/loc_api/ds_api/ds_client.h \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/location_service_v02.h \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_log.h \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_client.h \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_sync_req.h \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/LocApiV02.h \ - $(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_util_log.h - -library_includedir = $(pkgincludedir) - -#Create and Install libraries -lib_LTLIBRARIES = libloc_eng_so.la libgps_default_so.la libloc_ds_api.la libloc_api_v02.la diff --git a/gps/loc_api/libloc_api-rpc-50001/Android.mk b/gps/loc_api/libloc_api-rpc-50001/Android.mk deleted file mode 100644 index 6c5d533..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/Android.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_AMSS_VERSION),50001) -include $(call all-subdir-makefiles) -endif diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk deleted file mode 100644 index bb3d924..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Android.mk +++ /dev/null @@ -1,60 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -RPC_INC:=rpc_inc - -source_files:= \ - src/loc_api_rpc_glue.c \ - src/loc_api_sync_call.c \ - src/loc_apicb_appinit.c \ - src/loc_api_fixup.c \ - src/loc_api_log.c \ - src/LocApiRpc.cpp - -LOCAL_SRC_FILES:= $(source_files) - -LOCAL_CFLAGS:=-fno-short-enums -LOCAL_CFLAGS+=-DDEBUG -DUSE_QCOM_AUTO_RPC -DUSE_QCOM_AUTO_RPC -LOCAL_CFLAGS+=$(GPS_FEATURES) - -# for loc_api_fixup.c -LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL - -LOCAL_SHARED_LIBRARIES:= \ - librpc \ - libutils \ - libcutils \ - libcommondefs \ - libgps.utils \ - libloc_core - -LOCAL_STATIC_LIBRARIES := \ - libloc_api_rpcgen - -LOCAL_PRELINK_MODULE:= false - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/rpc_inc \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ - $(TARGET_OUT_HEADERS)/loc_api/rpcgen/inc \ - $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc \ - $(TARGET_OUT_HEADERS)/librpc \ - $(TARGET_OUT_HEADERS)/libloc-rpc/rpc_inc \ - $(TOP)/hardware/msm7k/librpc - -LOCAL_COPY_HEADERS_TO:= libloc_api-rpc-qc/$(RPC_INC) -LOCAL_COPY_HEADERS:= \ - $(RPC_INC)/loc_api_rpc_glue.h \ - $(RPC_INC)/loc_api_fixup.h \ - $(RPC_INC)/loc_api_sync_call.h \ - $(RPC_INC)/loc_apicb_appinit.h \ - $(RPC_INC)/LocApiRpc.h - -LOCAL_MODULE:= libloc_api-rpc-qc -LOCAL_MODULE_OWNER := qcom - -LOCAL_MODULE_TAGS := optional - -include $(BUILD_SHARED_LIBRARY) diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am deleted file mode 100644 index f5c5136..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -AM_CFLAGS = \ - -I../../../utils \ - -I../../../platform_lib_abstractions \ - -I./rpc_inc \ - -I../libloc_api-rpc-stub/inc \ - -I../../libloc_api_50001 \ - $(MSM7K_CFLAGS) \ - -DUSE_QCOM_AUTO_RPC - -requiredlibs = \ - ../../../utils/libgps_utils_so.la \ - $(MSM7K_LIBS) - -h_sources = \ - rpc_inc/loc_api_rpc_glue.h \ - rpc_inc/loc_api_fixup.h \ - rpc_inc/loc_api_sync_call.h \ - rpc_inc/loc_apicb_appinit.h \ - -c_sources = \ - src/loc_api_rpc_glue.c \ - src/loc_api_sync_call.c \ - src/loc_apicb_appinit.c \ - src/loc_api_fixup.c \ - src/loc_api_log.c \ - src/LocApiRpcAdapter.cpp \ - - -library_includedir = $(pkgincludedir)/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc -library_include_HEADERS = $(h_sources) -libloc_api_rpc_qc_la_SOURCES = $(c_sources) $(h_sources) - -if USE_GLIB -libloc_api_rpc_qc_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_api_rpc_qc_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_api_rpc_qc_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_api_rpc_qc_la_CFLAGS = $(AM_CFLAGS) -libloc_api_rpc_qc_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libloc_api_rpc_qc_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_api_rpc_qc_la_LIBADD = $(requiredlibs) -lstdc++ - -#Create and Install Libraries -lib_LTLIBRARIES = libloc_api_rpc_qc.la diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h deleted file mode 100644 index 13557c9..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/LocApiRpc.h +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (c) 2011,2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_API_RPC_H -#define LOC_API_RPC_H - -#include -#include -#include -#include -#include - -using namespace loc_core; - -class LocApiRpc : public LocApiBase { -protected: - // RPC communication establishment - rpc_loc_client_handle_type client_handle; - -private: - int dataEnableLastSet; - char apnLastSet[MAX_APN_LEN]; - - static const LOC_API_ADAPTER_EVENT_MASK_T maskAll; - static const rpc_loc_event_mask_type locBits[]; - static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); - static rpc_loc_lock_e_type convertGpsLockMask(LOC_GPS_LOCK_MASK lockMask); - static enum loc_api_adapter_err convertErr(int rpcErr); - static GpsNiEncodingType convertNiEncodingType(int loc_encoding); - static int NIEventFillVerfiyType(GpsNiNotification ¬if, - rpc_loc_ni_notify_verify_e_type notif_priv); - - void reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr); - void reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr); - void reportStatus(const rpc_loc_status_event_s_type *status_report_ptr); - void reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr); - void ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr); - void NIEvent(const rpc_loc_ni_event_s_type *ni_req_ptr); - -protected: - virtual enum loc_api_adapter_err - open(LOC_API_ADAPTER_EVENT_MASK_T mask); - virtual enum loc_api_adapter_err - close(); - LocApiRpc(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); - -public: - static LocApiRpc* createLocApiRpc(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask); - ~LocApiRpc(); - - virtual int locEventCB(rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, - const rpc_loc_event_payload_u_type* loc_event_payload); - - void locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event); - - // RPC adapter interface implementations - virtual enum loc_api_adapter_err - startFix(const LocPosMode& posMode); - virtual enum loc_api_adapter_err - stopFix(); - virtual enum loc_api_adapter_err - setPositionMode(const LocPosMode& mode); - inline virtual enum loc_api_adapter_err - enableData(int enable) { return enableData(enable, false); } - virtual enum loc_api_adapter_err - enableData(int enable, boolean force); - virtual enum loc_api_adapter_err - setTime(GpsUtcTime time, int64_t timeReference, int uncertainty); - virtual enum loc_api_adapter_err - injectPosition(double latitude, double longitude, float accuracy); - virtual enum loc_api_adapter_err - deleteAidingData(GpsAidingData f); - virtual enum loc_api_adapter_err - informNiResponse(GpsUserResponseType userResponse, const void* passThroughData); - inline virtual enum loc_api_adapter_err - setAPN(char* apn, int len) { return setAPN(apn, len, false); } - virtual enum loc_api_adapter_err - setAPN(char* apn, int len, boolean force); - virtual enum loc_api_adapter_err - setServer(const char* url, int len); - virtual enum loc_api_adapter_err - setServer(unsigned int ip, int port, LocServerType type); - virtual enum loc_api_adapter_err - setXtraData(char* data, int length); - virtual enum loc_api_adapter_err - requestXtraServer(); - virtual enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType); - virtual enum loc_api_adapter_err - atlCloseStatus(int handle, int is_succ); - virtual enum loc_api_adapter_err - setSUPLVersion(uint32_t version); - virtual void setInSession(bool inSession); - - /*Values for lock - 1 = Do not lock any position sessions - 2 = Lock MI position sessions - 3 = Lock MT position sessions - 4 = Lock all position sessions - */ - virtual int setGpsLock(LOC_GPS_LOCK_MASK lock); - /* - Returns - Current value of GPS Lock on success - -1 on failure - */ - virtual int getGpsLock(void); -}; - -extern "C" LocApiBase* getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - ContextBase *context); - -#endif //LOC_API_RPC_H diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h deleted file mode 100644 index 49a6d0b..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/debug.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DEBUG_H -#define DEBUG_H - -#include - -#define LOG_TAG "LocSvc_rpc" -#include - -#define PRINT(x...) do { \ - fprintf(stdout, "%s(%d) ", __FUNCTION__, __LINE__); \ - fprintf(stdout, ##x); \ - ALOGD(x); \ - } while(0) - -#ifdef DEBUG -#define D PRINT -#else -#define D(x...) do { } while(0) -#endif - -#ifdef VERBOSE -#define V PRINT -#else -#define V(x...) do { } while(0) -#endif - -#define E(x...) do { \ - fprintf(stderr, "%s(%d) ", __FUNCTION__, __LINE__); \ - fprintf(stderr, ##x); \ - ALOGE(x); \ - } while(0) - -#define FAILIF(cond, msg...) do { \ - if (__builtin_expect (cond, 0)) { \ - fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \ - fprintf(stderr, ##msg); \ - ALOGE(##msg); \ - } \ - } while(0) - -#endif/*DEBUG_H*/ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h deleted file mode 100644 index c483b4a..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_fixup.h +++ /dev/null @@ -1,226 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LOC_API_FIXUP_H -#define LOC_API_FIXUP_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifndef NULLPROC -#define NULLPROC 0 -#endif /* NULLPROC */ - -#ifdef ADD_XDR_FLOAT - -extern bool_t xdr_float (XDR *__xdrs, float *__fp); -extern bool_t xdr_double (XDR *__xdrs, double *__dp); - -#endif /* ADD_XDR_FLOAT */ - -#ifdef ADD_XDR_BOOL -extern bool_t xdr_bool(XDR *__xdrs, int *__bp); -#endif /* ADD_XDR_BOOL */ - -#define RPC_LOC_API_MAJOR_VERSION_NUMBER 1 -#define RPC_LOC_API_MINOR_VERSION_NUMBER 0 - -// Return value for loc_open in case of failure. -#define RPC_LOC_CLIENT_HANDLE_INVALID -1 - -// Return value of loc api calls for loc_close, loc_start_fix, loc_stop_fix and loc_ioctl -// These are also the status for the ioctl callback -#define RPC_LOC_API_SUCCESS 0 -#define RPC_LOC_API_GENERAL_FAILURE 1 -#define RPC_LOC_API_UNSUPPORTED 2 -#define RPC_LOC_API_INVALID_HANDLE 4 -#define RPC_LOC_API_INVALID_PARAMETER 5 -#define RPC_LOC_API_ENGINE_BUSY 6 -#define RPC_LOC_API_PHONE_OFFLINE 7 -#define RPC_LOC_API_TIMEOUT 8 - -// Special return value for loc api calls in case of RPC failure -#define RPC_LOC_API_RPC_FAILURE (-1234) -// Special return value for modem restart incurred RPC failure -#define RPC_LOC_API_RPC_MODEM_RESTART (-1235) - -#define RPC_LOC_API_MAX_SV_COUNT 80 -#define RPC_LOC_API_MAX_NMEA_STRING_LENGTH 1200 - -// Maximum server address that will be used in location API -#define RPC_LOC_API_MAX_SERVER_ADDR_LENGTH 256 -#define RPC_LOC_API_MAX_NUM_PREDICTED_ORBITS_SERVERS 3 -#define RPC_LOC_API_MAX_NUM_NTP_SERVERS 3 - -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 // Position report comes in loc_parsed_position_s_type -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 // Satellite in view report -#define RPC_LOC_EVENT_NMEA_1HZ_REPORT 0x00000004 // NMEA report at 1HZ rate -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 // NMEA report at position report rate -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 // NI notification/verification request -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 // Assistance data, eg: time, predicted orbits request -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 // Request for location server -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 // Callback report for loc_ioctl -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 // Misc status report: eg, engine state - -#define RPC_LOC_POS_VALID_SESSION_STATUS 0x00000001 -#define RPC_LOC_POS_VALID_TIMESTAMP_CALENDAR 0x00000002 -#define RPC_LOC_POS_VALID_TIMESTAMP_UTC 0x00000004 -#define RPC_LOC_POS_VALID_LEAP_SECONDS 0x00000008 -#define RPC_LOC_POS_VALID_TIME_UNC 0x00000010 -#define RPC_LOC_POS_VALID_LATITUDE 0x00000020 -#define RPC_LOC_POS_VALID_LONGITUDE 0x00000040 -#define RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID 0x00000080 -#define RPC_LOC_POS_VALID_ALTITUDE_WRT_MEAN_SEA_LEVEL 0x00000100 -#define RPC_LOC_POS_VALID_SPEED_HORIZONTAL 0x00000200 -#define RPC_LOC_POS_VALID_SPEED_VERTICAL 0x00000400 -#define RPC_LOC_POS_VALID_HEADING 0x00000800 -#define RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR 0x00001000 -#define RPC_LOC_POS_VALID_HOR_UNC_ELLI_SEMI_MAJ 0x00002000 -#define RPC_LOC_POS_VALID_HOR_UNC_ELLI_SEMI_MIN 0x00004000 -#define RPC_LOC_POS_VALID_HOR_UNC_ELLI_ORIENT_AZIMUTH 0x00008000 -#define RPC_LOC_POS_VALID_VERTICAL_UNC 0x00010000 -#define RPC_LOC_POS_VALID_SPEED_UNC 0x00020000 -#define RPC_LOC_POS_VALID_HEADING_UNC 0x00040000 -#define RPC_LOC_POS_VALID_CONFIDENCE_HORIZONTAL 0x00080000 -#define RPC_LOC_POS_VALID_CONFIDENCE_VERTICAL 0x00100000 -#define RPC_LOC_POS_VALID_MAGNETIC_VARIATION 0x00200000 -#define RPC_LOC_POS_VALID_TECHNOLOGY_MASK 0x00400000 - -#define RPC_LOC_POS_TECH_SATELLITE 0x00000001 -#define RPC_LOC_POS_TECH_CELLID 0x00000002 -#define RPC_LOC_POS_TECH_WIFI 0x00000004 - -#define RPC_LOC_SV_INFO_VALID_SYSTEM 0x00000001 -#define RPC_LOC_SV_INFO_VALID_PRN 0x00000002 -#define RPC_LOC_SV_INFO_VALID_HEALTH_STATUS 0x00000004 -#define RPC_LOC_SV_INFO_VALID_PROCESS_STATUS 0x00000008 -#define RPC_LOC_SV_INFO_VALID_HAS_EPH 0x00000010 -#define RPC_LOC_SV_INFO_VALID_HAS_ALM 0x00000020 -#define RPC_LOC_SV_INFO_VALID_ELEVATION 0x00000040 -#define RPC_LOC_SV_INFO_VALID_AZIMUTH 0x00000080 -#define RPC_LOC_SV_INFO_VALID_SNR 0x00000100 - -#define RPC_LOC_GNSS_INFO_VALID_POS_DOP 0x00000001 -#define RPC_LOC_GNSS_INFO_VALID_HOR_DOP 0x00000002 -#define RPC_LOC_GNSS_INFO_VALID_VERT_DOP 0x00000004 -#define RPC_LOC_GNSS_INFO_VALID_ALTITUDE_ASSUMED 0x00000008 -#define RPC_LOC_GNSS_INFO_VALID_SV_COUNT 0x00000010 -#define RPC_LOC_GNSS_INFO_VALID_SV_LIST 0x00000020 - -#define RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH 200 -#define RPC_LOC_NI_SUPL_HASH_LENGTH 8 -#define RPC_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH 4 -#define RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH 64 -#define RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS 20 -#define RPC_LOC_NI_CODEWORD_LENGTH 20 - -#define RPC_LOC_NI_SUPL_QOP_VALID 0x01 -#define RPC_LOC_NI_SUPL_QOP_VERACC_VALID 0x02 -#define RPC_LOC_NI_SUPL_QOP_MAXAGE_VALID 0x04 -#define RPC_LOC_NI_SUPL_QOP_DELAY_VALID 0x08 - -#define RPC_LOC_FIX_CRIT_VALID_RECURRENCE_TYPE 0x00000001 -#define RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE 0x00000002 -#define RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY 0x00000004 -#define RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME 0x00000008 -#define RPC_LOC_FIX_CRIT_VALID_INTERMEDIATE_POS_REPORT_ENABLED 0x00000010 -#define RPC_LOC_FIX_CRIT_VALID_NOTIFY_TYPE 0x00000020 -#define RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL 0x00000040 -#define RPC_LOC_FIX_CRIT_VALID_MIN_DISTANCE 0x00000080 -#define RPC_LOC_FIX_CRIT_VALID_MIN_DIST_SAMPLE_INTERVAL 0x00000100 - -#define RPC_LOC_ASSIST_POS_VALID_TIMESTAMP_UTC 0x00000001 -#define RPC_LOC_ASSIST_POS_VALID_LATITUDE 0x00000002 -#define RPC_LOC_ASSIST_POS_VALID_LONGITUDE 0x00000004 -#define RPC_LOC_ASSIST_POS_VALID_ALTITUDE_WRT_ELLIPSOID 0x00000008 -#define RPC_LOC_ASSIST_POS_VALID_ALTITUDE_WRT_MEAN_SEA_LEVEL 0x00000010 -#define RPC_LOC_ASSIST_POS_VALID_HOR_UNC_CIRCULAR 0x00000020 -#define RPC_LOC_ASSIST_POS_VALID_VERT_UNC 0x00000040 -#define RPC_LOC_ASSIST_POS_VALID_CONFIDENCE_HORIZONTAL 0x00000080 -#define RPC_LOC_ASSIST_POS_VALID_CONFIDENCE_VERTICAL 0x00000100 -#define RPC_LOC_ASSIST_POS_VALID_TIMESTAMP_AGE 0x00000200 - -#define RPC_LOC_ASSIST_DATA_ALL 0xFFFFFFFF - -#define RPC_LOC_NMEA_MASK_ALL 0xffff -#define RPC_LOC_NMEA_MASK_GGA 0x0001 -#define RPC_LOC_NMEA_MASK_RMC 0x0002 -#define RPC_LOC_NMEA_MASK_GSV 0x0004 -#define RPC_LOC_NMEA_MASK_GSA 0x0008 -#define RPC_LOC_NMEA_MASK_VTG 0x0010 - -/* EFS data access */ -#define RPC_LOC_EFS_MAX_PATH_LEN_BYTES 64 /* Max file name length in bytes that can be written*/ -#define RPC_LOC_EFS_MAX_FILE_LEN_BYTES 2000 /* Max file size in bytes that can be written */ - -/* WIPER valid information flag in log report */ -#define RPC_LOC_WIPER_LOG_TIME_VALID 0x01 -#define RPC_LOC_WIPER_LOG_POS_VALID 0x02 -#define RPC_LOC_WIPER_LOG_AP_SET_VALID 0x04 - -/* General WIPER defines */ -#define RPC_LOC_WIPER_MAC_ADDR_LENGTH 6 // Do not change this number since it affects RPC and log packet sizes -#define RPC_LOC_WIPER_MAX_REPORTED_APS_PER_LOG_MSG 50 // Do not change this number since it affects RPC and log packet sizes - -/* WIPER AP Qualifier */ -#define RPC_LOC_WIPER_AP_QUALIFIER_BEING_USED 0x1 /* AP is being used by WPS */ -#define RPC_LOC_WIPER_AP_QUALIFIER_HIDDEN_SSID 0x2 /* AP does not broadcast SSID */ -#define RPC_LOC_WIPER_AP_QUALIFIER_PRIVATE 0x4 /* AP has encryption turned on */ -#define RPC_LOC_WIPER_AP_QUALIFIER_INFRASTRUCTURE_MODE 0x8 /* AP is in infrastructure mode and not in ad-hoc/unknown mode */ - -/* flags for notification */ -#define RPC_LOC_NI_CLIENT_NAME_PRESENT 0x0001 -#define RPC_LOC_NI_CLIENT_EXTADDR_PRESENT 0x0002 -#define RPC_LOC_NI_DEF_LOCATION_TYPE_PRESENT 0x0010 -#define RPC_LOC_NI_REQUESTOR_ID_PRESENT 0x0020 -#define RPC_LOC_NI_CODEWORD_PRESENT 0x0040 -#define RPC_LOC_NI_SERVICE_TYPE_ID_PRESENT 0x0080 -#define RPC_LOC_NI_ENCODING_TYPE_PRESENT 0x0100 - -/* below are for RPC_LOC_IOCTL_SET_LBS_APN_PROFILE data */ -/* values for apn_profiles[0].srv_system_type */ -#define LOC_APN_PROFILE_SRV_SYS_CDMA 0x01 -#define LOC_APN_PROFILE_SRV_SYS_HDR 0x02 -#define LOC_APN_PROFILE_SRV_SYS_GSM 0x04 -#define LOC_APN_PROFILE_SRV_SYS_WCDMA 0x08 -#define LOC_APN_PROFILE_SRV_SYS_LTE 0x10 -#define LOC_APN_PROFILE_SRV_SYS_MAX 0x1F -/* values for apn_profiles[0].pdp_type */ -#define LOC_APN_PROFILE_PDN_TYPE_IPV4 0x01 -#define LOC_APN_PROFILE_PDN_TYPE_IPV6 0x02 -#define LOC_APN_PROFILE_PDN_TYPE_IPV4V6 0x03 -#define LOC_APN_PROFILE_PDN_TYPE_PPP 0x04 -#define LOC_APN_PROFILE_PDN_TYPE_MAX 0x04 - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_FIXUP_H */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h deleted file mode 100644 index f037428..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_log.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2011 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_API_LOG_H -#define LOC_API_LOG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include "loc_api_rpcgen_common_rpc.h" - -extern int loc_callback_log( - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -); - -extern const char* loc_get_event_atl_open_name(rpc_loc_server_request_e_type loc_event_atl_open); -extern const char* loc_get_event_name(rpc_loc_event_mask_type loc_event_mask); -extern const char* loc_get_ioctl_type_name(rpc_loc_ioctl_e_type ioctl_type); -extern const char* loc_get_ioctl_status_name(uint32 status); -extern const char* loc_get_sess_status_name(rpc_loc_session_status_e_type status); -extern const char* loc_get_engine_state_name(rpc_loc_engine_state_e_type state); -extern const char* loc_get_fix_session_state_name(rpc_loc_fix_session_state_e_type state); -extern const char* loc_get_rpc_reset_event_name(enum rpc_reset_event event); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_LOG_H */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h deleted file mode 100644 index 6df33ae..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_rpc_glue.h +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LOC_API_RPC_GLUE_H -#define LOC_API_RPC_GLUE_H - -/* Include RPC headers */ -#ifdef USE_LOCAL_RPC -#include "rpc_inc/loc_api_common.h" -#include "rpc_inc/loc_api.h" -#include "rpc_inc/loc_api_cb.h" -#endif - -#ifdef USE_QCOM_AUTO_RPC -#include "loc_api_rpcgen_rpc.h" -#include "loc_api_rpcgen_common_rpc.h" -#include "loc_api_rpcgen_cb_rpc.h" -#endif - -/* Boolean */ -/* Other data types in comdef.h are defined in rpc stubs, so fix it here */ -typedef unsigned char boolean; -#define TRUE 1 -#define FALSE 0 - -#include "loc_api_fixup.h" -#include "loc_api_sync_call.h" -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern int loc_api_glue_init(void); -extern int loc_api_null(void); - -typedef int32 (loc_event_cb_f_type)( - void* userData, - rpc_loc_client_handle_type loc_handle, /* handle of the client */ - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -); - -typedef void (loc_reset_notif_cb_f_type)( - void* userData, - CLIENT* clnt, - enum rpc_reset_event event -); - -extern rpc_loc_client_handle_type loc_open( - rpc_loc_event_mask_type event_reg_mask, - loc_event_cb_f_type *event_callback, - loc_reset_notif_cb_f_type *rpc_global_cb, - void* userData -); - -extern int32 loc_close -( - rpc_loc_client_handle_type handle -); - -extern void loc_clear -( - rpc_loc_client_handle_type handle -); - -extern int32 loc_start_fix -( - rpc_loc_client_handle_type handle -); - -extern int32 loc_stop_fix -( - rpc_loc_client_handle_type handle -); - -extern int32 loc_ioctl -( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data -); - -extern int loc_eng_ioctl -( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data_ptr, - uint32 timeout_msec, - rpc_loc_ioctl_callback_s_type *cb_data_ptr -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_RPC_GLUE_H */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h deleted file mode 100644 index 43208bd..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_api_sync_call.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LOC_API_CB_SYNC_H -#define LOC_API_CB_SYNC_H - -#ifdef __cplusplus -extern "C" -{ -#endif -#include "loc_api_rpc_glue.h" -#define LOC_SYNC_CALL_SLOTS_MAX 8 - -typedef struct { - pthread_mutex_t lock; - - /* Client ID */ - rpc_loc_client_handle_type loc_handle; - - /* Callback waiting conditional variable */ - pthread_cond_t loc_cb_arrived_cond; - - /* Callback waiting data block, protected by loc_cb_data_mutex */ - boolean in_use; - boolean signal_sent; - boolean not_available; - rpc_loc_event_mask_type loc_cb_wait_event_mask; /* event to wait for */ - rpc_loc_ioctl_e_type ioctl_type; /* ioctl to wait for */ - rpc_loc_event_payload_u_type loc_cb_received_payload; /* received payload */ - rpc_loc_event_mask_type loc_cb_received_event_mask; /* received event */ -} loc_sync_call_slot_s_type; - -typedef struct { - int num_of_slots; - loc_sync_call_slot_s_type slots[LOC_SYNC_CALL_SLOTS_MAX]; -} loc_sync_call_slot_array_s_type; - -/* Init function */ -void loc_api_sync_call_init(); - -/* Destroy function */ -void loc_api_sync_call_destroy(); - -/* Process Loc API callbacks to wake up blocked user threads */ -void loc_api_callback_process_sync_call( - rpc_loc_client_handle_type loc_handle, /* handle of the client */ - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -); - -/* Reentrant synchronous IOCTL call, using Loc API return code */ -int loc_api_sync_ioctl -( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data_ptr, - uint32 timeout_msec, - rpc_loc_ioctl_callback_s_type *cb_data_ptr -); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_API_CB_SYNC_H */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h deleted file mode 100644 index ba41d08..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/rpc_inc/loc_apicb_appinit.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LOC_APICB_APPINIT_H -#define LOC_APICB_APPINIT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Initialization function for callbacks */ -extern int loc_apicb_app_init(); -extern void loc_apicb_app_deinit(); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_APICB_APPINIT_H */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp deleted file mode 100644 index f4b0ebf..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ /dev/null @@ -1,1475 +0,0 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_api_rpc" - -#include -#include -#ifndef USE_GLIB -#include -#endif /* USE_GLIB */ -#include -#include -#include -#include -#include -#include -#ifdef USE_GLIB -#include -#endif -#include -#include - -using namespace loc_core; - -#define LOC_XTRA_INJECT_DEFAULT_TIMEOUT (3100) -#define XTRA_BLOCK_SIZE (3072) -#define LOC_IOCTL_DEFAULT_TIMEOUT 1000 // 1000 milli-seconds -#define LOC_NI_NOTIF_KEY_ADDRESS "Address" - -/*=========================================================================== -FUNCTION loc_event_cb - -DESCRIPTION - This is the callback function registered by loc_open. - -DEPENDENCIES - N/A - -RETURN VALUE - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int32 loc_event_cb -( - void* user, - rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, - const rpc_loc_event_payload_u_type* loc_event_payload -) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_event_name(loc_event)); - loc_callback_log(loc_event, loc_event_payload); - int32 ret_val = ((LocApiRpc*)user)->locEventCB(client_handle, loc_event, loc_event_payload); - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_rpc_global_cb - -DESCRIPTION - This is the callback function registered by loc_open for RPC global events - -DEPENDENCIES - N/A - -RETURN VALUE - RPC_LOC_API_SUCCESS - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_rpc_global_cb(void* user, CLIENT* clnt, enum rpc_reset_event event) -{ - MODEM_LOG_CALLFLOW(%s, loc_get_rpc_reset_event_name(event)); - ((LocApiRpc*)user)->locRpcGlobalCB(clnt, event); - EXIT_LOG(%p, VOID_RET); -} - -const LOC_API_ADAPTER_EVENT_MASK_T LocApiRpc::maskAll = - LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | - LOC_API_ADAPTER_BIT_SATELLITE_REPORT | - LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST | - LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST | - LOC_API_ADAPTER_BIT_IOCTL_REPORT | - LOC_API_ADAPTER_BIT_STATUS_REPORT | - LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | - LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; - -const rpc_loc_event_mask_type LocApiRpc::locBits[] = -{ - RPC_LOC_EVENT_PARSED_POSITION_REPORT, - RPC_LOC_EVENT_SATELLITE_REPORT, - RPC_LOC_EVENT_NMEA_1HZ_REPORT, - RPC_LOC_EVENT_NMEA_POSITION_REPORT, - RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST, - RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST, - RPC_LOC_EVENT_LOCATION_SERVER_REQUEST, - RPC_LOC_EVENT_IOCTL_REPORT, - RPC_LOC_EVENT_STATUS_REPORT, - RPC_LOC_EVENT_WPS_NEEDED_REQUEST -}; - -LocApiRpc* -LocApiRpc::createLocApiRpc(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - ContextBase* context) -{ - if (NULL == msgTask) { - return NULL; - } - return new LocApiRpc(msgTask, exMask, context); -} - -// constructor -LocApiRpc::LocApiRpc(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - ContextBase* context) : - LocApiBase(msgTask, exMask, context), - client_handle(RPC_LOC_CLIENT_HANDLE_INVALID), - dataEnableLastSet(-1) -{ - memset(apnLastSet, 0, sizeof(apnLastSet)); - loc_api_glue_init(); -} - -LocApiRpc::~LocApiRpc() -{ - close(); -} - -rpc_loc_event_mask_type -LocApiRpc::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) -{ - rpc_loc_event_mask_type newMask = 0; - - for (unsigned int i = 0, bit=1; 0 != mask; i++, bit<<=1) { - if (mask & bit) { - newMask |= locBits[i]; - mask ^= bit; - } - } - - return newMask; -} - -rpc_loc_lock_e_type -LocApiRpc::convertGpsLockMask(LOC_GPS_LOCK_MASK lockMask) -{ - if (isGpsLockAll(lockMask)) - return RPC_LOC_LOCK_ALL; - if (isGpsLockMO(lockMask)) - return RPC_LOC_LOCK_MI; - if (isGpsLockMT(lockMask)) - return RPC_LOC_LOCK_MT; - if (isGpsLockNone(lockMask)) - return RPC_LOC_LOCK_NONE; - return (rpc_loc_lock_e_type)lockMask; -} - -enum loc_api_adapter_err -LocApiRpc::convertErr(int rpcErr) -{ - switch(rpcErr) - { - case RPC_LOC_API_SUCCESS: - return LOC_API_ADAPTER_ERR_SUCCESS; - case RPC_LOC_API_GENERAL_FAILURE: - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - case RPC_LOC_API_UNSUPPORTED: - return LOC_API_ADAPTER_ERR_UNSUPPORTED; - case RPC_LOC_API_INVALID_HANDLE: - return LOC_API_ADAPTER_ERR_INVALID_HANDLE; - case RPC_LOC_API_INVALID_PARAMETER: - return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; - case RPC_LOC_API_ENGINE_BUSY: - return LOC_API_ADAPTER_ERR_ENGINE_BUSY; - case RPC_LOC_API_PHONE_OFFLINE: - return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; - case RPC_LOC_API_TIMEOUT: - return LOC_API_ADAPTER_ERR_TIMEOUT; - case RPC_LOC_API_RPC_MODEM_RESTART: - return LOC_API_ADAPTER_ERR_ENGINE_DOWN; - case RPC_LOC_API_RPC_FAILURE: - return LOC_API_ADAPTER_ERR_FAILURE; - default: - return LOC_API_ADAPTER_ERR_UNKNOWN; - } -} - -void LocApiRpc::locRpcGlobalCB(CLIENT* clnt, enum rpc_reset_event event) -{ - static rpc_loc_engine_state_e_type last_state = RPC_LOC_ENGINE_STATE_MAX; - - switch (event) { - case RPC_SUBSYSTEM_RESTART_BEGIN: - if (RPC_LOC_ENGINE_STATE_OFF != last_state) { - last_state = RPC_LOC_ENGINE_STATE_OFF; - handleEngineDownEvent(); - } - break; - case RPC_SUBSYSTEM_RESTART_END: - if (RPC_LOC_ENGINE_STATE_ON != last_state) { - last_state = RPC_LOC_ENGINE_STATE_ON; - handleEngineUpEvent(); - } - break; - } -} - -int32 LocApiRpc::locEventCB(rpc_loc_client_handle_type client_handle, - rpc_loc_event_mask_type loc_event, - const rpc_loc_event_payload_u_type* loc_event_payload) -{ - // Parsed report - if (loc_event & RPC_LOC_EVENT_PARSED_POSITION_REPORT) - { - reportPosition(&loc_event_payload->rpc_loc_event_payload_u_type_u. - parsed_location_report); - } - - // Satellite report - if (loc_event & RPC_LOC_EVENT_SATELLITE_REPORT) - { - reportSv(&loc_event_payload->rpc_loc_event_payload_u_type_u.gnss_report); - } - - // Status report - if (loc_event & RPC_LOC_EVENT_STATUS_REPORT) - { - reportStatus(&loc_event_payload->rpc_loc_event_payload_u_type_u.status_report); - } - - // NMEA - if (loc_event & RPC_LOC_EVENT_NMEA_1HZ_REPORT) - { - reportNmea(&(loc_event_payload->rpc_loc_event_payload_u_type_u.nmea_report)); - } - // XTRA support: supports only XTRA download - if (loc_event & RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST) - { - if (loc_event_payload->rpc_loc_event_payload_u_type_u.assist_data_request.event == - RPC_LOC_ASSIST_DATA_PREDICTED_ORBITS_REQ) - { - requestXtraData(); - } else if (loc_event_payload->rpc_loc_event_payload_u_type_u.assist_data_request.event == - RPC_LOC_ASSIST_DATA_TIME_REQ) - { - requestTime(); - } else if (loc_event_payload->rpc_loc_event_payload_u_type_u.assist_data_request.event == - RPC_LOC_ASSIST_DATA_POSITION_INJECTION_REQ) - { - requestLocation(); - } - } - - // AGPS data request - if (loc_event & RPC_LOC_EVENT_LOCATION_SERVER_REQUEST) - { - ATLEvent(&loc_event_payload->rpc_loc_event_payload_u_type_u. - loc_server_request); - } - - // NI notify request - if (loc_event & RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST) - { - NIEvent(&loc_event_payload->rpc_loc_event_payload_u_type_u.ni_request); - } - - return RPC_LOC_API_SUCCESS;//We simply want to return sucess here as we do not want to - // cause any issues in RPC thread context -} - -enum loc_api_adapter_err -LocApiRpc::open(LOC_API_ADAPTER_EVENT_MASK_T mask) -{ - enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - - // RPC does not dynamically update the event mask. And in the - // case of RPC, all we support are positioning (gps + agps) - // masks anyways, so we simply mask all of them on always. - // After doing so the first time in a power cycle, we know there - // will the following if condition will never be true any more. - mask = maskAll; - - if (mask != mMask) { - if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { - close(); - } - - mMask = mask; - // it is important to cap the mask here, because not all LocApi's - // can enable the same bits, e.g. foreground and bckground. - client_handle = loc_open(convertMask(mask), - loc_event_cb, - loc_rpc_global_cb, this); - - if (client_handle < 0) { - mMask = 0; - client_handle = RPC_LOC_CLIENT_HANDLE_INVALID; - ret_val = LOC_API_ADAPTER_ERR_INVALID_HANDLE; - } - } - - return ret_val; -} - -enum loc_api_adapter_err -LocApiRpc::close() -{ - if (RPC_LOC_CLIENT_HANDLE_INVALID != client_handle) { - loc_clear(client_handle); - } - - loc_close(client_handle); - mMask = 0; - client_handle = RPC_LOC_CLIENT_HANDLE_INVALID; - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -enum loc_api_adapter_err -LocApiRpc::startFix(const LocPosMode& posMode) { - LOC_LOGD("LocApiRpc::startFix() called"); - return convertErr( - loc_start_fix(client_handle) - ); -} - -enum loc_api_adapter_err -LocApiRpc::stopFix() { - LOC_LOGD("LocApiRpc::stopFix() called"); - return convertErr( - loc_stop_fix(client_handle) - ); -} - -enum loc_api_adapter_err -LocApiRpc::setPositionMode(const LocPosMode& posMode) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_fix_criteria_s_type *fix_criteria_ptr = - &ioctl_data.rpc_loc_ioctl_data_u_type_u.fix_criteria; - rpc_loc_ioctl_e_type ioctl_type = RPC_LOC_IOCTL_SET_FIX_CRITERIA; - rpc_loc_operation_mode_e_type op_mode; - int ret_val; - const LocPosMode* fixCriteria = &posMode; - - ALOGD ("loc_eng_set_position mode, client = %d, interval = %d, mode = %d\n", - (int32) client_handle, fixCriteria->min_interval, fixCriteria->mode); - - switch (fixCriteria->mode) - { - case LOC_POSITION_MODE_MS_BASED: - op_mode = RPC_LOC_OPER_MODE_MSB; - break; - case LOC_POSITION_MODE_MS_ASSISTED: - op_mode = RPC_LOC_OPER_MODE_MSA; - break; - case LOC_POSITION_MODE_RESERVED_1: - op_mode = RPC_LOC_OPER_MODE_SPEED_OPTIMAL; - break; - case LOC_POSITION_MODE_RESERVED_2: - op_mode = RPC_LOC_OPER_MODE_ACCURACY_OPTIMAL; - break; - case LOC_POSITION_MODE_RESERVED_3: - op_mode = RPC_LOC_OPER_MODE_DATA_OPTIMAL; - break; - case LOC_POSITION_MODE_RESERVED_4: - case LOC_POSITION_MODE_RESERVED_5: - op_mode = RPC_LOC_OPER_MODE_MSA; - fix_criteria_ptr->preferred_response_time = 0; - break; - default: - op_mode = RPC_LOC_OPER_MODE_STANDALONE; - } - - fix_criteria_ptr->valid_mask = RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE | - RPC_LOC_FIX_CRIT_VALID_RECURRENCE_TYPE; - fix_criteria_ptr->min_interval = fixCriteria->min_interval; - fix_criteria_ptr->preferred_operation_mode = op_mode; - - fix_criteria_ptr->min_interval = fixCriteria->min_interval; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL; - - if (fixCriteria->preferred_accuracy > 0) { - fix_criteria_ptr->preferred_accuracy = fixCriteria->preferred_accuracy; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY; - } - if (fixCriteria->preferred_time > 0) { - fix_criteria_ptr->preferred_response_time = fixCriteria->preferred_time; - fix_criteria_ptr->valid_mask |= RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME; - } - - switch (fixCriteria->recurrence) { - case GPS_POSITION_RECURRENCE_SINGLE: - fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX; - break; - case GPS_POSITION_RECURRENCE_PERIODIC: - default: - fix_criteria_ptr->recurrence_type = RPC_LOC_PERIODIC_FIX; - break; - } - ioctl_data.disc = ioctl_type; - - ret_val = loc_eng_ioctl (client_handle, - ioctl_type, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - return convertErr(ret_val); -} - -enum loc_api_adapter_err -LocApiRpc::setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_assist_data_time_s_type *time_info_ptr; - rpc_loc_ioctl_e_type ioctl_type = RPC_LOC_IOCTL_INJECT_UTC_TIME; - int ret_val; - - LOC_LOGD ("loc_eng_inject_time, uncertainty = %d\n", uncertainty); - - time_info_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.assistance_data_time; - time_info_ptr->time_utc = time; - time_info_ptr->time_utc += (int64_t)(ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION - timeReference); - time_info_ptr->uncertainty = uncertainty; // Uncertainty in ms - - ioctl_data.disc = ioctl_type; - - ret_val = loc_eng_ioctl (client_handle, - ioctl_type, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - return convertErr(ret_val); -} - -enum loc_api_adapter_err -LocApiRpc::injectPosition(double latitude, double longitude, float accuracy) -{ - /* IOCTL data */ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_assist_data_pos_s_type *assistance_data_position = - &ioctl_data.rpc_loc_ioctl_data_u_type_u.assistance_data_position; - int ret_val; - - /************************************************ - * Fill in latitude, longitude & accuracy - ************************************************/ - - /* This combo is required */ - assistance_data_position->valid_mask = - RPC_LOC_ASSIST_POS_VALID_LATITUDE | - RPC_LOC_ASSIST_POS_VALID_LONGITUDE | - RPC_LOC_ASSIST_POS_VALID_HOR_UNC_CIRCULAR | - RPC_LOC_ASSIST_POS_VALID_CONFIDENCE_HORIZONTAL; - - assistance_data_position->latitude = latitude; - assistance_data_position->longitude = longitude; - assistance_data_position->hor_unc_circular = accuracy; /* Meters assumed */ - assistance_data_position->confidence_horizontal = 63; /* 63% (1 std dev) assumed */ - - /* Log */ - LOC_LOGD("Inject coarse position Lat=%lf, Lon=%lf, Acc=%.2lf\n", - (double) assistance_data_position->latitude, - (double) assistance_data_position->longitude, - (double) assistance_data_position->hor_unc_circular); - - ret_val = loc_eng_ioctl( client_handle, - RPC_LOC_IOCTL_INJECT_POSITION, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - return convertErr(ret_val); -} - -enum loc_api_adapter_err -LocApiRpc::informNiResponse(GpsUserResponseType userResponse, - const void* passThroughData) -{ - rpc_loc_ioctl_data_u_type data; - rpc_loc_ioctl_callback_s_type callback_payload; - - memcpy(&data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.ni_event_pass_back, - passThroughData, sizeof (rpc_loc_ni_event_s_type)); - - rpc_loc_ni_user_resp_e_type resp; - switch (userResponse) - { - case GPS_NI_RESPONSE_ACCEPT: - data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp = - RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT; - break; - case GPS_NI_RESPONSE_DENY: - data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp = - RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY; - break; - case GPS_NI_RESPONSE_NORESP: - default: - data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp = - RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP; - break; - } - - return convertErr( - loc_eng_ioctl(client_handle, - RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE, - &data, - LOC_IOCTL_DEFAULT_TIMEOUT, - &callback_payload) - ); -} - -enum loc_api_adapter_err -LocApiRpc::setAPN(char* apn, int len, boolean force) -{ - enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; - int size = sizeof(apnLastSet); - if (force || memcmp(apnLastSet, apn, size)) { - if (len < size) { - // size will be not larger than its original value - size = len + 1; - } - memcpy(apnLastSet, apn, size); - - if (!isInSession()) { - rpc_loc_ioctl_data_u_type ioctl_data = {RPC_LOC_IOCTL_SET_LBS_APN_PROFILE, {0}}; - ioctl_data.rpc_loc_ioctl_data_u_type_u.apn_profiles[0].srv_system_type = LOC_APN_PROFILE_SRV_SYS_MAX; - ioctl_data.rpc_loc_ioctl_data_u_type_u.apn_profiles[0].pdp_type = LOC_APN_PROFILE_PDN_TYPE_IPV4; - memcpy(&(ioctl_data.rpc_loc_ioctl_data_u_type_u.apn_profiles[0].apn_name), apn, size); - - rtv = convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_LBS_APN_PROFILE, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); - } - } - return rtv; -} - -void LocApiRpc::setInSession(bool inSession) -{ - if (!inSession) { - enableData(dataEnableLastSet, true); - setAPN(apnLastSet, sizeof(apnLastSet)-1, true); - } -} - -enum loc_api_adapter_err -LocApiRpc::setServer(const char* url, int len) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_server_info_s_type *server_info_ptr; - rpc_loc_ioctl_e_type ioctl_cmd; - - ioctl_cmd = RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR; - ioctl_data.disc = ioctl_cmd; - server_info_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.server_addr; - server_info_ptr->addr_type = RPC_LOC_SERVER_ADDR_URL; - server_info_ptr->addr_info.disc = server_info_ptr->addr_type; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.length = len; -#if (AMSS_VERSION==3200) - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_val = (char*) url; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr.addr_len= len; -#else - strlcpy(server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr, url, - sizeof server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.url.addr); -#endif /* #if (AMSS_VERSION==3200) */ - LOC_LOGD ("loc_eng_set_server, addr = %s\n", url); - - return convertErr( - loc_eng_ioctl (client_handle, - ioctl_cmd, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/) - ); -} - -enum loc_api_adapter_err -LocApiRpc::setServer(unsigned int ip, int port, LocServerType type) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_server_info_s_type *server_info_ptr; - rpc_loc_ioctl_e_type ioctl_cmd; - - switch (type) { - case LOC_AGPS_MPC_SERVER: - ioctl_cmd = RPC_LOC_IOCTL_SET_CDMA_MPC_SERVER_ADDR; - break; - case LOC_AGPS_CUSTOM_PDE_SERVER: - ioctl_cmd = RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR; - break; - default: - ioctl_cmd = RPC_LOC_IOCTL_SET_CDMA_PDE_SERVER_ADDR; - break; - } - ioctl_data.disc = ioctl_cmd; - server_info_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.server_addr; - server_info_ptr->addr_type = RPC_LOC_SERVER_ADDR_IPV4; - server_info_ptr->addr_info.disc = server_info_ptr->addr_type; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.ipv4.addr = ip; - server_info_ptr->addr_info.rpc_loc_server_addr_u_type_u.ipv4.port = port; - LOC_LOGD ("setServer, addr = %X:%d\n", (unsigned int) ip, (unsigned int) port); - - return convertErr( - loc_eng_ioctl (client_handle, - ioctl_cmd, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/) - ); -} - -enum loc_api_adapter_err -LocApiRpc::enableData(int enable, boolean force) -{ - enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; - if (force || dataEnableLastSet != enable) { - dataEnableLastSet = enable; - - if (!isInSession()) { - rpc_loc_ioctl_data_u_type ioctl_data = {RPC_LOC_IOCTL_SET_DATA_ENABLE, {0}}; - - ioctl_data.rpc_loc_ioctl_data_u_type_u.data_enable = enable; - rtv = convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_DATA_ENABLE, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); - } - } - return rtv; -} - -enum loc_api_adapter_err -LocApiRpc::deleteAidingData(GpsAidingData bits) -{ - rpc_loc_ioctl_data_u_type ioctl_data = {RPC_LOC_IOCTL_DELETE_ASSIST_DATA, {0}}; - ioctl_data.rpc_loc_ioctl_data_u_type_u.assist_data_delete.type = bits; - - return convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_DELETE_ASSIST_DATA, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); -} - -void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr) -{ - LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; - - UlpLocation location = {0}; - GpsLocationExtended locationExtended = {0}; - - location.size = sizeof(location); - locationExtended.size = sizeof(locationExtended); - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SESSION_STATUS) - { - // Process the position from final and intermediate reports - if (location_report_ptr->session_status == RPC_LOC_SESS_STATUS_SUCCESS || - location_report_ptr->session_status == RPC_LOC_SESS_STATUS_IN_PROGESS) - { - // Latitude & Longitude - if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LATITUDE) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_LONGITUDE) && - (location_report_ptr->latitude != 0 || - location_report_ptr->longitude != 0)) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_LAT_LONG; - location.gpsLocation.latitude = location_report_ptr->latitude; - location.gpsLocation.longitude = location_report_ptr->longitude; - - // Time stamp (UTC) - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_TIMESTAMP_UTC) - { - location.gpsLocation.timestamp = location_report_ptr->timestamp_utc; - } - - // Altitude - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID ) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_ALTITUDE; - location.gpsLocation.altitude = location_report_ptr->altitude_wrt_ellipsoid; - } - - // Speed - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; - location.gpsLocation.speed = location_report_ptr->speed_horizontal; - } - - // Heading - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_BEARING; - location.gpsLocation.bearing = location_report_ptr->heading; - } - - // Uncertainty (circular) - if ( (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) ) - { - location.gpsLocation.flags |= GPS_LOCATION_HAS_ACCURACY; - location.gpsLocation.accuracy = location_report_ptr->hor_unc_circular; - } - - // Technology Mask - - tech_Mask |= location_report_ptr->technology_mask; - //Mark the location source as from GNSS - location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; - location.position_source = ULP_LOCATION_IS_FROM_GNSS; - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_MEAN_SEA_LEVEL) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL; - locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitude_wrt_mean_sea_level; - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_MAGNETIC_VARIATION ) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; - locationExtended.magneticDeviation = location_report_ptr->magnetic_deviation; - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_VERTICAL_UNC) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_UNC; - locationExtended.vert_unc = location_report_ptr->vert_unc; - } - - if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_UNC) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC; - locationExtended.speed_unc = location_report_ptr->speed_unc; - } - - LOC_LOGV("reportPosition: fire callback\n"); - enum loc_sess_status fixStatus = - (location_report_ptr->session_status - == RPC_LOC_SESS_STATUS_IN_PROGESS ? - LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS); - LocApiBase::reportPosition(location, - locationExtended, - (void*)location_report_ptr, - fixStatus, - tech_Mask); - } - } - else - { - LocApiBase::reportPosition(location, - locationExtended, - NULL, - LOC_SESS_FAILURE); - LOC_LOGV("loc_eng_report_position: ignore position report " - "when session status = %d\n", - location_report_ptr->session_status); - } - } - else - { - LOC_LOGV("loc_eng_report_position: ignore position report " - "when session status is not set\n"); - } -} - -void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr) -{ - QtiGnssSvStatus SvStatus = {0}; - GpsLocationExtended locationExtended = {0}; - locationExtended.size = sizeof(locationExtended); - int num_svs_max = 0; - const rpc_loc_sv_info_s_type *sv_info_ptr; - - if (gnss_report_ptr->valid_mask & RPC_LOC_GNSS_INFO_VALID_SV_COUNT) - { - num_svs_max = gnss_report_ptr->sv_count; - if (num_svs_max > GPS_MAX_SVS) - { - num_svs_max = GPS_MAX_SVS; - } - } - - if (gnss_report_ptr->valid_mask & RPC_LOC_GNSS_INFO_VALID_SV_LIST) - { - SvStatus.num_svs = 0; - - for (int i = 0; i < num_svs_max; i++) - { - sv_info_ptr = &(gnss_report_ptr->sv_list.sv_list_val[i]); - if (sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_SYSTEM) - { - if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GPS) - { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvInfo); - SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn; - - // We only have the data field to report gps eph and alm mask - if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_HAS_EPH) && - (sv_info_ptr->has_eph == 1)) - { - SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->prn-1)); - } - - if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_HAS_ALM) && - (sv_info_ptr->has_alm == 1)) - { - SvStatus.almanac_mask |= (1 << (sv_info_ptr->prn-1)); - } - - if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_PROCESS_STATUS) && - (sv_info_ptr->process_status == RPC_LOC_SV_STATUS_TRACK)) - { - SvStatus.gps_used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); - } - } - // SBAS: GPS RPN: 120-151, - // In exteneded measurement report, we follow nmea standard, which is from 33-64. - else if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_SBAS) - { - SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn + 33 - 120; - } - // Gloness: Slot id: 1-32 - // In extended measurement report, we follow nmea standard, which is 65-96 - else if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GLONASS) - { - if ((sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_PROCESS_STATUS) && - (sv_info_ptr->process_status == RPC_LOC_SV_STATUS_TRACK)) - { - SvStatus.glo_used_in_fix_mask |= (1 << (sv_info_ptr->prn-1)); - } - - SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn + (65-1); - } - // Unsupported SV system - else - { - continue; - } - } - - if (sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_SNR) - { - SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; - } - - if (sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_ELEVATION) - { - SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; - } - - if (sv_info_ptr->valid_mask & RPC_LOC_SV_INFO_VALID_AZIMUTH) - { - SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; - } - - SvStatus.num_svs++; - } - } - - if ((gnss_report_ptr->valid_mask & RPC_LOC_GNSS_INFO_VALID_POS_DOP) && - (gnss_report_ptr->valid_mask & RPC_LOC_GNSS_INFO_VALID_HOR_DOP) && - (gnss_report_ptr->valid_mask & RPC_LOC_GNSS_INFO_VALID_VERT_DOP)) - { - locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_DOP; - locationExtended.pdop = gnss_report_ptr->position_dop; - locationExtended.hdop = gnss_report_ptr->horizontal_dop; - locationExtended.vdop = gnss_report_ptr->vertical_dop; - } - - if (SvStatus.num_svs >= 0) - { - LocApiBase::reportSv(SvStatus, - locationExtended, - (void*)gnss_report_ptr); - } -} - -void LocApiRpc::reportStatus(const rpc_loc_status_event_s_type *status_report_ptr) -{ - - if (status_report_ptr->event == RPC_LOC_STATUS_EVENT_ENGINE_STATE) { - if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_ON) - { - LocApiBase::reportStatus(GPS_STATUS_ENGINE_ON); - LocApiBase::reportStatus(GPS_STATUS_SESSION_BEGIN); - } - else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF) - { - LocApiBase::reportStatus(GPS_STATUS_SESSION_END); - LocApiBase::reportStatus(GPS_STATUS_ENGINE_OFF); - } - else - { - LocApiBase::reportStatus(GPS_STATUS_NONE); - } - } - -} - -void LocApiRpc::reportNmea(const rpc_loc_nmea_report_s_type *nmea_report_ptr) -{ - -#if (AMSS_VERSION==3200) - LocApiBase::reportNmea(nmea_report_ptr->nmea_sentences.nmea_sentences_val, - nmea_report_ptr->nmea_sentences.nmea_sentences_len); -#else - LocApiBase::reportNmea(nmea_report_ptr->nmea_sentences, - nmea_report_ptr->length); - LOC_LOGD("loc_eng_report_nmea: $%c%c%c\n", - nmea_report_ptr->nmea_sentences[3], - nmea_report_ptr->nmea_sentences[4], - nmea_report_ptr->nmea_sentences[5]); -#endif /* #if (AMSS_VERSION==3200) */ -} - -enum loc_api_adapter_err -LocApiRpc::setXtraData(char* data, int length) -{ - int rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; - int total_parts; - uint8 part; - uint16 part_len; - uint16 len_injected; - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_ioctl_e_type ioctl_type = RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA; - rpc_loc_predicted_orbits_data_s_type *predicted_orbits_data_ptr; - - LOC_LOGD("qct_loc_eng_inject_xtra_data, xtra size = %d, data ptr = 0x%lx\n", length, (long) data); - - predicted_orbits_data_ptr = &ioctl_data.rpc_loc_ioctl_data_u_type_u.predicted_orbits_data; - predicted_orbits_data_ptr->format_type = RPC_LOC_PREDICTED_ORBITS_XTRA; - predicted_orbits_data_ptr->total_size = length; - total_parts = (length - 1) / XTRA_BLOCK_SIZE + 1; - predicted_orbits_data_ptr->total_parts = total_parts; - - len_injected = 0; // O bytes injected - ioctl_data.disc = ioctl_type; - - // XTRA injection starts with part 1 - for (part = 1; part <= total_parts; part++) - { - predicted_orbits_data_ptr->part = part; - predicted_orbits_data_ptr->part_len = XTRA_BLOCK_SIZE; - if (XTRA_BLOCK_SIZE > (length - len_injected)) - { - predicted_orbits_data_ptr->part_len = length - len_injected; - } - predicted_orbits_data_ptr->data_ptr.data_ptr_len = predicted_orbits_data_ptr->part_len; - predicted_orbits_data_ptr->data_ptr.data_ptr_val = data + len_injected; - - LOC_LOGD("qct_loc_eng_inject_xtra_data, part %d/%d, len = %d, total = %d\n", - predicted_orbits_data_ptr->part, - total_parts, - predicted_orbits_data_ptr->part_len, - len_injected); - - if (part < total_parts) - { - // No callback in this case - rpc_ret_val = loc_ioctl (client_handle, - ioctl_type, - &ioctl_data); - - if (rpc_ret_val != RPC_LOC_API_SUCCESS) - { - LOC_LOGE("loc_ioctl for xtra error: %s\n", loc_get_ioctl_status_name(rpc_ret_val)); - break; - } - //Add a delay of 10 ms so that repeated RPC calls dont starve the modem processor - usleep(10 * 1000); - } - else // part == total_parts - { - // Last part injection, will need to wait for callback - if (!loc_eng_ioctl(client_handle, - ioctl_type, - &ioctl_data, - LOC_XTRA_INJECT_DEFAULT_TIMEOUT, - NULL)) - { - rpc_ret_val = RPC_LOC_API_GENERAL_FAILURE; - } - break; // done with injection - } - - len_injected += predicted_orbits_data_ptr->part_len; - LOC_LOGD("loc_ioctl XTRA injected length: %d\n", len_injected); - } - - return convertErr(rpc_ret_val); -} - -/* Request the Xtra Server Url from the modem */ -enum loc_api_adapter_err -LocApiRpc::requestXtraServer() -{ - loc_api_adapter_err err; - rpc_loc_ioctl_data_u_type data; - rpc_loc_ioctl_callback_s_type callback_data; - - err = convertErr(loc_eng_ioctl(client_handle, - RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE, - &data, - LOC_IOCTL_DEFAULT_TIMEOUT, - &callback_data)); - - if (LOC_API_ADAPTER_ERR_SUCCESS != err) - { - LOC_LOGE("RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE failed!: err=%d\n", err); - return err; - } - else if (RPC_LOC_SESS_STATUS_SUCCESS != callback_data.status) - { - LOC_LOGE("RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE failed!: status=%ld\n", callback_data.status); - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - else if (RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE != callback_data.type) - { - LOC_LOGE("RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE is not the type expected! type=%d\n", callback_data.type); - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - else if (RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE != callback_data.data.disc) - { - LOC_LOGE("RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE is not the disc expected! disc=%d\n", callback_data.data.disc); - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; - } - - reportXtraServer(callback_data.data.rpc_loc_ioctl_callback_data_u_type_u. - predicted_orbits_data_source.servers[0], - callback_data.data.rpc_loc_ioctl_callback_data_u_type_u. - predicted_orbits_data_source.servers[1], - callback_data.data.rpc_loc_ioctl_callback_data_u_type_u. - predicted_orbits_data_source.servers[2], - 255); - - return LOC_API_ADAPTER_ERR_SUCCESS; -} - -enum loc_api_adapter_err -LocApiRpc::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) -{ - rpc_loc_server_open_status_e_type open_status = is_succ ? RPC_LOC_SERVER_OPEN_SUCCESS : RPC_LOC_SERVER_OPEN_FAIL; - rpc_loc_ioctl_data_u_type ioctl_data; - - if (AGPS_TYPE_INVALID == agpsType) { - rpc_loc_server_open_status_s_type *conn_open_status_ptr = - &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status; - - // Fill in data - ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS; - conn_open_status_ptr->conn_handle = handle; - conn_open_status_ptr->open_status = open_status; -#if (AMSS_VERSION==3200) - conn_open_status_ptr->apn_name = apn; /* requires APN */ -#else - if (is_succ) { - strlcpy(conn_open_status_ptr->apn_name, apn, - sizeof conn_open_status_ptr->apn_name); - } else { - conn_open_status_ptr->apn_name[0] = 0; - } -#endif /* #if (AMSS_VERSION==3200) */ - - LOC_LOGD("ATL RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS open %s, APN name = [%s]\n", - log_succ_fail_string(is_succ), - apn); - } else { - rpc_loc_server_multi_open_status_s_type *conn_multi_open_status_ptr = - &ioctl_data.rpc_loc_ioctl_data_u_type_u.multi_conn_open_status; - - // Fill in data - ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS; - conn_multi_open_status_ptr->conn_handle = handle; - conn_multi_open_status_ptr->open_status = open_status; - if (is_succ) { - strlcpy(conn_multi_open_status_ptr->apn_name, apn, - sizeof conn_multi_open_status_ptr->apn_name); - } else { - conn_multi_open_status_ptr->apn_name[0] = 0; - } - - switch(bearer) - { - case AGPS_APN_BEARER_IPV4: - conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_IP; - break; - case AGPS_APN_BEARER_IPV6: - conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_IPV6; - break; - case AGPS_APN_BEARER_IPV4V6: - conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_IPV4V6; - break; - default: - conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_PPP; - } - - LOC_LOGD("ATL RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS open %s, APN name = [%s], pdp_type = %d\n", - log_succ_fail_string(is_succ), - apn, - conn_multi_open_status_ptr->pdp_type); - } - - // Make the IOCTL call - return convertErr( - loc_eng_ioctl(client_handle, - ioctl_data.disc, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); -} - -enum loc_api_adapter_err -LocApiRpc::atlCloseStatus(int handle, int is_succ) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - ioctl_data.disc = RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS; - - rpc_loc_server_close_status_s_type *conn_close_status_ptr = - &ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_close_status; - conn_close_status_ptr->conn_handle = handle; - conn_close_status_ptr->close_status = is_succ ? RPC_LOC_SERVER_CLOSE_SUCCESS : RPC_LOC_SERVER_CLOSE_FAIL; - - // Make the IOCTL call - return convertErr( - loc_eng_ioctl(client_handle, - ioctl_data.disc, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); -} - -void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr) -{ - int connHandle; - AGpsType agps_type; - - LOC_LOGV("RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST event %s)", - loc_get_event_atl_open_name(server_request_ptr->event)); - switch (server_request_ptr->event) - { - case RPC_LOC_SERVER_REQUEST_MULTI_OPEN: - connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.multi_open_req.conn_handle; - if (server_request_ptr->payload.rpc_loc_server_request_u_type_u.multi_open_req.connection_type - == RPC_LOC_SERVER_CONNECTION_LBS) { - agps_type = AGPS_TYPE_SUPL; - LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - AGPS_TYPE_SUPL\n handle - %d", connHandle); - } else { - agps_type = AGPS_TYPE_WWAN_ANY; - LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - AGPS_TYPE_WWAN_ANY\n handle - %d", connHandle); - } - requestATL(connHandle, agps_type); - break; - case RPC_LOC_SERVER_REQUEST_OPEN: - connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle; - LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_OPEN\n handle - %d", connHandle); - requestATL(connHandle, AGPS_TYPE_INVALID); - break; - case RPC_LOC_SERVER_REQUEST_CLOSE: - connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle; - LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_CLOSE\n handle - %d", connHandle); - releaseATL(connHandle); - break; - default: - LOC_LOGE("ATLEvent: event type %d invalid", server_request_ptr->event); - } -} - -void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req) -{ - GpsNiNotification notif = {0}; - - switch (ni_req->event) - { - case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - { - const rpc_loc_ni_vx_notify_verify_req_s_type *vx_req = - &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.vx_req; - LOC_LOGI("VX Notification"); - notif.ni_type = GPS_NI_TYPE_VOICE; - // Requestor ID - hexcode(notif.requestor_id, sizeof notif.requestor_id, - vx_req->requester_id.requester_id, - vx_req->requester_id.requester_id_length); - notif.text_encoding = 0; // No text and no encoding - notif.requestor_id_encoding = convertNiEncodingType(vx_req->encoding_scheme); - NIEventFillVerfiyType(notif, vx_req->notification_priv_type); - } - break; - - case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - { - const rpc_loc_ni_umts_cp_notify_verify_req_s_type *umts_cp_req = - &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.umts_cp_req; - LOC_LOGI("UMTS CP Notification\n"); - notif.ni_type= GPS_NI_TYPE_UMTS_CTRL_PLANE; // Stores notification text -#if (AMSS_VERSION==3200) - hexcode(notif.text, sizeof notif.text, - umts_cp_req->notification_text.notification_text_val, - umts_cp_req->notification_length); - hexcode(notif.requestor_id, sizeof notif.requestor_id, - umts_cp_req->requestor_id.requestor_id_string.requestor_id_string_val, - umts_cp_req->requestor_id.string_len); -#else - hexcode(notif.text, sizeof notif.text, - umts_cp_req->notification_text, - umts_cp_req->notification_length); - hexcode(notif.requestor_id, sizeof notif.requestor_id, - umts_cp_req->requestor_id.requestor_id_string, - umts_cp_req->requestor_id.string_len); -#endif - notif.text_encoding = convertNiEncodingType(umts_cp_req->datacoding_scheme); - notif.requestor_id_encoding = notif.text_encoding; - NIEventFillVerfiyType(notif, umts_cp_req->notification_priv_type); - - // LCS address (using extras field) - if (umts_cp_req->ext_client_address_data.ext_client_address_len != 0) - { - // Copy LCS Address into notif.extras in the format: Address = 012345 - strlcat(notif.extras, LOC_NI_NOTIF_KEY_ADDRESS, sizeof notif.extras); - strlcat(notif.extras, " = ", sizeof notif.extras); - int addr_len = 0; - const char *address_source = NULL; - -#if (AMSS_VERSION==3200) - address_source = umts_cp_req->ext_client_address_data.ext_client_address.ext_client_address_val; -#else - address_source = umts_cp_req->ext_client_address_data.ext_client_address; -#endif /* #if (AMSS_VERSION==3200) */ - - char lcs_addr[32]; // Decoded LCS address for UMTS CP NI - addr_len = decodeAddress(lcs_addr, sizeof lcs_addr, address_source, - umts_cp_req->ext_client_address_data.ext_client_address_len); - - // The address is ASCII string - if (addr_len) - { - strlcat(notif.extras, lcs_addr, sizeof notif.extras); - } - } - } - break; - - case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - { - const rpc_loc_ni_supl_notify_verify_req_s_type *supl_req = - &ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req; - LOC_LOGI("SUPL Notification\n"); - notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; - - if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT) - { -#if (AMSS_VERSION==3200) - hexcode(notif.text, sizeof notif.text, - supl_req->client_name.client_name_string.client_name_string_val, /* buffer */ - supl_req->client_name.string_len /* length */ - ); -#else - hexcode(notif.text, sizeof notif.text, - supl_req->client_name.client_name_string, /* buffer */ - supl_req->client_name.string_len /* length */ - ); -#endif /* #if (AMSS_VERSION==3200) */ - LOC_LOGV("SUPL NI: client_name: %s len=%d", notif.text, supl_req->client_name.string_len); - } - else { - LOC_LOGV("SUPL NI: client_name not present."); - } - - // Requestor ID - if (supl_req->flags & RPC_LOC_NI_REQUESTOR_ID_PRESENT) - { -#if (AMSS_VERSION==3200) - hexcode(notif.requestor_id, sizeof notif.requestor_id, - supl_req->requestor_id.requestor_id_string.requestor_id_string_val, /* buffer */ - supl_req->requestor_id.string_len /* length */ - ); -#else - hexcode(notif.requestor_id, sizeof notif.requestor_id, - supl_req->requestor_id.requestor_id_string, /* buffer */ - supl_req->requestor_id.string_len /* length */ - ); -#endif /* #if (AMSS_VERSION==3200) */ - LOC_LOGV("SUPL NI: requestor_id: %s len=%d", notif.requestor_id, supl_req->requestor_id.string_len); - } - else { - LOC_LOGV("SUPL NI: requestor_id not present."); - } - - // Encoding type - if (supl_req->flags & RPC_LOC_NI_ENCODING_TYPE_PRESENT) - { - notif.text_encoding = convertNiEncodingType(supl_req->datacoding_scheme); - notif.requestor_id_encoding = notif.text_encoding; - } - else { - notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; - } - - NIEventFillVerfiyType(notif, ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req.notification_priv_type); - } - break; - - default: - LOC_LOGE("Unknown NI event: %x\n", (int) ni_req->event); - return; - } - - // this copy will get freed in loc_eng_ni when loc_ni_respond() is called - rpc_loc_ni_event_s_type *copy = (rpc_loc_ni_event_s_type *)malloc(sizeof(*copy)); - memcpy(copy, ni_req, sizeof(*copy)); - requestNiNotify(notif, (const void*)copy); -} - -int LocApiRpc::NIEventFillVerfiyType(GpsNiNotification ¬if, - rpc_loc_ni_notify_verify_e_type notif_priv) -{ - switch (notif_priv) - { - case RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY: - notif.notify_flags = 0; - notif.default_response = GPS_NI_RESPONSE_NORESP; - return 1; - case RPC_LOC_NI_USER_NOTIFY_ONLY: - notif.notify_flags = GPS_NI_NEED_NOTIFY; - notif.default_response = GPS_NI_RESPONSE_NORESP; - return 1; - case RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP: - notif.notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif.default_response = GPS_NI_RESPONSE_ACCEPT; - return 1; - case RPC_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP: - notif.notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; - notif.default_response = GPS_NI_RESPONSE_DENY; - return 1; - case RPC_LOC_NI_USER_PRIVACY_OVERRIDE: - notif.notify_flags = GPS_NI_PRIVACY_OVERRIDE; - notif.default_response = GPS_NI_RESPONSE_NORESP; - return 1; - default: - return 0; - } -} - -enum loc_api_adapter_err -LocApiRpc::setSUPLVersion(uint32_t version) -{ - rpc_loc_ioctl_data_u_type ioctl_data = {RPC_LOC_IOCTL_SET_SUPL_VERSION, {0}}; - ioctl_data.rpc_loc_ioctl_data_u_type_u.supl_version = (int)version; - return convertErr( - loc_eng_ioctl (client_handle, - RPC_LOC_IOCTL_SET_SUPL_VERSION, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL) - ); -} - -GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding) -{ - switch (loc_encoding) - { - case RPC_LOC_NI_SUPL_UTF8: - return GPS_ENC_SUPL_UTF8; - case RPC_LOC_NI_SUPL_UCS2: - return GPS_ENC_SUPL_UCS2; - case RPC_LOC_NI_SUPL_GSM_DEFAULT: - return GPS_ENC_SUPL_GSM_DEFAULT; - case RPC_LOC_NI_SS_LANGUAGE_UNSPEC: - return GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM - default: - return GPS_ENC_UNKNOWN; - } -} - -LocApiBase* getLocApi(const MsgTask* msgTask, - LOC_API_ADAPTER_EVENT_MASK_T exMask, - ContextBase *context) { - return new LocApiRpc(msgTask, exMask, context); -} - -/*Values for lock - 1 = Do not lock any position sessions - 2 = Lock MI position sessions - 3 = Lock MT position sessions - 4 = Lock all position sessions -*/ -int LocApiRpc::setGpsLock(LOC_GPS_LOCK_MASK lockMask) -{ - rpc_loc_ioctl_data_u_type ioctl_data; - boolean ret_val; - LOC_LOGD("%s:%d]: lock: %x\n", __func__, __LINE__, lockMask); - ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = convertGpsLockMask(lockMask); - ioctl_data.disc = RPC_LOC_IOCTL_SET_ENGINE_LOCK; - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_SET_ENGINE_LOCK, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - NULL /* No output information is expected*/); - - LOC_LOGD("%s:%d]: ret_val: %d\n", __func__, __LINE__, (int)ret_val); - return (ret_val == TRUE ? 0 : -1); -} - -/* - Returns - Current value of GPS lock on success - -1 on failure -*/ -int LocApiRpc :: getGpsLock() -{ - rpc_loc_ioctl_data_u_type ioctl_data; - rpc_loc_ioctl_callback_s_type callback_payload; - boolean ret_val; - int ret=0; - LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); - ret_val = loc_eng_ioctl (loc_eng_data.client_handle, - RPC_LOC_IOCTL_GET_ENGINE_LOCK, - &ioctl_data, - LOC_IOCTL_DEFAULT_TIMEOUT, - &callback_payload); - if(ret_val == TRUE) { - ret = (int)callback_payload.data.engine_lock; - LOC_LOGD("%s:%d]: Lock type: %d\n", __func__, __LINE__, ret); - } - else { - LOC_LOGE("%s:%d]: Ioctl failed", __func__, __LINE__); - ret = -1; - } - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return ret; -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c deleted file mode 100644 index 837ef11..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_fixup.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include - -#include "loc_api_fixup.h" - -#ifdef ADD_XDR_FLOAT - -int -xdr_float(xdrp, fp) - XDR *xdrp; - float *fp; -{ - return xdr_long(xdrp, (long*)fp); -} - -int -xdr_double(xdrp, dp) - XDR *xdrp; - double *dp; -{ - return xdr_long(xdrp, (long*)dp + 1) - && xdr_long(xdrp, (long*)dp); -} - -#endif /* ADD_XDR_FLOAT */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c deleted file mode 100644 index eb685fd..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_log.c +++ /dev/null @@ -1,344 +0,0 @@ -/* Copyright (c) 2011, 2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_api_rpc_glue" - -#include "loc_api_log.h" -#include "loc_log.h" -#include "platform_lib_includes.h" -#include "rpc/rpc.h" -#include "loc_api_fixup.h" - -/* Event names */ -loc_name_val_s_type loc_event_name[] = - { - NAME_VAL( RPC_LOC_EVENT_PARSED_POSITION_REPORT ), - NAME_VAL( RPC_LOC_EVENT_SATELLITE_REPORT ), - NAME_VAL( RPC_LOC_EVENT_NMEA_1HZ_REPORT ), - NAME_VAL( RPC_LOC_EVENT_NMEA_POSITION_REPORT ), - NAME_VAL( RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST ), - NAME_VAL( RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST ), - NAME_VAL( RPC_LOC_EVENT_LOCATION_SERVER_REQUEST ), - NAME_VAL( RPC_LOC_EVENT_IOCTL_REPORT ), - NAME_VAL( RPC_LOC_EVENT_STATUS_REPORT ), - NAME_VAL( RPC_LOC_EVENT_WPS_NEEDED_REQUEST ), - }; -int loc_event_num = sizeof loc_event_name / sizeof(loc_name_val_s_type); - -/* Event names */ -loc_name_val_s_type loc_event_atl_open_name[] = - { - NAME_VAL( RPC_LOC_SERVER_REQUEST_OPEN ), - NAME_VAL( RPC_LOC_SERVER_REQUEST_CLOSE ), - NAME_VAL( RPC_LOC_SERVER_REQUEST_MULTI_OPEN ) - }; -int loc_event_atl_open_num = sizeof loc_event_atl_open_name / sizeof(loc_name_val_s_type); - -/* Finds the first event found in the mask */ -const char* loc_get_event_atl_open_name(rpc_loc_server_request_e_type loc_event_atl_open) -{ - return loc_get_name_from_val(loc_event_atl_open_name, loc_event_atl_open_num, - (long) loc_event_atl_open); -} - -/* IOCTL Type names */ -loc_name_val_s_type loc_ioctl_type_name[] = - { - NAME_VAL( RPC_LOC_IOCTL_GET_API_VERSION ), - NAME_VAL( RPC_LOC_IOCTL_SET_FIX_CRITERIA ), - NAME_VAL( RPC_LOC_IOCTL_GET_FIX_CRITERIA ), - NAME_VAL( RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE ), - NAME_VAL( RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA ), - NAME_VAL( RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY ), - NAME_VAL( RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE ), - NAME_VAL( RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD ), - NAME_VAL( RPC_LOC_IOCTL_INJECT_UTC_TIME ), - NAME_VAL( RPC_LOC_IOCTL_INJECT_RTC_VALUE ), - NAME_VAL( RPC_LOC_IOCTL_INJECT_POSITION ), - NAME_VAL( RPC_LOC_IOCTL_QUERY_ENGINE_STATE ), - NAME_VAL( RPC_LOC_IOCTL_ERROR_ESTIMATE_CONFIG), - NAME_VAL( RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS ), - NAME_VAL( RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS ), - NAME_VAL( RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS ), - NAME_VAL( RPC_LOC_IOCTL_SEND_WIPER_POSITION_REPORT ), - NAME_VAL( RPC_LOC_IOCTL_NOTIFY_WIPER_STATUS ), - NAME_VAL( RPC_LOC_IOCTL_SET_ENGINE_LOCK ), - NAME_VAL( RPC_LOC_IOCTL_GET_ENGINE_LOCK ), - NAME_VAL( RPC_LOC_IOCTL_SET_SBAS_CONFIG ), - NAME_VAL( RPC_LOC_IOCTL_GET_SBAS_CONFIG ), - NAME_VAL( RPC_LOC_IOCTL_SET_NMEA_TYPES ), - NAME_VAL( RPC_LOC_IOCTL_GET_NMEA_TYPES ), - NAME_VAL( RPC_LOC_IOCTL_SET_CDMA_PDE_SERVER_ADDR ), - NAME_VAL( RPC_LOC_IOCTL_GET_CDMA_PDE_SERVER_ADDR ), - NAME_VAL( RPC_LOC_IOCTL_SET_CDMA_MPC_SERVER_ADDR ), - NAME_VAL( RPC_LOC_IOCTL_GET_CDMA_MPC_SERVER_ADDR ), - NAME_VAL( RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR ), - NAME_VAL( RPC_LOC_IOCTL_GET_UMTS_SLP_SERVER_ADDR ), - NAME_VAL( RPC_LOC_IOCTL_SET_ON_DEMAND_LPM ), - NAME_VAL( RPC_LOC_IOCTL_GET_ON_DEMAND_LPM ), - NAME_VAL( RPC_LOC_IOCTL_SET_XTRA_T_SESSION_CONTROL ), - NAME_VAL( RPC_LOC_IOCTL_GET_XTRA_T_SESSION_CONTROL ), - NAME_VAL( RPC_LOC_IOCTL_SET_LBS_APN_PROFILE ), - NAME_VAL( RPC_LOC_IOCTL_GET_LBS_APN_PROFILE ), - NAME_VAL( RPC_LOC_IOCTL_SET_XTRA_APN_PROFILE ), - NAME_VAL( RPC_LOC_IOCTL_GET_XTRA_APN_PROFILE ), - NAME_VAL( RPC_LOC_IOCTL_SET_DATA_ENABLE ), - NAME_VAL( RPC_LOC_IOCTL_SET_SUPL_VERSION ), - NAME_VAL( RPC_LOC_IOCTL_GET_SUPL_VERSION ), - NAME_VAL( RPC_LOC_IOCTL_DELETE_ASSIST_DATA ), - NAME_VAL( RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR ), - NAME_VAL( RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR ), - }; -int loc_ioctl_type_num = sizeof loc_ioctl_type_name / sizeof(loc_name_val_s_type); - -/* IOCTL Status names */ -loc_name_val_s_type loc_ioctl_status_name[] = - { - NAME_VAL( RPC_LOC_API_SUCCESS ), - NAME_VAL( RPC_LOC_API_GENERAL_FAILURE ), - NAME_VAL( RPC_LOC_API_UNSUPPORTED ), - NAME_VAL( RPC_LOC_API_INVALID_HANDLE ), - NAME_VAL( RPC_LOC_API_INVALID_PARAMETER ), - NAME_VAL( RPC_LOC_API_ENGINE_BUSY ), - NAME_VAL( RPC_LOC_API_PHONE_OFFLINE ), - NAME_VAL( RPC_LOC_API_TIMEOUT ), - NAME_VAL( RPC_LOC_API_RPC_FAILURE ), - NAME_VAL( RPC_LOC_API_RPC_MODEM_RESTART ) - }; -int loc_ioctl_status_num = sizeof loc_ioctl_status_name / sizeof(loc_name_val_s_type); - -/* Fix session status names */ -loc_name_val_s_type loc_sess_status_name[] = - { - NAME_VAL( RPC_LOC_SESS_STATUS_SUCCESS ), - NAME_VAL( RPC_LOC_SESS_STATUS_IN_PROGESS ), - NAME_VAL( RPC_LOC_SESS_STATUS_GENERAL_FAILURE ), - NAME_VAL( RPC_LOC_SESS_STATUS_TIMEOUT ), - NAME_VAL( RPC_LOC_SESS_STATUS_USER_END ), - NAME_VAL( RPC_LOC_SESS_STATUS_BAD_PARAMETER ), - NAME_VAL( RPC_LOC_SESS_STATUS_PHONE_OFFLINE ), - NAME_VAL( RPC_LOC_SESS_STATUS_USER_END ), - NAME_VAL( RPC_LOC_SESS_STATUS_ENGINE_LOCKED ) - }; -int loc_sess_status_num = sizeof loc_sess_status_name / sizeof(loc_name_val_s_type); - -/* Engine state names */ -loc_name_val_s_type loc_engine_state_name[] = - { - NAME_VAL( RPC_LOC_ENGINE_STATE_ON ), - NAME_VAL( RPC_LOC_ENGINE_STATE_OFF ) - }; -int loc_engine_state_num = sizeof loc_engine_state_name / sizeof(loc_name_val_s_type); - -/* Fix session state names */ -loc_name_val_s_type loc_fix_session_state_name[] = - { - NAME_VAL( RPC_LOC_FIX_SESSION_STATE_BEGIN ), - NAME_VAL( RPC_LOC_FIX_SESSION_STATE_END ) - }; -int loc_fix_session_state_num = sizeof loc_fix_session_state_name / sizeof(loc_name_val_s_type); - - -static const char* log_final_interm_string(int is_final) -{ - return is_final ? "final" : "intermediate"; -} - -/* Logs parsed report */ -static void log_parsed_report(const rpc_loc_parsed_position_s_type *parsed_report) -{ - rpc_loc_session_status_e_type status = parsed_report->session_status; - LOC_LOGD("Session status: %s Valid mask: 0x%X\n", - loc_get_sess_status_name(status), - (uint) parsed_report->valid_mask); - LOC_LOGD("Latitude: %.7f (%s)\n", parsed_report->latitude, - log_final_interm_string( - (parsed_report->valid_mask & RPC_LOC_POS_VALID_LATITUDE) && - parsed_report->session_status == RPC_LOC_SESS_STATUS_SUCCESS)); - LOC_LOGD("Longitude: %.7f\n", parsed_report->longitude); - LOC_LOGD("Accuracy: %.7f\n", parsed_report->hor_unc_circular); -} - -/* Logs status report */ -static void log_status_report(const rpc_loc_status_event_s_type *status_event) -{ - rpc_loc_status_event_e_type event = status_event->event; - switch (event) { - case RPC_LOC_STATUS_EVENT_ENGINE_STATE: - LOC_LOGD("Engine state: %s\n", - loc_get_engine_state_name( - status_event->payload.rpc_loc_status_event_payload_u_type_u.engine_state)); - break; - case RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE: - LOC_LOGD("Fix session state: %s\n", - loc_get_fix_session_state_name( - status_event->payload.rpc_loc_status_event_payload_u_type_u.fix_session_state)); - break; - default: - break; - } -} - -/* Logs valid fields in the GNSS SV constellation report */ -static void log_satellite_report(const rpc_loc_gnss_info_s_type *gnss) -{ - if (gnss->valid_mask & RPC_LOC_GNSS_INFO_VALID_POS_DOP) - { - LOC_LOGV("position dop: %.3f\n", (float) gnss->position_dop); - } - if (gnss->valid_mask & RPC_LOC_GNSS_INFO_VALID_HOR_DOP) - { - LOC_LOGV("horizontal dop: %.3f\n", (float) gnss->horizontal_dop); - } - if (gnss->valid_mask & RPC_LOC_GNSS_INFO_VALID_VERT_DOP) - { - LOC_LOGV("vertical dop: %.3f\n", (float) gnss->vertical_dop); - } - if (gnss->valid_mask & RPC_LOC_GNSS_INFO_VALID_ALTITUDE_ASSUMED) - { - LOC_LOGV("altitude assumed: %d\n", (int) gnss->altitude_assumed); - } - if (gnss->valid_mask & RPC_LOC_GNSS_INFO_VALID_SV_COUNT) - { - LOC_LOGD("sv count: %d\n", (int) gnss->sv_count); - } - if (gnss->valid_mask & RPC_LOC_GNSS_INFO_VALID_SV_LIST) - { - LOC_LOGV("sv list: "); - - if (gnss->sv_count) - { - LOC_LOGV("\n\tsys\tprn\thlth\tproc\teph\talm\telev\tazi\tsnr\n"); - } - else { - LOC_LOGV("empty\n"); - } - - int i; - for (i = 0; i < gnss->sv_count; i++) - { - const rpc_loc_sv_info_s_type *sv = &gnss->sv_list.sv_list_val[i]; - rpc_loc_sv_info_valid_mask_type mask = sv->valid_mask; - LOC_LOGV(" %d: \t%d\t%d\t%d\t%d\t%d\t%d\t%.3f\t%.3f\t%.3f\n", i, - CHECK_MASK(int, sv->system, mask, RPC_LOC_SV_INFO_VALID_SYSTEM), - CHECK_MASK(int, sv->prn, mask, RPC_LOC_SV_INFO_VALID_PRN), - CHECK_MASK(int, sv->health_status, mask, RPC_LOC_SV_INFO_VALID_HEALTH_STATUS), - CHECK_MASK(int, sv->process_status, mask, RPC_LOC_SV_INFO_VALID_PROCESS_STATUS), - CHECK_MASK(int, sv->has_eph, mask, RPC_LOC_SV_INFO_VALID_HAS_EPH), - CHECK_MASK(int, sv->has_alm, mask, RPC_LOC_SV_INFO_VALID_HAS_ALM), - CHECK_MASK(float, sv->elevation, mask, RPC_LOC_SV_INFO_VALID_ELEVATION), - CHECK_MASK(float, sv->azimuth, mask, RPC_LOC_SV_INFO_VALID_AZIMUTH), - CHECK_MASK(float, sv->snr, mask, RPC_LOC_SV_INFO_VALID_SNR) - ); - } - } -} - -/* Logs a callback event */ -int loc_callback_log( - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -) -{ - switch (loc_event) - { - case RPC_LOC_EVENT_SATELLITE_REPORT: - log_satellite_report(&loc_event_payload-> - rpc_loc_event_payload_u_type_u.gnss_report); - break; - case RPC_LOC_EVENT_STATUS_REPORT: - log_status_report(&loc_event_payload-> - rpc_loc_event_payload_u_type_u.status_report); - break; - case RPC_LOC_EVENT_PARSED_POSITION_REPORT: - log_parsed_report(&loc_event_payload-> - rpc_loc_event_payload_u_type_u.parsed_location_report); - break; - default: - break; - } - - return 0; -} - -/* Finds the first event found in the mask */ -const char* loc_get_event_name(rpc_loc_event_mask_type loc_event_mask) -{ - return loc_get_name_from_mask(loc_event_name, loc_event_num, - (long) loc_event_mask); -} - -/* Finds IOCTL type name */ -const char* loc_get_ioctl_type_name(rpc_loc_ioctl_e_type ioctl_type) -{ - return loc_get_name_from_val(loc_ioctl_type_name, loc_ioctl_type_num, - (long) ioctl_type); -} - -/* Finds IOCTL status name */ -const char* loc_get_ioctl_status_name(uint32 status) -{ - return loc_get_name_from_val(loc_ioctl_status_name, loc_ioctl_status_num, - (long) status); -} - -/* Finds session status name */ -const char* loc_get_sess_status_name(rpc_loc_session_status_e_type status) -{ - return loc_get_name_from_val(loc_sess_status_name, loc_sess_status_num, - (long) status); -} - -/* Find engine state name */ -const char* loc_get_engine_state_name(rpc_loc_engine_state_e_type state) -{ - return loc_get_name_from_val(loc_engine_state_name, loc_engine_state_num, - (long) state); -} - -/* Find engine state name */ -const char* loc_get_fix_session_state_name(rpc_loc_fix_session_state_e_type state) -{ - return loc_get_name_from_val(loc_fix_session_state_name, loc_fix_session_state_num, - (long) state); -} - -/* Event names */ -loc_name_val_s_type rpc_reset_event_name[] = -{ - NAME_VAL( RPC_SUBSYSTEM_RESTART_BEGIN ), - NAME_VAL( RPC_SUBSYSTEM_RESTART_END ) -}; -int rpc_reset_event_num = sizeof rpc_reset_event_name / sizeof(loc_name_val_s_type); - -const char* loc_get_rpc_reset_event_name(enum rpc_reset_event event) -{ - return loc_get_name_from_val(rpc_reset_event_name, rpc_reset_event_num, event); -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c deleted file mode 100644 index 8c12426..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_rpc_glue.c +++ /dev/null @@ -1,635 +0,0 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*===================================================================== - - INCLUDE FILES FOR MODULE - -======================================================================*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/* Include RPC headers */ -#include "rpc_inc/loc_api_rpc_glue.h" - -/* Callback init */ -#include "rpc_inc/loc_apicb_appinit.h" - -/* Logging */ -#define LOG_TAG "LocSvc_api_rpc_glue" -#define LOG_NDDEBUG 0 -#ifndef USE_GLIB -#include -#endif /* USE_GLIB */ - -/* Logging Improvement */ -#include "platform_lib_includes.h" -/*Maximum number of Modem init*/ -#define RPC_TRY_NUM 10 - -/*Maximum number of Modem init*/ -#define RPC_TRY_NUM 10 - -/* Uncomment to force ALOGD messages */ -// #define ALOGD ALOGI - -/*===================================================================== - External declarations -======================================================================*/ - -CLIENT* loc_api_clnt = NULL; - -/* Callback ID and pointer */ -#define LOC_API_CB_MAX_CLIENTS 16 -typedef struct -{ - uint32 cb_id; /* same as rpc/types.h */ - loc_event_cb_f_type *cb_func; /* callback func */ - loc_reset_notif_cb_f_type *rpc_cb; /* callback from RPC */ - rpc_loc_client_handle_type handle; /* stores handle for client closing */ - void* user; /* user's own data handle */ -} loc_glue_cb_entry_s_type; - -loc_glue_cb_entry_s_type loc_glue_callback_table[LOC_API_CB_MAX_CLIENTS]; - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_FUNC_VERSION(a,b) RPC_FUNC_VERSION_BASE(a,b) - -#define RPC_CALLBACK_FUNC_VERSION_BASE(a,v,b) a ## v ## b -#define RPC_CALLBACK_FUNC_VERSION(a,v,b) RPC_CALLBACK_FUNC_VERSION_BASE(a,v,b) - -#define LOC_GLUE_CHECK_INIT(ret_type) \ - if (loc_api_clnt == NULL) { EXIT_LOG_CALLFLOW(%d, RPC_LOC_API_RPC_FAILURE); return (ret_type) RPC_LOC_API_RPC_FAILURE; } - -#define LOC_GLUE_CHECK_RESULT(stat, ret_type) \ - if (stat != RPC_SUCCESS) { \ - LOC_LOGE("%s:%d] failure code %d", __func__, __LINE__, stat); \ - return (ret_type)((stat == RPC_SUBSYSTEM_RESTART) ? \ - RPC_LOC_API_RPC_MODEM_RESTART : RPC_LOC_API_RPC_FAILURE); \ - } - -/* Callback functions */ -/* Returns 1 if successful */ -bool_t rpc_loc_event_cb_f_type_svc( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - // The lower word of cd_id is the index - int index = argp->cb_id & 0xFFFF; - - /* Callback not registered, or unexpected ID (shouldn't happen) */ - if (index >= LOC_API_CB_MAX_CLIENTS || loc_glue_callback_table[index].cb_func == NULL) - { - LOC_LOGE("Warning: No callback handler %d.\n", index); - ret->loc_event_cb_f_type_result = 0; - return 1; /* simply return */ - } - - LOC_LOGV("proc: %x prog: %x vers: %x\n", - (int) req->rq_proc, - (int) req->rq_prog, - (int) req->rq_vers); - - LOC_LOGV("Callback received: %x (cb_id=%p handle=%d ret_ptr=%d)\n", - (int) argp->loc_event, - argp->cb_id, - (int) argp->loc_handle, - (int) ret); - - /* Forward callback to real callback procedure */ - rpc_loc_client_handle_type loc_handle = argp->loc_handle; - rpc_loc_event_mask_type loc_event = argp->loc_event; - const rpc_loc_event_payload_u_type* loc_event_payload = - (const rpc_loc_event_payload_u_type*) argp->loc_event_payload; - - /* Gives control to synchronous call handler */ - loc_api_callback_process_sync_call(loc_handle, loc_event, loc_event_payload); - - int32 rc = (loc_glue_callback_table[index].cb_func)(loc_glue_callback_table[index].user, - loc_handle, loc_event, loc_event_payload); - - LOC_LOGV("cb_func=%p", loc_glue_callback_table[index].cb_func); - - ret->loc_event_cb_f_type_result = rc; - - return 1; /* ok */ -} - -int loc_apicbprog_freeresult (SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) -{ - xdr_free (xdr_result, result); - - /* - * Insert additional freeing code here, if needed - */ - // LOC_LOGD("***** loc_apicbprog_freeresult\n"); - - return 1; -} - -/*=========================================================================== - -FUNCTION rpc_loc_event_cb_f_type__svc (MACRO) - -DESCRIPTION - Callback function for Loc API - -RETURN VALUE - 1 for success - 0 for failure - -===========================================================================*/ -bool_t RPC_CALLBACK_FUNC_VERSION(rpc_loc_event_cb_f_type_, RPC_LOC_EVENT_CB_F_TYPE_VERSION, _svc) ( - rpc_loc_event_cb_f_type_args *argp, - rpc_loc_event_cb_f_type_rets *ret, - struct svc_req *req) -{ - return rpc_loc_event_cb_f_type_svc(argp, ret, req); -} - -/*=========================================================================== - -FUNCTION loc_apicbprog__freeresult (MACRO) - -DESCRIPTION - Free up RPC data structure - -RETURN VALUE - 1 for success - 0 for failure - -===========================================================================*/ -#define VERSION_CONCAT(MAJOR,MINOR) MAJOR##MINOR -#define loc_apicb_prog_VER_freeresult(M,N) \ -int RPC_CALLBACK_FUNC_VERSION(loc_apicbprog_, VERSION_CONCAT(M,N), _freeresult) \ -(SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) \ -{ \ - return loc_apicbprog_freeresult(transp, xdr_result, result); \ -} - -/* Define all of the possible minors */ -loc_apicb_prog_VER_freeresult(RPC_LOC_API_API_MAJOR_NUM, 0001); -loc_apicb_prog_VER_freeresult(RPC_LOC_API_API_MAJOR_NUM, 0002); -loc_apicb_prog_VER_freeresult(RPC_LOC_API_API_MAJOR_NUM, 0003); -loc_apicb_prog_VER_freeresult(RPC_LOC_API_API_MAJOR_NUM, 0004); -loc_apicb_prog_VER_freeresult(RPC_LOC_API_API_MAJOR_NUM, 0005); -loc_apicb_prog_VER_freeresult(RPC_LOC_API_API_MAJOR_NUM, 0006); - -/*=========================================================================== - -FUNCTION rpc_loc_api_cb_null__svc (MACRO) [Patch for wrong RPCGEN stubs] - -DESCRIPTION - Null callback function for Loc API - -RETURN VALUE - 1 for success - -===========================================================================*/ -#define rpc_loc_api_cb_null_VER_svc(M,N) \ -bool_t RPC_CALLBACK_FUNC_VERSION(rpc_loc_api_cb_null_, VERSION_CONCAT(M,N), _svc) ( \ - void *a, int *b, struct svc_req *req) \ -{ \ - return 1; \ -} - -/* Define all of the possible minors */ -rpc_loc_api_cb_null_VER_svc(RPC_LOC_API_API_MAJOR_NUM, 0001); -rpc_loc_api_cb_null_VER_svc(RPC_LOC_API_API_MAJOR_NUM, 0002); -rpc_loc_api_cb_null_VER_svc(RPC_LOC_API_API_MAJOR_NUM, 0003); -rpc_loc_api_cb_null_VER_svc(RPC_LOC_API_API_MAJOR_NUM, 0004); -rpc_loc_api_cb_null_VER_svc(RPC_LOC_API_API_MAJOR_NUM, 0005); -rpc_loc_api_cb_null_VER_svc(RPC_LOC_API_API_MAJOR_NUM, 0006); - -static void loc_api_glue_rpc_cb(CLIENT* client, enum rpc_reset_event event) -{ - int i; - for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) { - if (NULL != loc_glue_callback_table[i].rpc_cb) { - loc_glue_callback_table[i].rpc_cb(loc_glue_callback_table[i].user, client, event); - } - } -} - -/*=========================================================================== - -FUNCTION loc_api_glue_init - -DESCRIPTION - Initiates the RPC client - -RETURN VALUE - 1 for success - 0 for failure - -===========================================================================*/ -int loc_api_glue_init(void) -{ - if (loc_api_clnt == NULL) - { - /* Initialize data */ - int i; - int pid = getpid(); - for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) - { - loc_glue_callback_table[i].cb_id = i | (pid << 16); - loc_glue_callback_table[i].cb_func = NULL; - loc_glue_callback_table[i].handle = -1; - loc_glue_callback_table[i].rpc_cb = NULL; - loc_glue_callback_table[i].user = NULL; - } - - /* Print msg */ - LOC_LOGV("Trying to create RPC client...\n"); - loc_api_clnt = clnt_create(NULL, LOC_APIPROG, LOC_APIVERS, NULL); - LOC_LOGV("Created loc_api_clnt ---- %x\n", (unsigned int)loc_api_clnt); - - if (loc_api_clnt == NULL) - { - LOC_LOGE("Error: cannot create RPC client.\n"); - return 0; - } - - /* Init RPC callbacks */ - loc_api_sync_call_init(); - - int rc = loc_apicb_app_init(); - if (rc >= 0) - { - LOC_LOGD("Loc API RPC client initialized.\n"); - clnt_register_reset_notification_cb(loc_api_clnt, loc_api_glue_rpc_cb); - } - else { - LOC_LOGE("Loc API callback initialization failed.\n"); - return 0; - } - } - - return 1; -} - -rpc_loc_client_handle_type loc_open ( - rpc_loc_event_mask_type event_reg_mask, - loc_event_cb_f_type *event_callback, - loc_reset_notif_cb_f_type *rpc_cb, - void* userData -) -{ - int try_num = RPC_TRY_NUM; - ENTRY_LOG(); - LOC_GLUE_CHECK_INIT(rpc_loc_client_handle_type); - - rpc_loc_client_handle_type ret_val; - - rpc_loc_open_args args; - args.event_reg_mask = event_reg_mask; - - int i, j = LOC_API_CB_MAX_CLIENTS; - for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) - { - if (loc_glue_callback_table[i].user == userData) - { - LOC_LOGW("Client already opened service (callback=%p)...\n", - event_callback); - break; - } else if (j == LOC_API_CB_MAX_CLIENTS && - loc_glue_callback_table[i].user == NULL) { - j = i; - } - } - - if (i == LOC_API_CB_MAX_CLIENTS) - { - i = j; - } - - if (i == LOC_API_CB_MAX_CLIENTS) - { - LOC_LOGE("Too many clients opened at once...\n"); - return RPC_LOC_CLIENT_HANDLE_INVALID; - } - - loc_glue_callback_table[i].cb_func = event_callback; - loc_glue_callback_table[i].rpc_cb = rpc_cb; - loc_glue_callback_table[i].user = userData; - - args.event_callback = loc_glue_callback_table[i].cb_id; - LOC_LOGV("cb_id=%d, func=0x%x", i, (unsigned int) event_callback); - - rpc_loc_open_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - EXIT_LOG_CALLFLOW(%s, "loc client open"); - - /*try more for rpc_loc_open_xx()*/ - - do - { - stat = RPC_FUNC_VERSION(rpc_loc_open_, RPC_LOC_OPEN_VERSION)(&args, &rets, loc_api_clnt); - ret_val = (rpc_loc_client_handle_type) rets.loc_open_result; - try_num--; - - }while( (RPC_SUCCESS != stat||0 > ret_val) && 0 != try_num ); - - LOC_GLUE_CHECK_RESULT(stat, int32); - - /* save the handle in the table */ - loc_glue_callback_table[i].handle = (rpc_loc_client_handle_type) rets.loc_open_result; - - return ret_val; - -} - -int32 loc_close -( - rpc_loc_client_handle_type handle -) -{ - ENTRY_LOG(); - LOC_GLUE_CHECK_INIT(int32); - - int32 ret_val; - - rpc_loc_close_args args; - args.handle = handle; - - rpc_loc_close_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - EXIT_LOG_CALLFLOW(%s, "loc client close"); - stat = RPC_FUNC_VERSION(rpc_loc_close_, RPC_LOC_CLOSE_VERSION)(&args, &rets, loc_api_clnt); - - loc_clear(handle); - - LOC_GLUE_CHECK_RESULT(stat, int32); - ret_val = (int32) rets.loc_close_result; - - return ret_val; -} - -void loc_clear(rpc_loc_client_handle_type handle) { - /* Clean the client's callback function in callback table */ - int i; - for (i = 0; i < LOC_API_CB_MAX_CLIENTS; i++) - { - if (loc_glue_callback_table[i].handle == handle) - { - /* Found the client */ - loc_glue_callback_table[i].cb_func = NULL; - loc_glue_callback_table[i].rpc_cb = NULL; - loc_glue_callback_table[i].handle = -1; - loc_glue_callback_table[i].user = NULL; - break; - } - } - - if (i == LOC_API_CB_MAX_CLIENTS) - { - LOC_LOGW("Handle not found (handle=%d)...\n", (int) handle); - } -} - -int32 loc_start_fix -( - rpc_loc_client_handle_type handle -) -{ - ENTRY_LOG(); - LOC_GLUE_CHECK_INIT(int32); - - int32 ret_val; - - rpc_loc_start_fix_args args; - args.handle = handle; - - rpc_loc_start_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - EXIT_LOG_CALLFLOW(%s, "loc start fix"); - stat = RPC_FUNC_VERSION(rpc_loc_start_fix_, RPC_LOC_START_FIX_VERSION)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - ret_val = (int32) rets.loc_start_fix_result; - - return ret_val; -} - -int32 loc_stop_fix -( - rpc_loc_client_handle_type handle -) -{ - ENTRY_LOG(); - LOC_GLUE_CHECK_INIT(int32); - - int32 ret_val; - - rpc_loc_stop_fix_args args; - args.handle = handle; - - rpc_loc_stop_fix_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - EXIT_LOG_CALLFLOW(%s, "loc stop fix"); - stat = RPC_FUNC_VERSION(rpc_loc_stop_fix_, RPC_LOC_STOP_FIX_VERSION)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - ret_val = (int32) rets.loc_stop_fix_result; - - return ret_val; -} - -int32 loc_ioctl -( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data -) -{ - ENTRY_LOG(); - LOC_GLUE_CHECK_INIT(int32); - - int32 ret_val; - - rpc_loc_ioctl_args args; - args.handle = handle; - args.ioctl_data = ioctl_data; - args.ioctl_type = ioctl_type; - if (ioctl_data != NULL) - { - /* Assign ioctl union discriminator */ - ioctl_data->disc = ioctl_type; - - /* In case the user hasn't filled in other disc fields, - automatically fill them in here */ - switch (ioctl_type) - { - case RPC_LOC_IOCTL_GET_API_VERSION: - break; - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - break; - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - break; - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - break; - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - break; - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - break; - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - break; - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - break; - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - break; - case RPC_LOC_IOCTL_INJECT_RTC_VALUE: - break; - case RPC_LOC_IOCTL_INJECT_POSITION: - break; - case RPC_LOC_IOCTL_QUERY_ENGINE_STATE: - break; - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - break; - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - break; - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - break; - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - break; - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - break; - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - break; - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - break; - case RPC_LOC_IOCTL_GET_NMEA_TYPES: - break; - case RPC_LOC_IOCTL_SET_CDMA_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_CDMA_MPC_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - args.ioctl_data->rpc_loc_ioctl_data_u_type_u.server_addr.addr_info.disc = - args.ioctl_data->rpc_loc_ioctl_data_u_type_u.server_addr.addr_type; - break; - case RPC_LOC_IOCTL_GET_CDMA_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CDMA_MPC_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_UMTS_SLP_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - break; - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - break; - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - break; - default: - break; - } /* switch */ - } /* ioctl_data != NULL */ - - rpc_loc_ioctl_rets rets; - enum clnt_stat stat = RPC_SUCCESS; - - EXIT_LOG_CALLFLOW(%s, loc_get_ioctl_type_name(ioctl_type)); - stat = RPC_FUNC_VERSION(rpc_loc_ioctl_, RPC_LOC_IOCTL_VERSION)(&args, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - ret_val = (int32) rets.loc_ioctl_result; - - return ret_val; -} - -/* Returns 0 if error */ -int32 loc_api_null(void) -{ - LOC_GLUE_CHECK_INIT(int32); - - int32 rets; - enum clnt_stat stat = RPC_SUCCESS; - - clnt_unregister_reset_notification_cb(loc_api_clnt); - stat = RPC_FUNC_VERSION(rpc_loc_api_null_, RPC_LOC_API_NULL_VERSION)(NULL, &rets, loc_api_clnt); - LOC_GLUE_CHECK_RESULT(stat, int32); - - return (int32) rets; -} - -/*=========================================================================== - -FUNCTION loc_eng_ioctl - -DESCRIPTION - This function calls loc_ioctl and waits for the callback result before - returning back to the user. - -DEPENDENCIES - N/A - -RETURN VALUE - TRUE if successful - FALSE if failed - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_ioctl -( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data_ptr, - uint32 timeout_msec, - rpc_loc_ioctl_callback_s_type *cb_data_ptr -) -{ - int ret_val = RPC_LOC_API_SUCCESS; - - ret_val = loc_api_sync_ioctl(handle, ioctl_type, ioctl_data_ptr, timeout_msec, cb_data_ptr); - - LOC_LOGD("loc_eng_ioctl result: client = %d, ioctl_type = %s, returt %s\n", - (int32) handle, - loc_get_ioctl_type_name(ioctl_type), - loc_get_ioctl_status_name(ret_val) ); - - return ret_val; -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c deleted file mode 100644 index ae629d7..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_api_sync_call.c +++ /dev/null @@ -1,565 +0,0 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include "loc_api_sync_call.h" - -/* Logging */ -#define LOG_TAG "LocSvc_api_rpc_glue" -// #define LOG_NDDEBUG 0 -#ifndef USE_GLIB -#include -#endif /* USE_GLIB */ - -/*************************************************************************** - * DATA FOR ASYNCHRONOUS RPC PROCESSING - **************************************************************************/ -loc_sync_call_slot_array_s_type loc_sync_data; - -pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; -boolean loc_sync_call_inited = 0; - -/*=========================================================================== - -FUNCTION loc_api_sync_call_init - -DESCRIPTION - Initialize this module - -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_api_sync_call_init() -{ - pthread_mutex_lock(&loc_sync_call_mutex); - if (loc_sync_call_inited == 1) { - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - loc_sync_call_inited = 1; - - loc_sync_data.num_of_slots = LOC_SYNC_CALL_SLOTS_MAX; - - int i; - for (i = 0; i < loc_sync_data.num_of_slots; i++) - { - loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i]; - - pthread_mutex_init(&slot->lock, NULL); - pthread_cond_init(&slot->loc_cb_arrived_cond, NULL); - - slot->not_available = 0; - slot->in_use = 0; - slot->loc_handle = -1; - slot->loc_cb_wait_event_mask = 0; /* event to wait */ - slot->loc_cb_received_event_mask = 0; /* received event */ - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_api_sync_call_destroy - -DESCRIPTION - Initialize this module - -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_api_sync_call_destroy() -{ - int i; - - pthread_mutex_lock(&loc_sync_call_mutex); - if (loc_sync_call_inited == 0) { - pthread_mutex_unlock(&loc_sync_call_mutex); - return; - } - loc_sync_call_inited = 0; - - for (i = 0; i < loc_sync_data.num_of_slots; i++) - { - loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i]; - - pthread_mutex_lock(&slot->lock); - - slot->not_available = 1; - - pthread_mutex_unlock(&slot->lock); - - pthread_cond_destroy(&slot->loc_cb_arrived_cond); - pthread_mutex_destroy(&slot->lock); - } - - pthread_mutex_unlock(&loc_sync_call_mutex); -} - -/*=========================================================================== - -FUNCTION loc_match_callback - -DESCRIPTION - Checks if an awaited event has arrived - -RETURN VALUE - TRUE arrived - FALSE not matching - -===========================================================================*/ -static boolean loc_match_callback( - rpc_loc_event_mask_type wait_mask, - rpc_loc_ioctl_e_type wait_ioctl, - rpc_loc_event_mask_type event_mask, - const rpc_loc_event_payload_u_type *callback_payload -) -{ - if ((event_mask & wait_mask) == 0) return FALSE; - - if (event_mask != RPC_LOC_EVENT_IOCTL_REPORT || wait_ioctl == 0 || - ( (callback_payload != NULL) && - callback_payload->rpc_loc_event_payload_u_type_u.ioctl_report.type == wait_ioctl) ) - return TRUE; - - return FALSE; -} - -/*=========================================================================== - -FUNCTION loc_api_callback_process_sync_call - -DESCRIPTION - Wakes up blocked API calls to check if the needed callback has arrived - -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_api_callback_process_sync_call( - rpc_loc_client_handle_type loc_handle, /* handle of the client */ - rpc_loc_event_mask_type loc_event, /* event mask */ - const rpc_loc_event_payload_u_type* loc_event_payload /* payload */ -) -{ - int i; - - ALOGV("loc_handle = 0x%lx, loc_event = 0x%lx", loc_handle, loc_event); - for (i = 0; i < loc_sync_data.num_of_slots; i++) - { - loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i]; - - pthread_mutex_lock(&slot->lock); - - if (slot->in_use && - slot->signal_sent == 0 && - slot->loc_handle == loc_handle && - loc_match_callback(slot->loc_cb_wait_event_mask, slot->ioctl_type, loc_event, loc_event_payload)) - { - memcpy(&slot->loc_cb_received_payload, loc_event_payload, sizeof (rpc_loc_event_payload_u_type)); - - slot->loc_cb_received_event_mask = loc_event; - - ALOGV("signal slot %d in_use %d, loc_handle 0x%lx, event_mask 0x%1x, ioctl_type %d", i, slot->in_use, slot->loc_handle, (int) slot->loc_cb_wait_event_mask, (int) slot->ioctl_type); - pthread_cond_signal(&slot->loc_cb_arrived_cond); - slot->signal_sent = 1; - - pthread_mutex_unlock(&slot->lock); - break; - } else { - /* do nothing */ - } - - pthread_mutex_unlock(&slot->lock); - } -} - -/*=========================================================================== - -FUNCTION loc_lock_a_slot - -DESCRIPTION - Allocates a buffer slot for the synchronous API call - -DEPENDENCIES - N/A - -RETURN VALUE - Select ID (>=0) : successful - -1 : buffer full - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_lock_a_slot() -{ - int i, select_id = -1; /* no free buffer */ - - for (i = 0; i < loc_sync_data.num_of_slots; i++) - { - loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i]; - if (pthread_mutex_trylock(&slot->lock) == EBUSY) - { - ALOGV("trylock EBUSY : %d", i); - continue; - } - - if (!slot->in_use && !slot->not_available) - { - select_id = i; - /* Return from here and leave the mutex locked. - * will unlock it in loc_unlock_slot() - */ - break; - } - /* ALOGV("slot %d in_use = %d, not_available = %d : %d", i, slot->in_use, slot->not_available, i); */ - pthread_mutex_unlock(&slot->lock); - } - - return select_id; -} - -/*=========================================================================== - -FUNCTION loc_unlock_slot - -DESCRIPTION - Unlocks a buffer slot - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_unlock_slot(int select_id) -{ - pthread_mutex_unlock(&loc_sync_data.slots[select_id].lock); -} - -/*=========================================================================== - -FUNCTION loc_lock_slot - -DESCRIPTION - Locks a specific slot that was previously locked from loc_lock_a_slot - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_lock_slot(int select_id) -{ - pthread_mutex_lock(&loc_sync_data.slots[select_id].lock); -} - -/*=========================================================================== - -FUNCTION loc_set_slot_in_use - -DESCRIPTION - Sets the in_use flag of slot to true or false. - Should be called only after the slot is locked - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_set_slot_in_use(int select_id, boolean in_use) -{ - loc_sync_data.slots[select_id].in_use = in_use; - if (in_use == 1) - loc_sync_data.slots[select_id].signal_sent = 0; -} - -/*=========================================================================== - -FUNCTION loc_api_save_callback - -DESCRIPTION - Selects which callback or IOCTL event to wait for. - - The event_mask specifies the event(s). If it is RPC_LOC_EVENT_IOCTL_REPORT, - then ioctl_type specifies the IOCTL event. - - If ioctl_type is non-zero, RPC_LOC_EVENT_IOCTL_REPORT is automatically added. - -DEPENDENCIES - N/A - -RETURN VALUE - Select ID (>=0) : successful - -1 : out of buffer - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_api_save_callback( - int select_id, /* Selected slot */ - rpc_loc_client_handle_type loc_handle, /* Client handle */ - rpc_loc_event_mask_type event_mask, /* Event mask to wait for */ - rpc_loc_ioctl_e_type ioctl_type /* IOCTL type to wait for */ -) -{ - loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[select_id]; - - slot->loc_handle = loc_handle; - - slot->loc_cb_wait_event_mask = event_mask; - slot->ioctl_type = ioctl_type; - if (ioctl_type) slot->loc_cb_wait_event_mask |= RPC_LOC_EVENT_IOCTL_REPORT; - - return; -} - -/*=========================================================================== - -FUNCTION loc_save_user_payload - -DESCRIPTION - Saves received payload into user data structures - -RETURN VALUE - None - -===========================================================================*/ -static void loc_save_user_payload( - rpc_loc_event_payload_u_type *user_cb_payload, - rpc_loc_ioctl_callback_s_type *user_ioctl_buffer, - const rpc_loc_event_payload_u_type *received_cb_payload -) -{ - if (user_cb_payload) - { - memcpy(user_cb_payload, received_cb_payload, - sizeof (rpc_loc_event_payload_u_type)); - } - if (user_ioctl_buffer) - { - memcpy(user_ioctl_buffer, - &received_cb_payload->rpc_loc_event_payload_u_type_u.ioctl_report, - sizeof *user_ioctl_buffer); - } -} - -/*=========================================================================== - -FUNCTION loc_api_wait_callback - -DESCRIPTION - Waits for a selected callback. The wait expires in timeout_seconds seconds. - - If the function is called before an existing wait has finished, it will - immediately return EBUSY. - -DEPENDENCIES - N/A - -RETURN VALUE - RPC_LOC_API_SUCCESS if successful (0) - RPC_LOC_API_TIMEOUT if timed out - RPC_LOC_API_ENGINE_BUSY if already in a wait - RPC_LOC_API_INVALID_PARAMETER if callback is not yet selected - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_api_wait_callback( - int select_id, /* ID from loc_select_callback() */ - int timeout_seconds, /* Timeout in this number of seconds */ - rpc_loc_event_payload_u_type *callback_payload, /* Pointer to callback payload buffer, can be NULL */ - rpc_loc_ioctl_callback_s_type *ioctl_payload /* Pointer to IOCTL payload, can be NULL */ -) -{ - int ret_val = RPC_LOC_API_SUCCESS; /* the return value of this function: 0 = no error */ - int rc = 0; /* return code from pthread calls */ - - struct timespec expire_time; - - loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[select_id]; - - clock_gettime(CLOCK_REALTIME, &expire_time); - expire_time.tv_sec += timeout_seconds; - - /* Waiting */ - while (slot->signal_sent == 0 && rc != ETIMEDOUT) { - rc = pthread_cond_timedwait(&slot->loc_cb_arrived_cond, - &slot->lock, &expire_time); - } - - if (rc == ETIMEDOUT) - { - ret_val = RPC_LOC_API_TIMEOUT; /* Timed out */ - ALOGE("TIMEOUT: %d", select_id); - } - else { - /* Obtained the first awaited callback */ - ret_val = RPC_LOC_API_SUCCESS; /* Successful */ - loc_save_user_payload(callback_payload, ioctl_payload, &slot->loc_cb_received_payload); - } - - return ret_val; -} - -/*=========================================================================== - -FUNCTION loc_api_sync_ioctl - -DESCRIPTION - Synchronous IOCTL call (reentrant version) - -DEPENDENCIES - N/A - -RETURN VALUE - Loc API error code (0 = success) - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_api_sync_ioctl -( - rpc_loc_client_handle_type handle, - rpc_loc_ioctl_e_type ioctl_type, - rpc_loc_ioctl_data_u_type* ioctl_data_ptr, - uint32 timeout_msec, - rpc_loc_ioctl_callback_s_type *cb_data_ptr -) -{ - int rc = -1; - int select_id; - rpc_loc_ioctl_callback_s_type callback_data; - - select_id = loc_lock_a_slot(); - - if (select_id < 0 || select_id >= loc_sync_data.num_of_slots) - { - ALOGE("slot not available ioctl_type = %s", - loc_get_ioctl_type_name(ioctl_type)); - return rc; - } - - loc_set_slot_in_use(select_id, 1); // set slot in use to true - - // Select the callback we are waiting for - loc_api_save_callback(select_id, handle, 0, ioctl_type); - - loc_unlock_slot(select_id); // slot is unlocked, but in_use is still true - - // we want to avoid keeping the slot locked during the loc_ioctl because the rpc - // framework will also lock a different mutex during this call, and typically - // locking two different mutexes at the same time can lead to deadlock. - rc = loc_ioctl(handle, ioctl_type, ioctl_data_ptr); - - loc_lock_slot(select_id); - - if (rc != RPC_LOC_API_SUCCESS) - { - ALOGE("loc_ioctl failed select_id = %d, ioctl_type %s, returned %s", - select_id, loc_get_ioctl_type_name(ioctl_type), loc_get_ioctl_status_name(rc)); - } - else { - ALOGV("select_id = %d, ioctl_type %d, returned RPC_LOC_API_SUCCESS", - select_id, ioctl_type); - // Wait for the callback of loc_ioctl - if ((rc = loc_api_wait_callback(select_id, timeout_msec / 1000, NULL, &callback_data)) != 0) - { - // Callback waiting failed - ALOGE("callback wait failed select_id = %d, ioctl_type %s, returned %s", - select_id, loc_get_ioctl_type_name(ioctl_type), loc_get_ioctl_status_name(rc)); - } - else - { - if (cb_data_ptr) memcpy(cb_data_ptr, &callback_data, sizeof *cb_data_ptr); - if (callback_data.status != RPC_LOC_API_SUCCESS) - { - rc = callback_data.status; - ALOGE("callback status failed select_id = %d, ioctl_type %s, returned %s", - select_id, loc_get_ioctl_type_name(ioctl_type), loc_get_ioctl_status_name(rc)); - } else { - ALOGV("callback status success select_id = %d, ioctl_type %d, returned %d", - select_id, ioctl_type, rc); - } - } /* wait callback */ - } /* loc_ioctl */ - - loc_set_slot_in_use(select_id, 0); // set slot in use to false - loc_unlock_slot(select_id); - - return rc; -} - - diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c deleted file mode 100644 index db5b291..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/loc_apicb_appinit.c +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "rpc/rpc.h" - -/* Include RPC headers */ -#ifdef USE_LOCAL_RPC -#include "rpc_inc/loc_api_common.h" -#include "rpc_inc/loc_api.h" -#include "rpc_inc/loc_api_cb.h" -#endif - -#ifdef USE_QCOM_AUTO_RPC -#include "loc_api_rpcgen_rpc.h" -#include "loc_api_rpcgen_common_rpc.h" -#include "loc_api_rpcgen_cb_rpc.h" -#endif - -#include "rpc_inc/loc_api_fixup.h" -#include "loc_apicb_appinit.h" - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_CB_FUNC_VERS(a,b) RPC_FUNC_VERSION_BASE(a,b) - -static SVCXPRT* svrPort = NULL; - -extern void RPC_CB_FUNC_VERS(loc_apicbprog_,LOC_APICBVERS_0001)(struct svc_req *rqstp, register SVCXPRT *transp); - -int loc_apicb_app_init(void) -{ - - /* Register a callback server to use the loc_apicbprog_* function */ - if (svrPort == NULL) { - svrPort = svcrtr_create(); - } - if (!svrPort) return -1; - - xprt_register(svrPort); - if(svc_register(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001, RPC_CB_FUNC_VERS(loc_apicbprog_,LOC_APICBVERS_0001),0)) - { - return 0; - } - else - { - return -1; - } -} - -void loc_apicb_app_deinit(void) -{ - if (svrPort == NULL) - { - return; - } - - svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001); - xprt_unregister(svrPort); - svc_destroy(svrPort); - svrPort = NULL; -} - diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk deleted file mode 100644 index c0987e6..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Android.mk +++ /dev/null @@ -1,36 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -# functions -LOC_RPCGEN_APIS_PATH := $(TARGET_OUT_INTERMEDIATES)/loc_api/libloc_api_rpcgen_intermediates -LOC_RPCGEN_APIS_PATH_FL := ../../../../../$(TARGET_OUT_INTERMEDIATES)/loc_api/libloc_api_rpcgen_intermediates - -LOCAL_MODULE := libloc_api_rpcgen -LOCAL_MODULE_OWNER := qcom - -LOCAL_SHARED_LIBRARIES := \ - librpc \ - libcommondefs - -LOCAL_SRC_FILES += \ - src/loc_api_rpcgen_cb_xdr.c \ - src/loc_api_rpcgen_common_xdr.c \ - src/loc_api_rpcgen_cb_svc.c \ - src/loc_api_rpcgen_clnt.c \ - src/loc_api_rpcgen_xdr.c - -LOCAL_C_INCLUDES += hardware/msm7k/librpc -LOCAL_C_INCLUDES += $(LOC_RPCGEN_APIS_PATH)/../../SHARED_LIBRARIES/libcommondefs_intermediates/inc -LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc -LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libcommondefs/rpcgen/inc - -LOCAL_COPY_HEADERS_TO := loc_api/rpcgen/inc -LOCAL_COPY_HEADERS := inc/loc_api_rpcgen_rpc.h -LOCAL_COPY_HEADERS += inc/loc_api_rpcgen_common_rpc.h -LOCAL_COPY_HEADERS += inc/loc_api_rpcgen_cb_rpc.h -LOCAL_COPY_HEADERS += inc/loc_apicb_appinit.h - -LOCAL_LDLIBS += -lpthread -LOCAL_PRELINK_MODULE := false -include $(BUILD_STATIC_LIBRARY) diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am deleted file mode 100644 index 4ac8c8a..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -AM_CFLAGS = \ - -I../../../utils \ - -I./inc \ - $(MSM7K_CFLAGS) - -requiredlibs = \ - ../../../utils/libgps_utils_so.la \ - $(MSM7K_LIBS) - -h_sources = \ - inc/loc_api_rpcgen_rpc.h \ - inc/loc_api_rpcgen_common_rpc.h \ - inc/loc_api_rpcgen_cb_rpc.h \ - inc/loc_apicb_appinit.h - -c_sources = \ - src/loc_api_rpcgen_cb_xdr.c \ - src/loc_api_rpcgen_common_xdr.c \ - src/loc_api_rpcgen_cb_svc.c \ - src/loc_api_rpcgen_clnt.c \ - src/loc_api_rpcgen_xdr.c - - - -library_includedir = $(pkgincludedir)/libloc_api-rpc-50001/libloc_api-rpc-stub/inc -library_include_HEADERS = $(h_sources) -libloc_api_rpcgen_la_SOURCES = $(c_sources) $(h_sources) - -if USE_GLIB -libloc_api_rpcgen_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_api_rpcgen_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_api_rpcgen_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_api_rpcgen_la_CFLAGS = $(AM_CFLAGS) -libloc_api_rpcgen_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libloc_api_rpcgen_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_api_rpcgen_la_LIBADD = $(requiredlibs) -lstdc++ - -#Create and Install Libraries -lib_LTLIBRARIES = libloc_api_rpcgen.la diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h deleted file mode 100644 index 87f2c37..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_cb_rpc.h +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_CB_RPC_H_RPCGEN -#define _LOC_API_CB_RPC_H_RPCGEN - -#include "librpc.h" -#include "commondefs_rpcgen_rpc.h" -#include "loc_api_rpcgen_common_rpc.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -struct rpc_loc_event_cb_f_type_args { - rpc_uint32 cb_id; - rpc_loc_client_handle_type loc_handle; - rpc_loc_event_mask_type loc_event; - rpc_loc_event_payload_u_type *loc_event_payload; -}; -typedef struct rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_args; - -struct rpc_loc_event_cb_f_type_rets { - rpc_int32 loc_event_cb_f_type_result; -}; -typedef struct rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_rets; -#define LOC_APICBVERS 0x00050006 - -#define LOC_APICBPROG 0x3100008C -#define LOC_APICBVERS_0001 0x00050001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00050001(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, CLIENT *); -extern bool_t rpc_loc_event_cb_f_type_0x00050001_svc(rpc_loc_event_cb_f_type_args *, rpc_loc_event_cb_f_type_rets *, struct svc_req *); -extern int loc_apicbprog_0x00050001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_event_cb_f_type 1 -extern enum clnt_stat rpc_loc_event_cb_f_type_0x00050001(); -extern bool_t rpc_loc_event_cb_f_type_0x00050001_svc(); -extern int loc_apicbprog_0x00050001_freeresult (); -#endif /* K&R C */ -#define LOC_APICBVERS_0002 0x00050002 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_cb_null 0xffffff00 -extern enum clnt_stat rpc_loc_api_cb_null_0x00050002(void *, int *, CLIENT *); -extern bool_t rpc_loc_api_cb_null_0x00050002_svc(void *, int *, struct svc_req *); -extern int loc_apicbprog_0x00050002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_cb_null 0xffffff00 -extern enum clnt_stat rpc_loc_api_cb_null_0x00050002(); -extern bool_t rpc_loc_api_cb_null_0x00050002_svc(); -extern int loc_apicbprog_0x00050002_freeresult (); -#endif /* K&R C */ -#define LOC_APICBVERS_0003 0x00050003 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_cb_null_0x00050003(void *, int *, CLIENT *); -extern bool_t rpc_loc_api_cb_null_0x00050003_svc(void *, int *, struct svc_req *); -extern int loc_apicbprog_0x00050003_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_cb_null_0x00050003(); -extern bool_t rpc_loc_api_cb_null_0x00050003_svc(); -extern int loc_apicbprog_0x00050003_freeresult (); -#endif /* K&R C */ -#define LOC_APICBVERS_0004 0x00050004 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_cb_null_0x00050004(void *, int *, CLIENT *); -extern bool_t rpc_loc_api_cb_null_0x00050004_svc(void *, int *, struct svc_req *); -extern int loc_apicbprog_0x00050004_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_cb_null_0x00050004(); -extern bool_t rpc_loc_api_cb_null_0x00050004_svc(); -extern int loc_apicbprog_0x00050004_freeresult (); -#endif /* K&R C */ -#define LOC_APICBVERS_0005 0x00050005 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_cb_null_0x00050005(void *, int *, CLIENT *); -extern bool_t rpc_loc_api_cb_null_0x00050005_svc(void *, int *, struct svc_req *); -extern int loc_apicbprog_0x00050005_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_cb_null_0x00050005(); -extern bool_t rpc_loc_api_cb_null_0x00050005_svc(); -extern int loc_apicbprog_0x00050005_freeresult (); -#endif /* K&R C */ -#define LOC_APICBVERS_0006 0x00050006 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_cb_null_0x00050006(void *, int *, CLIENT *); -extern bool_t rpc_loc_api_cb_null_0x00050006_svc(void *, int *, struct svc_req *); -extern int loc_apicbprog_0x00050006_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_cb_null_0x00050006(); -extern bool_t rpc_loc_api_cb_null_0x00050006_svc(); -extern int loc_apicbprog_0x00050006_freeresult (); -#endif /* K&R C */ - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_rpc_loc_event_cb_f_type_args (XDR *, rpc_loc_event_cb_f_type_args*); -extern bool_t xdr_rpc_loc_event_cb_f_type_rets (XDR *, rpc_loc_event_cb_f_type_rets*); - -#else /* K&R C */ -extern bool_t xdr_rpc_loc_event_cb_f_type_args (); -extern bool_t xdr_rpc_loc_event_cb_f_type_rets (); - -#endif /* K&R C */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_LOC_API_CB_RPC_H_RPCGEN */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h deleted file mode 100644 index 8107de2..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_common_rpc.h +++ /dev/null @@ -1,1261 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_COMMON_RPC_H_RPCGEN -#define _LOC_API_COMMON_RPC_H_RPCGEN - -#include "librpc.h" -#include "commondefs_rpcgen_rpc.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define LOC_API_TOOLVERS 0x00040030 -#define LOC_API_FEATURES 0x00000001 -#define RPC_LOC_EVENT_STATUS_REPORT 0x00000100 -#define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST 0x00000020 -#define RPC_LOC_EVENT_WPS_NEEDED_REQUEST 0x00000200 -#define RPC_LOC_EVENT_SATELLITE_REPORT 0x00000002 -#define RPC_LOC_EVENT_PARSED_POSITION_REPORT 0x00000001 -#define RPC_LOC_EVENT_RESERVED 0x8000000000000000 -#define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST 0x00000040 -#define RPC_LOC_EVENT_NMEA_POSITION_REPORT 0x00000008 -#define RPC_LOC_EVENT_IOCTL_REPORT 0x00000080 -#define RPC_LOC_EVENT_NMEA_1HZ_REPORT 0x00000004 -#define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST 0x00000010 -#define RPC_LOC_API_CB_NULL_VERSION 0x00050002 -#define RPC_LOC_EVENT_CB_F_TYPE_VERSION 0x00050001 -#define RPC_LOC_API_API_VERSIONS_VERSION 0x00050001 -#define RPC_LOC_STOP_FIX_VERSION 0x00050001 -#define RPC_LOC_START_FIX_VERSION 0x00050001 -#define RPC_LOC_IOCTL_VERSION 0x00050001 -#define RPC_LOC_CLOSE_VERSION 0x00050001 -#define RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION 0x00050001 -#define RPC_LOC_OPEN_VERSION 0x00050001 -#define RPC_LOC_API_NULL_VERSION 0x00050001 -#define RPC_LOC_API_API_MAJOR_NUM 0x0005 -#define RPC_LOC_APIAPI_VERSION_IS_HASHKEY 0 - -typedef rpc_int32 rpc_loc_client_handle_type; - -typedef rpc_uint64 rpc_loc_event_mask_type; - -typedef rpc_uint64 rpc_loc_position_valid_mask_type; - -typedef rpc_uint32 rpc_loc_pos_technology_mask_type; - -enum rpc_loc_session_status_e_type { - RPC_LOC_SESS_STATUS_SUCCESS = 0, - RPC_LOC_SESS_STATUS_IN_PROGESS = 1, - RPC_LOC_SESS_STATUS_GENERAL_FAILURE = 2, - RPC_LOC_SESS_STATUS_TIMEOUT = 3, - RPC_LOC_SESS_STATUS_USER_END = 4, - RPC_LOC_SESS_STATUS_BAD_PARAMETER = 5, - RPC_LOC_SESS_STATUS_PHONE_OFFLINE = 6, - RPC_LOC_SESS_STATUS_ENGINE_LOCKED = 7, - RPC_LOC_SESS_STATUS_MAX = 268435456, -}; -typedef enum rpc_loc_session_status_e_type rpc_loc_session_status_e_type; - -struct rpc_loc_calendar_time_s_type { - rpc_uint16 year; - u_char month; - u_char day_of_week; - u_char day; - u_char hour; - u_char minute; - u_char second; - rpc_uint16 millisecond; -}; -typedef struct rpc_loc_calendar_time_s_type rpc_loc_calendar_time_s_type; - -struct rpc_loc_parsed_position_s_type { - rpc_loc_position_valid_mask_type valid_mask; - rpc_loc_session_status_e_type session_status; - rpc_loc_calendar_time_s_type timestamp_calendar; - rpc_uint64 timestamp_utc; - rpc_uint8 leap_seconds; - float time_unc; - double latitude; - double longitude; - float altitude_wrt_ellipsoid; - float altitude_wrt_mean_sea_level; - float speed_horizontal; - float speed_vertical; - float heading; - float hor_unc_circular; - float hor_unc_ellipse_semi_major; - float hor_unc_ellipse_semi_minor; - float hor_unc_ellipse_orient_azimuth; - float vert_unc; - float speed_unc; - float heading_unc; - u_char confidence_horizontal; - u_char confidence_vertical; - float magnetic_deviation; - rpc_loc_pos_technology_mask_type technology_mask; -}; -typedef struct rpc_loc_parsed_position_s_type rpc_loc_parsed_position_s_type; - -enum rpc_loc_sv_system_e_type { - RPC_LOC_SV_SYSTEM_GPS = 1, - RPC_LOC_SV_SYSTEM_GALILEO = 2, - RPC_LOC_SV_SYSTEM_SBAS = 3, - RPC_LOC_SV_SYSTEM_COMPASS = 4, - RPC_LOC_SV_SYSTEM_GLONASS = 5, - RPC_LOC_SV_SYSTEM_MAX = 268435456, -}; -typedef enum rpc_loc_sv_system_e_type rpc_loc_sv_system_e_type; - -enum rpc_loc_sv_status_e_type { - RPC_LOC_SV_STATUS_IDLE = 1, - RPC_LOC_SV_STATUS_SEARCH = 2, - RPC_LOC_SV_STATUS_TRACK = 3, - RPC_LOC_SV_STATUS_MAX = 268435456, -}; -typedef enum rpc_loc_sv_status_e_type rpc_loc_sv_status_e_type; - -typedef rpc_uint32 rpc_loc_sv_info_valid_mask_type; - -struct rpc_loc_sv_info_s_type { - rpc_loc_sv_info_valid_mask_type valid_mask; - rpc_loc_sv_system_e_type system; - rpc_uint8 prn; - rpc_uint8 health_status; - rpc_loc_sv_status_e_type process_status; - rpc_boolean has_eph; - rpc_boolean has_alm; - float elevation; - float azimuth; - float snr; -}; -typedef struct rpc_loc_sv_info_s_type rpc_loc_sv_info_s_type; - -typedef rpc_uint32 rpc_loc_gnss_info_valid_mask_type; - -struct rpc_loc_gnss_info_s_type { - rpc_loc_gnss_info_valid_mask_type valid_mask; - float position_dop; - float horizontal_dop; - float vertical_dop; - rpc_boolean altitude_assumed; - rpc_uint16 sv_count; - struct { - u_int sv_list_len; - rpc_loc_sv_info_s_type *sv_list_val; - } sv_list; -}; -typedef struct rpc_loc_gnss_info_s_type rpc_loc_gnss_info_s_type; - -struct rpc_loc_nmea_report_s_type { - rpc_uint16 length; - char nmea_sentences[200]; -}; -typedef struct rpc_loc_nmea_report_s_type rpc_loc_nmea_report_s_type; - -enum rpc_loc_status_event_e_type { - RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, - RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE = 2, - RPC_LOC_STATUS_EVENT_MAX = 268435456, -}; -typedef enum rpc_loc_status_event_e_type rpc_loc_status_event_e_type; - -enum rpc_loc_engine_state_e_type { - RPC_LOC_ENGINE_STATE_ON = 1, - RPC_LOC_ENGINE_STATE_OFF = 2, - RPC_LOC_ENGINE_STATE_MAX = 268435456, -}; -typedef enum rpc_loc_engine_state_e_type rpc_loc_engine_state_e_type; - -enum rpc_loc_fix_session_state_e_type { - RPC_LOC_FIX_SESSION_STATE_BEGIN = 1, - RPC_LOC_FIX_SESSION_STATE_END = 2, - RPC_LOC_FIX_SESSION_STATE_MAX = 268435456, -}; -typedef enum rpc_loc_fix_session_state_e_type rpc_loc_fix_session_state_e_type; - -struct rpc_loc_status_event_payload_u_type { - rpc_loc_status_event_e_type disc; - union { - rpc_loc_engine_state_e_type engine_state; - rpc_loc_fix_session_state_e_type fix_session_state; - } rpc_loc_status_event_payload_u_type_u; -}; -typedef struct rpc_loc_status_event_payload_u_type rpc_loc_status_event_payload_u_type; - -struct rpc_loc_status_event_s_type { - rpc_loc_status_event_e_type event; - rpc_loc_status_event_payload_u_type payload; -}; -typedef struct rpc_loc_status_event_s_type rpc_loc_status_event_s_type; - -enum rpc_loc_server_addr_e_type { - RPC_LOC_SERVER_ADDR_IPV4 = 1, - RPC_LOC_SERVER_ADDR_URL = 2, - RPC_LOC_SERVER_ADDR_IPV6 = 3, - RPC_LOC_SERVER_ADDR_MAX = 268435456, -}; -typedef enum rpc_loc_server_addr_e_type rpc_loc_server_addr_e_type; - -struct rpc_loc_server_addr_ipv4_type { - rpc_uint32 addr; - rpc_uint16 port; -}; -typedef struct rpc_loc_server_addr_ipv4_type rpc_loc_server_addr_ipv4_type; - -struct rpc_loc_server_addr_url_type { - rpc_uint16 length; - char addr[256]; -}; -typedef struct rpc_loc_server_addr_url_type rpc_loc_server_addr_url_type; - -struct rpc_loc_server_addr_ipv6_type { - rpc_uint16 addr[8]; - rpc_uint32 port; -}; -typedef struct rpc_loc_server_addr_ipv6_type rpc_loc_server_addr_ipv6_type; - -struct rpc_loc_server_addr_u_type { - rpc_loc_server_addr_e_type disc; - union { - rpc_loc_server_addr_ipv4_type ipv4; - rpc_loc_server_addr_url_type url; - rpc_loc_server_addr_ipv6_type ipv6; - } rpc_loc_server_addr_u_type_u; -}; -typedef struct rpc_loc_server_addr_u_type rpc_loc_server_addr_u_type; - -struct rpc_loc_server_info_s_type { - rpc_loc_server_addr_e_type addr_type; - rpc_loc_server_addr_u_type addr_info; -}; -typedef struct rpc_loc_server_info_s_type rpc_loc_server_info_s_type; - -enum rpc_loc_ni_notify_verify_e_type { - RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY = 1, - RPC_LOC_NI_USER_NOTIFY_ONLY = 2, - RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP = 3, - RPC_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP = 4, - RPC_LOC_NI_USER_PRIVACY_OVERRIDE = 5, - RPC_LOC_NI_USER_NOTIFY_VERITY_TYPE_MAX = 268435456, -}; -typedef enum rpc_loc_ni_notify_verify_e_type rpc_loc_ni_notify_verify_e_type; - -enum rpc_loc_ni_event_e_type { - RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ = 1, - RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ = 2, - RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ = 3, - RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ = 4, - RPC_LOC_NI_EVENT_MAX = 268435456, -}; -typedef enum rpc_loc_ni_event_e_type rpc_loc_ni_event_e_type; - -enum rpc_loc_ni_datacoding_scheme_e_type { - RPC_LOC_NI_PRESUPL_ISO646IRV = 0, - RPC_LOC_NI_PRESUPL_ISO8859 = 1, - RPC_LOC_NI_PRESUPL_UTF8 = 2, - RPC_LOC_NI_PRESUPL_UTF16 = 3, - RPC_LOC_NI_PRESUPL_UCS2 = 4, - RPC_LOC_NI_PRESUPL_GSM_DEFAULT = 5, - RPC_LOC_NI_PRESUPL_SHIFT_JIS = 6, - RPC_LOC_NI_PRESUPL_JIS = 7, - RPC_LOC_NI_PRESUPL_EUC = 8, - RPC_LOC_NI_PRESUPL_GB2312 = 9, - RPC_LOC_NI_PRESUPL_CNS11643 = 10, - RPC_LOC_NI_PRESUPL_KSC1001 = 11, - RPC_LOC_NI_PRESUPL_ENCODING_UNKNOWN = 2147483647, - RPC_LOC_NI_SS_GERMAN = 12, - RPC_LOC_NI_SS_ENGLISH = 13, - RPC_LOC_NI_SS_ITALIAN = 14, - RPC_LOC_NI_SS_FRENCH = 15, - RPC_LOC_NI_SS_SPANISH = 16, - RPC_LOC_NI_SS_DUTCH = 17, - RPC_LOC_NI_SS_SWEDISH = 18, - RPC_LOC_NI_SS_DANISH = 19, - RPC_LOC_NI_SS_PORTUGUESE = 20, - RPC_LOC_NI_SS_FINNISH = 21, - RPC_LOC_NI_SS_NORWEGIAN = 22, - RPC_LOC_NI_SS_GREEK = 23, - RPC_LOC_NI_SS_TURKISH = 24, - RPC_LOC_NI_SS_HUNGARIAN = 25, - RPC_LOC_NI_SS_POLISH = 26, - RPC_LOC_NI_SS_LANGUAGE_UNSPEC = 27, - RPC_LOC_NI_SUPL_UTF8 = 28, - RPC_LOC_NI_SUPL_UCS2 = 29, - RPC_LOC_NI_SUPL_GSM_DEFAULT = 30, - RPC_LOC_NI_SUPL_ENCODING_UNKNOWN = 2147483647, -}; -typedef enum rpc_loc_ni_datacoding_scheme_e_type rpc_loc_ni_datacoding_scheme_e_type; - -enum rpc_loc_ni_vx_requester_id_encoding_scheme_e_type { - RPC_LOC_NI_VX_OCTET = 0, - RPC_LOC_NI_VX_EXN_PROTOCOL_MSG = 1, - RPC_LOC_NI_VX_ASCII = 2, - RPC_LOC_NI_VX_IA5 = 3, - RPC_LOC_NI_VX_UNICODE = 4, - RPC_LOC_NI_VX_SHIFT_JIS = 5, - RPC_LOC_NI_VX_KOREAN = 6, - RPC_LOC_NI_VX_LATIN_HEBREW = 7, - RPC_LOC_NI_VX_LATIN = 8, - RPC_LOC_NI_VX_GSM = 9, - RPC_LOC_NI_VX_ENCODING_TYPE_MAX = 268435456, -}; -typedef enum rpc_loc_ni_vx_requester_id_encoding_scheme_e_type rpc_loc_ni_vx_requester_id_encoding_scheme_e_type; - -enum rpc_loc_ni_vx_pos_mode_e_type { - RPC_LOC_VX_MS_ASSISTED_ONLY = 1, - RPC_LOC_VX_MS_BASED_ONLY = 2, - RPC_LOC_VX_MS_ASSISTED_PREF_MSBASED_ALLWD = 3, - RPC_LOC_VX_MS_BASED_PREF_ASSISTED_ALLWD = 4, - RPC_LOC_VX_POS_MODE_MAX = 268435456, -}; -typedef enum rpc_loc_ni_vx_pos_mode_e_type rpc_loc_ni_vx_pos_mode_e_type; - -struct rpc_loc_ni_vx_requester_id_s_type { - u_char requester_id_length; - char requester_id[200]; -}; -typedef struct rpc_loc_ni_vx_requester_id_s_type rpc_loc_ni_vx_requester_id_s_type; - -struct rpc_loc_ni_vx_notify_verify_req_s_type { - rpc_loc_ni_notify_verify_e_type notification_priv_type; - u_char pos_qos_incl; - u_char pos_qos; - rpc_uint32 num_fixes; - rpc_uint32 tbf; - rpc_loc_ni_vx_pos_mode_e_type pos_mode; - rpc_loc_ni_vx_requester_id_encoding_scheme_e_type encoding_scheme; - rpc_loc_ni_vx_requester_id_s_type requester_id; - rpc_uint16 user_resp_timer_val; -}; -typedef struct rpc_loc_ni_vx_notify_verify_req_s_type rpc_loc_ni_vx_notify_verify_req_s_type; - -enum rpc_loc_ni_supl_pos_method_e_type { - RPC_LOC_NI_POSMETHOD_AGPS_SETASSISTED = 1, - RPC_LOC_NI_POSMETHOD_AGPS_SETBASED = 2, - RPC_LOC_NI_POSMETHOD_AGPS_SETASSISTED_PREF = 3, - RPC_LOC_NI_POSMETHOD_AGPS_SETBASED_PREF = 4, - RPC_LOC_NI_POSMETHOD_AUTONOMOUS_GPS = 5, - RPC_LOC_NI_POSMETHOD_AFLT = 6, - RPC_LOC_NI_POSMETHOD_ECID = 7, - RPC_LOC_NI_POSMETHOD_EOTD = 8, - RPC_LOC_NI_POSMETHOD_OTDOA = 9, - RPC_LOC_NI_POSMETHOD_NO_POSITION = 10, - RPC_LOC_NI_POSMETHOD_MAX = 268435456, -}; -typedef enum rpc_loc_ni_supl_pos_method_e_type rpc_loc_ni_supl_pos_method_e_type; - -struct rpc_loc_ni_supl_slp_session_id_s_type { - u_char presence; - char session_id[4]; - rpc_loc_server_info_s_type slp_address; -}; -typedef struct rpc_loc_ni_supl_slp_session_id_s_type rpc_loc_ni_supl_slp_session_id_s_type; - -struct rpc_loc_ni_requestor_id_s_type { - u_char data_coding_scheme; - char requestor_id_string[200]; - u_char string_len; -}; -typedef struct rpc_loc_ni_requestor_id_s_type rpc_loc_ni_requestor_id_s_type; - -struct rpc_loc_ni_supl_client_name_s_type { - u_char data_coding_scheme; - char client_name_string[64]; - u_char string_len; -}; -typedef struct rpc_loc_ni_supl_client_name_s_type rpc_loc_ni_supl_client_name_s_type; - -struct rpc_loc_ni_supl_qop_s_type { - u_char bit_mask; - u_char horacc; - u_char veracc; - rpc_uint16 maxLocAge; - u_char delay; -}; -typedef struct rpc_loc_ni_supl_qop_s_type rpc_loc_ni_supl_qop_s_type; - -struct rpc_loc_ni_supl_notify_verify_req_s_type { - rpc_loc_ni_notify_verify_e_type notification_priv_type; - rpc_uint16 flags; - rpc_loc_ni_supl_slp_session_id_s_type supl_slp_session_id; - char supl_hash[8]; - rpc_loc_ni_datacoding_scheme_e_type datacoding_scheme; - rpc_loc_ni_supl_pos_method_e_type pos_method; - rpc_loc_ni_requestor_id_s_type requestor_id; - rpc_loc_ni_supl_client_name_s_type client_name; - rpc_loc_ni_supl_qop_s_type supl_qop; - rpc_uint16 user_response_timer; -}; -typedef struct rpc_loc_ni_supl_notify_verify_req_s_type rpc_loc_ni_supl_notify_verify_req_s_type; - -struct rpc_loc_ni_ext_client_address_s_type { - u_char ext_client_address_len; - char ext_client_address[20]; -}; -typedef struct rpc_loc_ni_ext_client_address_s_type rpc_loc_ni_ext_client_address_s_type; - -enum rpc_loc_ni_location_type_e_type { - RPC_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION = 1, - RPC_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION = 2, - RPC_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION = 3, - RPC_LOC_NI_LOCATIONTYPE_MAX = 268435456, -}; -typedef enum rpc_loc_ni_location_type_e_type rpc_loc_ni_location_type_e_type; - -struct rpc_loc_ni_deferred_location_s_type { - u_char unused_bits; - u_char ms_available; -}; -typedef struct rpc_loc_ni_deferred_location_s_type rpc_loc_ni_deferred_location_s_type; - -struct rpc_loc_ni_codeword_string_s_type { - u_char data_coding_scheme; - char lcs_codeword_string[20]; - u_char string_len; -}; -typedef struct rpc_loc_ni_codeword_string_s_type rpc_loc_ni_codeword_string_s_type; - -struct rpc_loc_ni_service_type_id_s_type { - u_char lcs_service_type_id; -}; -typedef struct rpc_loc_ni_service_type_id_s_type rpc_loc_ni_service_type_id_s_type; - -struct rpc_loc_ni_umts_cp_notify_verify_req_s_type { - rpc_loc_ni_notify_verify_e_type notification_priv_type; - u_char invoke_id; - rpc_uint16 flags; - u_char notification_length; - char notification_text[64]; - rpc_loc_ni_datacoding_scheme_e_type datacoding_scheme; - rpc_loc_ni_ext_client_address_s_type ext_client_address_data; - rpc_loc_ni_location_type_e_type location_type; - rpc_loc_ni_deferred_location_s_type deferred_location; - rpc_loc_ni_requestor_id_s_type requestor_id; - rpc_loc_ni_codeword_string_s_type codeword_string; - rpc_loc_ni_service_type_id_s_type service_type_id; - rpc_uint16 user_response_timer; -}; -typedef struct rpc_loc_ni_umts_cp_notify_verify_req_s_type rpc_loc_ni_umts_cp_notify_verify_req_s_type; - -enum rpc_loc_ni_service_interaction_e_type { - RPC_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO = 1, - RPC_LOC_NI_SERVICE_INTERACTION_MAX = 268435456, -}; -typedef enum rpc_loc_ni_service_interaction_e_type rpc_loc_ni_service_interaction_e_type; - -struct rpc_loc_ni_vx_service_interaction_req_s_type { - rpc_loc_ni_vx_notify_verify_req_s_type ni_vx_req; - rpc_loc_ni_service_interaction_e_type service_interation_type; -}; -typedef struct rpc_loc_ni_vx_service_interaction_req_s_type rpc_loc_ni_vx_service_interaction_req_s_type; - -struct rpc_loc_ni_event_payload_u_type { - rpc_loc_ni_event_e_type disc; - union { - rpc_loc_ni_vx_notify_verify_req_s_type vx_req; - rpc_loc_ni_supl_notify_verify_req_s_type supl_req; - rpc_loc_ni_umts_cp_notify_verify_req_s_type umts_cp_req; - rpc_loc_ni_vx_service_interaction_req_s_type service_interaction_req; - } rpc_loc_ni_event_payload_u_type_u; -}; -typedef struct rpc_loc_ni_event_payload_u_type rpc_loc_ni_event_payload_u_type; - -struct rpc_loc_ni_event_s_type { - rpc_loc_ni_event_e_type event; - rpc_loc_ni_event_payload_u_type payload; -}; -typedef struct rpc_loc_ni_event_s_type rpc_loc_ni_event_s_type; - -enum rpc_loc_assist_data_request_e_type { - RPC_LOC_ASSIST_DATA_TIME_REQ = 1, - RPC_LOC_ASSIST_DATA_PREDICTED_ORBITS_REQ = 2, - RPC_LOC_ASSIST_DATA_POSITION_INJECTION_REQ = 3, - RPC_LOC_ASSIST_DATA_MAX = 268435456, -}; -typedef enum rpc_loc_assist_data_request_e_type rpc_loc_assist_data_request_e_type; - -typedef char *rpc_struct_loc_time_download_source_s_type_servers_ptr; - -typedef rpc_struct_loc_time_download_source_s_type_servers_ptr rpc_struct_loc_time_download_source_s_type_servers[3]; - -struct rpc_loc_time_download_source_s_type { - rpc_uint32 delay_threshold; - rpc_struct_loc_time_download_source_s_type_servers servers; -}; -typedef struct rpc_loc_time_download_source_s_type rpc_loc_time_download_source_s_type; - -typedef char *rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr; - -typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; - -struct rpc_loc_predicted_orbits_data_source_s_type { - rpc_uint32 max_file_size; - rpc_uint32 max_part_size; - rpc_struct_loc_predicted_orbits_data_source_s_type_servers servers; -}; -typedef struct rpc_loc_predicted_orbits_data_source_s_type rpc_loc_predicted_orbits_data_source_s_type; - -struct rpc_loc_pos_inj_request_s_type { - rpc_uint32 flags; - double latitude; - double longitude; - rpc_uint32 position_uncertainty; - rpc_uint64 timestamp; -}; -typedef struct rpc_loc_pos_inj_request_s_type rpc_loc_pos_inj_request_s_type; - -struct rpc_loc_assist_data_request_payload_u_type { - rpc_loc_assist_data_request_e_type disc; - union { - rpc_loc_time_download_source_s_type time_download; - rpc_loc_predicted_orbits_data_source_s_type data_download; - rpc_loc_pos_inj_request_s_type pos_injection; - } rpc_loc_assist_data_request_payload_u_type_u; -}; -typedef struct rpc_loc_assist_data_request_payload_u_type rpc_loc_assist_data_request_payload_u_type; - -struct rpc_loc_assist_data_request_s_type { - rpc_loc_assist_data_request_e_type event; - rpc_loc_assist_data_request_payload_u_type payload; -}; -typedef struct rpc_loc_assist_data_request_s_type rpc_loc_assist_data_request_s_type; - -typedef rpc_uint32 rpc_loc_server_connection_handle; - -enum rpc_loc_server_protocol_e_type { - RPC_LOC_SERVER_PROTOCOL_DEFAULT = 0, - RPC_LOC_SERVER_PROTOCOL_SUPL = 1, - RPC_LOC_SERVER_PROTOCOL_VX_MPC = 2, - RPC_LOC_SERVER_PROTOCOL_VX_PDE = 3, - RPC_LOC_SERVER_PROTOCOL_MAX = 16777216, -}; -typedef enum rpc_loc_server_protocol_e_type rpc_loc_server_protocol_e_type; - -enum rpc_loc_server_connection_e_type { - RPC_LOC_SERVER_CONNECTION_LBS = 0, - RPC_LOC_SERVER_CONNECTION_WWAN_INTERNET = 0 + 1, - RPC_LOC_SERVER_CONNECTION_MAX = 16777216, -}; -typedef enum rpc_loc_server_connection_e_type rpc_loc_server_connection_e_type; - -enum rpc_loc_server_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - RPC_LOC_SERVER_REQUEST_MULTI_OPEN = 3, - RPC_LOC_SERVER_REQUEST_MAX = 268435456, -}; -typedef enum rpc_loc_server_request_e_type rpc_loc_server_request_e_type; - -struct rpc_loc_server_open_req_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_protocol_e_type protocol; -}; -typedef struct rpc_loc_server_open_req_s_type rpc_loc_server_open_req_s_type; - -struct rpc_loc_server_multi_open_req_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_protocol_e_type protocol; - rpc_loc_server_connection_e_type connection_type; -}; -typedef struct rpc_loc_server_multi_open_req_s_type rpc_loc_server_multi_open_req_s_type; - -struct rpc_loc_server_close_req_s_type { - rpc_loc_server_connection_handle conn_handle; -}; -typedef struct rpc_loc_server_close_req_s_type rpc_loc_server_close_req_s_type; - -struct rpc_loc_server_request_u_type { - rpc_loc_server_request_e_type disc; - union { - rpc_loc_server_open_req_s_type open_req; - rpc_loc_server_close_req_s_type close_req; - rpc_loc_server_multi_open_req_s_type multi_open_req; - } rpc_loc_server_request_u_type_u; -}; -typedef struct rpc_loc_server_request_u_type rpc_loc_server_request_u_type; - -struct rpc_loc_server_request_s_type { - rpc_loc_server_request_e_type event; - rpc_loc_server_request_u_type payload; -}; -typedef struct rpc_loc_server_request_s_type rpc_loc_server_request_s_type; - -enum rpc_loc_qwip_request_e_type { - RPC_LOC_QWIP_START_PERIODIC_HI_FREQ_FIXES = 0, - RPC_LOC_QWIP_START_PERIODIC_KEEP_WARM = 0 + 1, - RPC_LOC_QWIP_STOP_PERIODIC_FIXES = 0 + 2, - RPC_LOC_QWIP_SUSPEND = 0 + 3, - RPC_LOC_QWIP_REQUEST_MAX = 268435456, -}; -typedef enum rpc_loc_qwip_request_e_type rpc_loc_qwip_request_e_type; - -struct rpc_loc_qwip_request_s_type { - rpc_loc_qwip_request_e_type request_type; - rpc_uint16 tbf_ms; -}; -typedef struct rpc_loc_qwip_request_s_type rpc_loc_qwip_request_s_type; - -struct rpc_loc_reserved_payload_s_type { - rpc_uint16 data_size; - struct { - u_int data_len; - char *data_val; - } data; -}; -typedef struct rpc_loc_reserved_payload_s_type rpc_loc_reserved_payload_s_type; - -enum rpc_loc_ioctl_e_type { - RPC_LOC_IOCTL_GET_API_VERSION = 1, - RPC_LOC_IOCTL_SET_FIX_CRITERIA = 2, - RPC_LOC_IOCTL_GET_FIX_CRITERIA = 3, - RPC_LOC_IOCTL_SERVICE_START_INDEX = 400, - RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE = 400, - RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA = 401, - RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY = 402, - RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE = 403, - RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD = 404, - RPC_LOC_IOCTL_INJECT_UTC_TIME = 405, - RPC_LOC_IOCTL_INJECT_RTC_VALUE = 406, - RPC_LOC_IOCTL_INJECT_POSITION = 407, - RPC_LOC_IOCTL_QUERY_ENGINE_STATE = 408, - RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS = 409, - RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS = 410, - RPC_LOC_IOCTL_SEND_WIPER_POSITION_REPORT = 411, - RPC_LOC_IOCTL_NOTIFY_WIPER_STATUS = 412, - RPC_LOC_IOCTL_ACCESS_EFS_DATA = 413, - RPC_LOC_IOCTL_ERROR_ESTIMATE_CONFIG = 414, - RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS = 415, - RPC_LOC_IOCTL_NV_SETTINGS_START_INDEX = 800, - RPC_LOC_IOCTL_SET_ENGINE_LOCK = 800, - RPC_LOC_IOCTL_GET_ENGINE_LOCK = 801, - RPC_LOC_IOCTL_SET_SBAS_CONFIG = 802, - RPC_LOC_IOCTL_GET_SBAS_CONFIG = 803, - RPC_LOC_IOCTL_SET_NMEA_TYPES = 804, - RPC_LOC_IOCTL_GET_NMEA_TYPES = 805, - RPC_LOC_IOCTL_SET_CDMA_PDE_SERVER_ADDR = 806, - RPC_LOC_IOCTL_GET_CDMA_PDE_SERVER_ADDR = 807, - RPC_LOC_IOCTL_SET_CDMA_MPC_SERVER_ADDR = 808, - RPC_LOC_IOCTL_GET_CDMA_MPC_SERVER_ADDR = 809, - RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR = 810, - RPC_LOC_IOCTL_GET_UMTS_SLP_SERVER_ADDR = 811, - RPC_LOC_IOCTL_SET_ON_DEMAND_LPM = 812, - RPC_LOC_IOCTL_GET_ON_DEMAND_LPM = 813, - RPC_LOC_IOCTL_SET_XTRA_T_SESSION_CONTROL = 814, - RPC_LOC_IOCTL_GET_XTRA_T_SESSION_CONTROL = 815, - RPC_LOC_IOCTL_SET_LBS_APN_PROFILE = 816, - RPC_LOC_IOCTL_GET_LBS_APN_PROFILE = 817, - RPC_LOC_IOCTL_SET_XTRA_APN_PROFILE = 818, - RPC_LOC_IOCTL_GET_XTRA_APN_PROFILE = 819, - RPC_LOC_IOCTL_SET_DATA_ENABLE = 820, - RPC_LOC_IOCTL_SET_SUPL_VERSION = 821, - RPC_LOC_IOCTL_GET_SUPL_VERSION = 822, - RPC_LOC_IOCTL_PROPRIETARY_START_INDEX = 1000, - RPC_LOC_IOCTL_DELETE_ASSIST_DATA = 1000, - RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR = 1001, - RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR = 1002, - RPC_LOC_IOCTL_RESERVED_CMD = 8000, - RPC_LOC_IOCTL_THIRD_PARTY_START_INDEX = 1073741824, -}; -typedef enum rpc_loc_ioctl_e_type rpc_loc_ioctl_e_type; - -struct rpc_loc_api_version_s_type { - u_char major; - u_char minor; -}; -typedef struct rpc_loc_api_version_s_type rpc_loc_api_version_s_type; - -enum rpc_loc_fix_recurrence_e_type { - RPC_LOC_PERIODIC_FIX = 1, - RPC_LOC_SINGLE_FIX = 2, - RPC_LOC_FIX_SESSION_TYPE_MAX = 268435456, -}; -typedef enum rpc_loc_fix_recurrence_e_type rpc_loc_fix_recurrence_e_type; - -enum rpc_loc_operation_mode_e_type { - RPC_LOC_OPER_MODE_DEFAULT = 1, - RPC_LOC_OPER_MODE_MSB = 2, - RPC_LOC_OPER_MODE_MSA = 3, - RPC_LOC_OPER_MODE_STANDALONE = 4, - RPC_LOC_OPER_MODE_SPEED_OPTIMAL = 5, - RPC_LOC_OPER_MODE_ACCURACY_OPTIMAL = 6, - RPC_LOC_OPER_MODE_DATA_OPTIMAL = 7, - RPC_LOC_OPER_MODE_CELL_ID = 8, - RPC_LOC_OPER_MODE_MAX = 268435456, -}; -typedef enum rpc_loc_operation_mode_e_type rpc_loc_operation_mode_e_type; - -enum rpc_loc_notify_e_type { - RPC_LOC_NOTIFY_ON_INTERVAL = 1, - RPC_LOC_NOTIFY_ON_DISTANCE = 2, - RPC_LOC_NOTIFY_ON_ANY = 3, - RPC_LOC_NOTIFY_ON_ALL = 4, - RPC_LOC_NOTIFY_TYPE_MAX = 268435456, -}; -typedef enum rpc_loc_notify_e_type rpc_loc_notify_e_type; - -struct rpc_loc_fix_criteria_s_type { - rpc_uint32 valid_mask; - rpc_loc_fix_recurrence_e_type recurrence_type; - rpc_loc_operation_mode_e_type preferred_operation_mode; - rpc_uint32 preferred_accuracy; - rpc_uint32 preferred_response_time; - rpc_boolean intermediate_pos_report_enabled; - rpc_loc_notify_e_type notify_type; - rpc_uint32 min_interval; - float min_distance; - rpc_uint32 min_dist_sample_interval; -}; -typedef struct rpc_loc_fix_criteria_s_type rpc_loc_fix_criteria_s_type; - -enum rpc_loc_ni_user_resp_e_type { - RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT = 1, - RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY = 2, - RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP = 3, - RPC_LOC_NI_LCS_NOTIFY_VERIFY_MAX = 268435456, -}; -typedef enum rpc_loc_ni_user_resp_e_type rpc_loc_ni_user_resp_e_type; - -struct rpc_loc_user_verify_s_type { - rpc_loc_ni_user_resp_e_type user_resp; - rpc_loc_ni_event_s_type ni_event_pass_back; -}; -typedef struct rpc_loc_user_verify_s_type rpc_loc_user_verify_s_type; - -enum rpc_loc_predicted_orbits_data_format_e_type { - RPC_LOC_PREDICTED_ORBITS_XTRA = 0, - RPC_LOC_PREDICTED_ORBITS_FORMAT_MAX = 268435456, -}; -typedef enum rpc_loc_predicted_orbits_data_format_e_type rpc_loc_predicted_orbits_data_format_e_type; - -struct rpc_loc_predicted_orbits_data_s_type { - rpc_loc_predicted_orbits_data_format_e_type format_type; - rpc_uint32 total_size; - rpc_uint8 total_parts; - rpc_uint8 part; - rpc_uint16 part_len; - struct { - u_int data_ptr_len; - char *data_ptr_val; - } data_ptr; -}; -typedef struct rpc_loc_predicted_orbits_data_s_type rpc_loc_predicted_orbits_data_s_type; - -struct rpc_loc_predicted_orbits_data_validity_report_s_type { - rpc_uint64 start_time_utc; - rpc_uint16 valid_duration_hrs; -}; -typedef struct rpc_loc_predicted_orbits_data_validity_report_s_type rpc_loc_predicted_orbits_data_validity_report_s_type; - -struct rpc_loc_predicted_orbits_auto_download_config_s_type { - rpc_boolean enable; - u_char auto_check_every_hrs; -}; -typedef struct rpc_loc_predicted_orbits_auto_download_config_s_type rpc_loc_predicted_orbits_auto_download_config_s_type; - -struct rpc_loc_assist_data_time_s_type { - rpc_uint64 time_utc; - rpc_uint32 uncertainty; -}; -typedef struct rpc_loc_assist_data_time_s_type rpc_loc_assist_data_time_s_type; - -typedef rpc_uint64 rpc_loc_assist_pos_valid_mask_type; - -struct rpc_loc_assist_data_pos_s_type { - rpc_loc_assist_pos_valid_mask_type valid_mask; - rpc_uint64 timestamp_utc; - double latitude; - double longitude; - float altitude_wrt_ellipsoid; - float altitude_wrt_mean_sea_level; - float hor_unc_circular; - float vert_unc; - u_char confidence_horizontal; - u_char confidence_vertical; - rpc_int32 timestamp_age; -}; -typedef struct rpc_loc_assist_data_pos_s_type rpc_loc_assist_data_pos_s_type; - -enum rpc_loc_server_open_status_e_type { - RPC_LOC_SERVER_OPEN_SUCCESS = 1, - RPC_LOC_SERVER_OPEN_FAIL = 2, - RPC_LOC_SERVER_OPEN_STATUS_MAX = 268435456, -}; -typedef enum rpc_loc_server_open_status_e_type rpc_loc_server_open_status_e_type; - -enum rpc_loc_server_pdp_type_e_type { - RPC_LOC_SERVER_PDP_IP = 0, - RPC_LOC_SERVER_PDP_PPP = 0 + 1, - RPC_LOC_SERVER_PDP_IPV6 = 0 + 2, - RPC_LOC_SERVER_PDP_IPV4V6 = 0 + 3, - RPC_LOC_SERVER_PDP_MAX = 268435456, -}; -typedef enum rpc_loc_server_pdp_type_e_type rpc_loc_server_pdp_type_e_type; - -struct rpc_loc_server_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - char apn_name[100]; -}; -typedef struct rpc_loc_server_open_status_s_type rpc_loc_server_open_status_s_type; - -struct rpc_loc_server_multi_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - rpc_loc_server_pdp_type_e_type pdp_type; - char apn_name[100]; -}; -typedef struct rpc_loc_server_multi_open_status_s_type rpc_loc_server_multi_open_status_s_type; - -enum rpc_loc_server_close_status_e_type { - RPC_LOC_SERVER_CLOSE_SUCCESS = 1, - RPC_LOC_SERVER_CLOSE_FAIL = 2, - RPC_LOC_SERVER_CLOSE_STATUS_MAX = 268435456, -}; -typedef enum rpc_loc_server_close_status_e_type rpc_loc_server_close_status_e_type; - -struct rpc_loc_server_close_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_close_status_e_type close_status; -}; -typedef struct rpc_loc_server_close_status_s_type rpc_loc_server_close_status_s_type; - -struct rpc_loc_wiper_fix_time_s_type { - rpc_uint32 slow_clock_count; -}; -typedef struct rpc_loc_wiper_fix_time_s_type rpc_loc_wiper_fix_time_s_type; - -struct rpc_loc_wiper_fix_pos_s_type { - rpc_int32 lat; - rpc_int32 lon; - rpc_uint16 HEPE; - rpc_uint8 num_of_aps_used; - rpc_uint8 fix_error_code; -}; -typedef struct rpc_loc_wiper_fix_pos_s_type rpc_loc_wiper_fix_pos_s_type; - -struct rpc_loc_wiper_ap_info_s_type { - char mac_addr[6]; - rpc_int32 rssi; - rpc_uint16 channel; - rpc_uint8 ap_qualifier; -}; -typedef struct rpc_loc_wiper_ap_info_s_type rpc_loc_wiper_ap_info_s_type; - -struct rpc_loc_wiper_ap_set_s_type { - rpc_uint8 num_of_aps; - rpc_loc_wiper_ap_info_s_type ap_info[50]; -}; -typedef struct rpc_loc_wiper_ap_set_s_type rpc_loc_wiper_ap_set_s_type; - -struct rpc_loc_wiper_position_report_s_type { - rpc_uint8 wiper_valid_info_flag; - rpc_loc_wiper_fix_time_s_type wiper_fix_time; - rpc_loc_wiper_fix_pos_s_type wiper_fix_position; - rpc_loc_wiper_ap_set_s_type wiper_ap_set; -}; -typedef struct rpc_loc_wiper_position_report_s_type rpc_loc_wiper_position_report_s_type; - -enum rpc_loc_wiper_status_e_type { - RPC_LOC_WIPER_STATUS_AVAILABLE = 1, - RPC_LOC_WIPER_STATUS_UNAVAILABLE = 2, - RPC_LOC_WIPER_STATUS_E_SIZE = 268435456, -}; -typedef enum rpc_loc_wiper_status_e_type rpc_loc_wiper_status_e_type; - -enum rpc_loc_fs_operation_e_type { - RPC_LOC_FS_CREATE_WRITE_FILE = 1, - RPC_LOC_FS_APPEND_FILE = 2, - RPC_LOC_FS_DELETE_FILE = 3, - RPC_LOC_FS_READ_FILE = 4, - RPC_LOC_FS_MAX = 268435456, -}; -typedef enum rpc_loc_fs_operation_e_type rpc_loc_fs_operation_e_type; - -struct rpc_loc_efs_data_s_type { - char filename[64]; - rpc_loc_fs_operation_e_type operation; - rpc_uint32 total_size; - struct { - u_int data_ptr_len; - char *data_ptr_val; - } data_ptr; - rpc_uint32 part_len; - rpc_uint8 part; - rpc_uint8 total_parts; - rpc_uint32 reserved; -}; -typedef struct rpc_loc_efs_data_s_type rpc_loc_efs_data_s_type; - -enum rpc_loc_error_estimate_config_e_type { - RPC_LOC_ERROR_ESTIMATE_CONFIG_SET = 1, - RPC_LOC_ERROR_ESTIMATE_CONFIG_CLEAR = 2, - RPC_LOC_ERROR_ESTIMATE_MAX = 268435456, -}; -typedef enum rpc_loc_error_estimate_config_e_type rpc_loc_error_estimate_config_e_type; - -struct rpc_loc_apn_profiles_type { - rpc_uint32 srv_system_type; - rpc_uint32 pdp_type; - rpc_uint32 reserved; - char apn_name[100]; -}; -typedef struct rpc_loc_apn_profiles_type rpc_loc_apn_profiles_type; - -enum rpc_loc_lock_e_type { - RPC_LOC_LOCK_NONE = 1, - RPC_LOC_LOCK_MI = 2, - RPC_LOC_LOCK_MT = 3, - RPC_LOC_LOCK_ALL = 4, - RPC_LOC_LOCK_MAX = 268435456, -}; -typedef enum rpc_loc_lock_e_type rpc_loc_lock_e_type; - -typedef rpc_uint32 rpc_loc_nmea_sentence_type; - -typedef rpc_uint32 rpc_loc_assist_data_type; - -struct rpc_loc_assist_data_delete_s_type { - rpc_loc_assist_data_type type; - rpc_uint32 reserved[8]; -}; -typedef struct rpc_loc_assist_data_delete_s_type rpc_loc_assist_data_delete_s_type; - -struct rpc_loc_ioctl_data_u_type { - rpc_loc_ioctl_e_type disc; - union { - rpc_loc_fix_criteria_s_type fix_criteria; - rpc_loc_user_verify_s_type user_verify_resp; - rpc_loc_predicted_orbits_data_s_type predicted_orbits_data; - rpc_loc_predicted_orbits_auto_download_config_s_type predicted_orbits_auto_download; - rpc_loc_assist_data_time_s_type assistance_data_time; - rpc_loc_assist_data_pos_s_type assistance_data_position; - rpc_loc_server_open_status_s_type conn_open_status; - rpc_loc_server_close_status_s_type conn_close_status; - rpc_loc_wiper_position_report_s_type wiper_pos; - rpc_loc_wiper_status_e_type wiper_status; - rpc_loc_lock_e_type engine_lock; - rpc_boolean sbas_mode; - rpc_loc_nmea_sentence_type nmea_types; - rpc_boolean on_demand_lpm; - rpc_loc_server_info_s_type server_addr; - rpc_loc_assist_data_delete_s_type assist_data_delete; - rpc_loc_efs_data_s_type efs_data; - rpc_loc_error_estimate_config_e_type error_estimate_config; - rpc_uint8 xtra_t_session_control; - rpc_loc_apn_profiles_type apn_profiles[6]; - rpc_boolean data_enable; - rpc_uint32 supl_version; - rpc_loc_server_multi_open_status_s_type multi_conn_open_status; - rpc_loc_reserved_payload_s_type reserved; - } rpc_loc_ioctl_data_u_type_u; -}; -typedef struct rpc_loc_ioctl_data_u_type rpc_loc_ioctl_data_u_type; - -struct rpc_loc_ioctl_callback_data_u_type { - rpc_loc_ioctl_e_type disc; - union { - rpc_loc_api_version_s_type api_version; - rpc_loc_fix_criteria_s_type fix_criteria; - rpc_loc_lock_e_type engine_lock; - rpc_boolean sbas_mode; - rpc_loc_nmea_sentence_type nmea_types; - rpc_boolean on_demand_lpm; - rpc_loc_server_info_s_type server_addr; - rpc_loc_predicted_orbits_data_source_s_type predicted_orbits_data_source; - rpc_loc_predicted_orbits_data_validity_report_s_type predicted_orbits_data_validity; - rpc_uint8 xtra_t_session_control; - rpc_loc_apn_profiles_type apn_profiles[6]; - rpc_uint32 supl_version; - } rpc_loc_ioctl_callback_data_u_type_u; -}; -typedef struct rpc_loc_ioctl_callback_data_u_type rpc_loc_ioctl_callback_data_u_type; - -struct rpc_loc_ioctl_callback_s_type { - rpc_loc_ioctl_e_type type; - rpc_int32 status; - rpc_loc_ioctl_callback_data_u_type data; -}; -typedef struct rpc_loc_ioctl_callback_s_type rpc_loc_ioctl_callback_s_type; - -struct rpc_loc_event_payload_u_type { - u_quad_t disc; - union { - rpc_loc_parsed_position_s_type parsed_location_report; - rpc_loc_gnss_info_s_type gnss_report; - rpc_loc_nmea_report_s_type nmea_report; - rpc_loc_ni_event_s_type ni_request; - rpc_loc_assist_data_request_s_type assist_data_request; - rpc_loc_server_request_s_type loc_server_request; - rpc_loc_ioctl_callback_s_type ioctl_report; - rpc_loc_status_event_s_type status_report; - rpc_loc_qwip_request_s_type qwip_request; - rpc_loc_reserved_payload_s_type reserved; - } rpc_loc_event_payload_u_type_u; -}; -typedef struct rpc_loc_event_payload_u_type rpc_loc_event_payload_u_type; - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_rpc_loc_client_handle_type (XDR *, rpc_loc_client_handle_type*); -extern bool_t xdr_rpc_loc_event_mask_type (XDR *, rpc_loc_event_mask_type*); -extern bool_t xdr_rpc_loc_position_valid_mask_type (XDR *, rpc_loc_position_valid_mask_type*); -extern bool_t xdr_rpc_loc_pos_technology_mask_type (XDR *, rpc_loc_pos_technology_mask_type*); -extern bool_t xdr_rpc_loc_session_status_e_type (XDR *, rpc_loc_session_status_e_type*); -extern bool_t xdr_rpc_loc_calendar_time_s_type (XDR *, rpc_loc_calendar_time_s_type*); -extern bool_t xdr_rpc_loc_parsed_position_s_type (XDR *, rpc_loc_parsed_position_s_type*); -extern bool_t xdr_rpc_loc_sv_system_e_type (XDR *, rpc_loc_sv_system_e_type*); -extern bool_t xdr_rpc_loc_sv_status_e_type (XDR *, rpc_loc_sv_status_e_type*); -extern bool_t xdr_rpc_loc_sv_info_valid_mask_type (XDR *, rpc_loc_sv_info_valid_mask_type*); -extern bool_t xdr_rpc_loc_sv_info_s_type (XDR *, rpc_loc_sv_info_s_type*); -extern bool_t xdr_rpc_loc_gnss_info_valid_mask_type (XDR *, rpc_loc_gnss_info_valid_mask_type*); -extern bool_t xdr_rpc_loc_gnss_info_s_type (XDR *, rpc_loc_gnss_info_s_type*); -extern bool_t xdr_rpc_loc_nmea_report_s_type (XDR *, rpc_loc_nmea_report_s_type*); -extern bool_t xdr_rpc_loc_status_event_e_type (XDR *, rpc_loc_status_event_e_type*); -extern bool_t xdr_rpc_loc_engine_state_e_type (XDR *, rpc_loc_engine_state_e_type*); -extern bool_t xdr_rpc_loc_fix_session_state_e_type (XDR *, rpc_loc_fix_session_state_e_type*); -extern bool_t xdr_rpc_loc_status_event_payload_u_type (XDR *, rpc_loc_status_event_payload_u_type*); -extern bool_t xdr_rpc_loc_status_event_s_type (XDR *, rpc_loc_status_event_s_type*); -extern bool_t xdr_rpc_loc_server_addr_e_type (XDR *, rpc_loc_server_addr_e_type*); -extern bool_t xdr_rpc_loc_server_addr_ipv4_type (XDR *, rpc_loc_server_addr_ipv4_type*); -extern bool_t xdr_rpc_loc_server_addr_url_type (XDR *, rpc_loc_server_addr_url_type*); -extern bool_t xdr_rpc_loc_server_addr_ipv6_type (XDR *, rpc_loc_server_addr_ipv6_type*); -extern bool_t xdr_rpc_loc_server_addr_u_type (XDR *, rpc_loc_server_addr_u_type*); -extern bool_t xdr_rpc_loc_server_info_s_type (XDR *, rpc_loc_server_info_s_type*); -extern bool_t xdr_rpc_loc_ni_notify_verify_e_type (XDR *, rpc_loc_ni_notify_verify_e_type*); -extern bool_t xdr_rpc_loc_ni_event_e_type (XDR *, rpc_loc_ni_event_e_type*); -extern bool_t xdr_rpc_loc_ni_datacoding_scheme_e_type (XDR *, rpc_loc_ni_datacoding_scheme_e_type*); -extern bool_t xdr_rpc_loc_ni_vx_requester_id_encoding_scheme_e_type (XDR *, rpc_loc_ni_vx_requester_id_encoding_scheme_e_type*); -extern bool_t xdr_rpc_loc_ni_vx_pos_mode_e_type (XDR *, rpc_loc_ni_vx_pos_mode_e_type*); -extern bool_t xdr_rpc_loc_ni_vx_requester_id_s_type (XDR *, rpc_loc_ni_vx_requester_id_s_type*); -extern bool_t xdr_rpc_loc_ni_vx_notify_verify_req_s_type (XDR *, rpc_loc_ni_vx_notify_verify_req_s_type*); -extern bool_t xdr_rpc_loc_ni_supl_pos_method_e_type (XDR *, rpc_loc_ni_supl_pos_method_e_type*); -extern bool_t xdr_rpc_loc_ni_supl_slp_session_id_s_type (XDR *, rpc_loc_ni_supl_slp_session_id_s_type*); -extern bool_t xdr_rpc_loc_ni_requestor_id_s_type (XDR *, rpc_loc_ni_requestor_id_s_type*); -extern bool_t xdr_rpc_loc_ni_supl_client_name_s_type (XDR *, rpc_loc_ni_supl_client_name_s_type*); -extern bool_t xdr_rpc_loc_ni_supl_qop_s_type (XDR *, rpc_loc_ni_supl_qop_s_type*); -extern bool_t xdr_rpc_loc_ni_supl_notify_verify_req_s_type (XDR *, rpc_loc_ni_supl_notify_verify_req_s_type*); -extern bool_t xdr_rpc_loc_ni_ext_client_address_s_type (XDR *, rpc_loc_ni_ext_client_address_s_type*); -extern bool_t xdr_rpc_loc_ni_location_type_e_type (XDR *, rpc_loc_ni_location_type_e_type*); -extern bool_t xdr_rpc_loc_ni_deferred_location_s_type (XDR *, rpc_loc_ni_deferred_location_s_type*); -extern bool_t xdr_rpc_loc_ni_codeword_string_s_type (XDR *, rpc_loc_ni_codeword_string_s_type*); -extern bool_t xdr_rpc_loc_ni_service_type_id_s_type (XDR *, rpc_loc_ni_service_type_id_s_type*); -extern bool_t xdr_rpc_loc_ni_umts_cp_notify_verify_req_s_type (XDR *, rpc_loc_ni_umts_cp_notify_verify_req_s_type*); -extern bool_t xdr_rpc_loc_ni_service_interaction_e_type (XDR *, rpc_loc_ni_service_interaction_e_type*); -extern bool_t xdr_rpc_loc_ni_vx_service_interaction_req_s_type (XDR *, rpc_loc_ni_vx_service_interaction_req_s_type*); -extern bool_t xdr_rpc_loc_ni_event_payload_u_type (XDR *, rpc_loc_ni_event_payload_u_type*); -extern bool_t xdr_rpc_loc_ni_event_s_type (XDR *, rpc_loc_ni_event_s_type*); -extern bool_t xdr_rpc_loc_assist_data_request_e_type (XDR *, rpc_loc_assist_data_request_e_type*); -extern bool_t xdr_rpc_struct_loc_time_download_source_s_type_servers_ptr (XDR *, rpc_struct_loc_time_download_source_s_type_servers_ptr*); -extern bool_t xdr_rpc_struct_loc_time_download_source_s_type_servers (XDR *, rpc_struct_loc_time_download_source_s_type_servers); -extern bool_t xdr_rpc_loc_time_download_source_s_type (XDR *, rpc_loc_time_download_source_s_type*); -extern bool_t xdr_rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr (XDR *, rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr*); -extern bool_t xdr_rpc_struct_loc_predicted_orbits_data_source_s_type_servers (XDR *, rpc_struct_loc_predicted_orbits_data_source_s_type_servers); -extern bool_t xdr_rpc_loc_predicted_orbits_data_source_s_type (XDR *, rpc_loc_predicted_orbits_data_source_s_type*); -extern bool_t xdr_rpc_loc_pos_inj_request_s_type (XDR *, rpc_loc_pos_inj_request_s_type*); -extern bool_t xdr_rpc_loc_assist_data_request_payload_u_type (XDR *, rpc_loc_assist_data_request_payload_u_type*); -extern bool_t xdr_rpc_loc_assist_data_request_s_type (XDR *, rpc_loc_assist_data_request_s_type*); -extern bool_t xdr_rpc_loc_server_connection_handle (XDR *, rpc_loc_server_connection_handle*); -extern bool_t xdr_rpc_loc_server_protocol_e_type (XDR *, rpc_loc_server_protocol_e_type*); -extern bool_t xdr_rpc_loc_server_connection_e_type (XDR *, rpc_loc_server_connection_e_type*); -extern bool_t xdr_rpc_loc_server_request_e_type (XDR *, rpc_loc_server_request_e_type*); -extern bool_t xdr_rpc_loc_server_open_req_s_type (XDR *, rpc_loc_server_open_req_s_type*); -extern bool_t xdr_rpc_loc_server_multi_open_req_s_type (XDR *, rpc_loc_server_multi_open_req_s_type*); -extern bool_t xdr_rpc_loc_server_close_req_s_type (XDR *, rpc_loc_server_close_req_s_type*); -extern bool_t xdr_rpc_loc_server_request_u_type (XDR *, rpc_loc_server_request_u_type*); -extern bool_t xdr_rpc_loc_server_request_s_type (XDR *, rpc_loc_server_request_s_type*); -extern bool_t xdr_rpc_loc_qwip_request_e_type (XDR *, rpc_loc_qwip_request_e_type*); -extern bool_t xdr_rpc_loc_qwip_request_s_type (XDR *, rpc_loc_qwip_request_s_type*); -extern bool_t xdr_rpc_loc_reserved_payload_s_type (XDR *, rpc_loc_reserved_payload_s_type*); -extern bool_t xdr_rpc_loc_ioctl_e_type (XDR *, rpc_loc_ioctl_e_type*); -extern bool_t xdr_rpc_loc_api_version_s_type (XDR *, rpc_loc_api_version_s_type*); -extern bool_t xdr_rpc_loc_fix_recurrence_e_type (XDR *, rpc_loc_fix_recurrence_e_type*); -extern bool_t xdr_rpc_loc_operation_mode_e_type (XDR *, rpc_loc_operation_mode_e_type*); -extern bool_t xdr_rpc_loc_notify_e_type (XDR *, rpc_loc_notify_e_type*); -extern bool_t xdr_rpc_loc_fix_criteria_s_type (XDR *, rpc_loc_fix_criteria_s_type*); -extern bool_t xdr_rpc_loc_ni_user_resp_e_type (XDR *, rpc_loc_ni_user_resp_e_type*); -extern bool_t xdr_rpc_loc_user_verify_s_type (XDR *, rpc_loc_user_verify_s_type*); -extern bool_t xdr_rpc_loc_predicted_orbits_data_format_e_type (XDR *, rpc_loc_predicted_orbits_data_format_e_type*); -extern bool_t xdr_rpc_loc_predicted_orbits_data_s_type (XDR *, rpc_loc_predicted_orbits_data_s_type*); -extern bool_t xdr_rpc_loc_predicted_orbits_data_validity_report_s_type (XDR *, rpc_loc_predicted_orbits_data_validity_report_s_type*); -extern bool_t xdr_rpc_loc_predicted_orbits_auto_download_config_s_type (XDR *, rpc_loc_predicted_orbits_auto_download_config_s_type*); -extern bool_t xdr_rpc_loc_assist_data_time_s_type (XDR *, rpc_loc_assist_data_time_s_type*); -extern bool_t xdr_rpc_loc_assist_pos_valid_mask_type (XDR *, rpc_loc_assist_pos_valid_mask_type*); -extern bool_t xdr_rpc_loc_assist_data_pos_s_type (XDR *, rpc_loc_assist_data_pos_s_type*); -extern bool_t xdr_rpc_loc_server_open_status_e_type (XDR *, rpc_loc_server_open_status_e_type*); -extern bool_t xdr_rpc_loc_server_pdp_type_e_type (XDR *, rpc_loc_server_pdp_type_e_type*); -extern bool_t xdr_rpc_loc_server_open_status_s_type (XDR *, rpc_loc_server_open_status_s_type*); -extern bool_t xdr_rpc_loc_server_multi_open_status_s_type (XDR *, rpc_loc_server_multi_open_status_s_type*); -extern bool_t xdr_rpc_loc_server_close_status_e_type (XDR *, rpc_loc_server_close_status_e_type*); -extern bool_t xdr_rpc_loc_server_close_status_s_type (XDR *, rpc_loc_server_close_status_s_type*); -extern bool_t xdr_rpc_loc_wiper_fix_time_s_type (XDR *, rpc_loc_wiper_fix_time_s_type*); -extern bool_t xdr_rpc_loc_wiper_fix_pos_s_type (XDR *, rpc_loc_wiper_fix_pos_s_type*); -extern bool_t xdr_rpc_loc_wiper_ap_info_s_type (XDR *, rpc_loc_wiper_ap_info_s_type*); -extern bool_t xdr_rpc_loc_wiper_ap_set_s_type (XDR *, rpc_loc_wiper_ap_set_s_type*); -extern bool_t xdr_rpc_loc_wiper_position_report_s_type (XDR *, rpc_loc_wiper_position_report_s_type*); -extern bool_t xdr_rpc_loc_wiper_status_e_type (XDR *, rpc_loc_wiper_status_e_type*); -extern bool_t xdr_rpc_loc_fs_operation_e_type (XDR *, rpc_loc_fs_operation_e_type*); -extern bool_t xdr_rpc_loc_efs_data_s_type (XDR *, rpc_loc_efs_data_s_type*); -extern bool_t xdr_rpc_loc_error_estimate_config_e_type (XDR *, rpc_loc_error_estimate_config_e_type*); -extern bool_t xdr_rpc_loc_apn_profiles_type (XDR *, rpc_loc_apn_profiles_type*); -extern bool_t xdr_rpc_loc_lock_e_type (XDR *, rpc_loc_lock_e_type*); -extern bool_t xdr_rpc_loc_nmea_sentence_type (XDR *, rpc_loc_nmea_sentence_type*); -extern bool_t xdr_rpc_loc_assist_data_type (XDR *, rpc_loc_assist_data_type*); -extern bool_t xdr_rpc_loc_assist_data_delete_s_type (XDR *, rpc_loc_assist_data_delete_s_type*); -extern bool_t xdr_rpc_loc_ioctl_data_u_type (XDR *, rpc_loc_ioctl_data_u_type*); -extern bool_t xdr_rpc_loc_ioctl_callback_data_u_type (XDR *, rpc_loc_ioctl_callback_data_u_type*); -extern bool_t xdr_rpc_loc_ioctl_callback_s_type (XDR *, rpc_loc_ioctl_callback_s_type*); -extern bool_t xdr_rpc_loc_event_payload_u_type (XDR *, rpc_loc_event_payload_u_type*); - -#else /* K&R C */ -extern bool_t xdr_rpc_loc_client_handle_type (); -extern bool_t xdr_rpc_loc_event_mask_type (); -extern bool_t xdr_rpc_loc_position_valid_mask_type (); -extern bool_t xdr_rpc_loc_pos_technology_mask_type (); -extern bool_t xdr_rpc_loc_session_status_e_type (); -extern bool_t xdr_rpc_loc_calendar_time_s_type (); -extern bool_t xdr_rpc_loc_parsed_position_s_type (); -extern bool_t xdr_rpc_loc_sv_system_e_type (); -extern bool_t xdr_rpc_loc_sv_status_e_type (); -extern bool_t xdr_rpc_loc_sv_info_valid_mask_type (); -extern bool_t xdr_rpc_loc_sv_info_s_type (); -extern bool_t xdr_rpc_loc_gnss_info_valid_mask_type (); -extern bool_t xdr_rpc_loc_gnss_info_s_type (); -extern bool_t xdr_rpc_loc_nmea_report_s_type (); -extern bool_t xdr_rpc_loc_status_event_e_type (); -extern bool_t xdr_rpc_loc_engine_state_e_type (); -extern bool_t xdr_rpc_loc_fix_session_state_e_type (); -extern bool_t xdr_rpc_loc_status_event_payload_u_type (); -extern bool_t xdr_rpc_loc_status_event_s_type (); -extern bool_t xdr_rpc_loc_server_addr_e_type (); -extern bool_t xdr_rpc_loc_server_addr_ipv4_type (); -extern bool_t xdr_rpc_loc_server_addr_url_type (); -extern bool_t xdr_rpc_loc_server_addr_ipv6_type (); -extern bool_t xdr_rpc_loc_server_addr_u_type (); -extern bool_t xdr_rpc_loc_server_info_s_type (); -extern bool_t xdr_rpc_loc_ni_notify_verify_e_type (); -extern bool_t xdr_rpc_loc_ni_event_e_type (); -extern bool_t xdr_rpc_loc_ni_datacoding_scheme_e_type (); -extern bool_t xdr_rpc_loc_ni_vx_requester_id_encoding_scheme_e_type (); -extern bool_t xdr_rpc_loc_ni_vx_pos_mode_e_type (); -extern bool_t xdr_rpc_loc_ni_vx_requester_id_s_type (); -extern bool_t xdr_rpc_loc_ni_vx_notify_verify_req_s_type (); -extern bool_t xdr_rpc_loc_ni_supl_pos_method_e_type (); -extern bool_t xdr_rpc_loc_ni_supl_slp_session_id_s_type (); -extern bool_t xdr_rpc_loc_ni_requestor_id_s_type (); -extern bool_t xdr_rpc_loc_ni_supl_client_name_s_type (); -extern bool_t xdr_rpc_loc_ni_supl_qop_s_type (); -extern bool_t xdr_rpc_loc_ni_supl_notify_verify_req_s_type (); -extern bool_t xdr_rpc_loc_ni_ext_client_address_s_type (); -extern bool_t xdr_rpc_loc_ni_location_type_e_type (); -extern bool_t xdr_rpc_loc_ni_deferred_location_s_type (); -extern bool_t xdr_rpc_loc_ni_codeword_string_s_type (); -extern bool_t xdr_rpc_loc_ni_service_type_id_s_type (); -extern bool_t xdr_rpc_loc_ni_umts_cp_notify_verify_req_s_type (); -extern bool_t xdr_rpc_loc_ni_service_interaction_e_type (); -extern bool_t xdr_rpc_loc_ni_vx_service_interaction_req_s_type (); -extern bool_t xdr_rpc_loc_ni_event_payload_u_type (); -extern bool_t xdr_rpc_loc_ni_event_s_type (); -extern bool_t xdr_rpc_loc_assist_data_request_e_type (); -extern bool_t xdr_rpc_struct_loc_time_download_source_s_type_servers_ptr (); -extern bool_t xdr_rpc_struct_loc_time_download_source_s_type_servers (); -extern bool_t xdr_rpc_loc_time_download_source_s_type (); -extern bool_t xdr_rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr (); -extern bool_t xdr_rpc_struct_loc_predicted_orbits_data_source_s_type_servers (); -extern bool_t xdr_rpc_loc_predicted_orbits_data_source_s_type (); -extern bool_t xdr_rpc_loc_pos_inj_request_s_type (); -extern bool_t xdr_rpc_loc_assist_data_request_payload_u_type (); -extern bool_t xdr_rpc_loc_assist_data_request_s_type (); -extern bool_t xdr_rpc_loc_server_connection_handle (); -extern bool_t xdr_rpc_loc_server_protocol_e_type (); -extern bool_t xdr_rpc_loc_server_connection_e_type (); -extern bool_t xdr_rpc_loc_server_request_e_type (); -extern bool_t xdr_rpc_loc_server_open_req_s_type (); -extern bool_t xdr_rpc_loc_server_multi_open_req_s_type (); -extern bool_t xdr_rpc_loc_server_close_req_s_type (); -extern bool_t xdr_rpc_loc_server_request_u_type (); -extern bool_t xdr_rpc_loc_server_request_s_type (); -extern bool_t xdr_rpc_loc_qwip_request_e_type (); -extern bool_t xdr_rpc_loc_qwip_request_s_type (); -extern bool_t xdr_rpc_loc_reserved_payload_s_type (); -extern bool_t xdr_rpc_loc_ioctl_e_type (); -extern bool_t xdr_rpc_loc_api_version_s_type (); -extern bool_t xdr_rpc_loc_fix_recurrence_e_type (); -extern bool_t xdr_rpc_loc_operation_mode_e_type (); -extern bool_t xdr_rpc_loc_notify_e_type (); -extern bool_t xdr_rpc_loc_fix_criteria_s_type (); -extern bool_t xdr_rpc_loc_ni_user_resp_e_type (); -extern bool_t xdr_rpc_loc_user_verify_s_type (); -extern bool_t xdr_rpc_loc_predicted_orbits_data_format_e_type (); -extern bool_t xdr_rpc_loc_predicted_orbits_data_s_type (); -extern bool_t xdr_rpc_loc_predicted_orbits_data_validity_report_s_type (); -extern bool_t xdr_rpc_loc_predicted_orbits_auto_download_config_s_type (); -extern bool_t xdr_rpc_loc_assist_data_time_s_type (); -extern bool_t xdr_rpc_loc_assist_pos_valid_mask_type (); -extern bool_t xdr_rpc_loc_assist_data_pos_s_type (); -extern bool_t xdr_rpc_loc_server_open_status_e_type (); -extern bool_t xdr_rpc_loc_server_pdp_type_e_type (); -extern bool_t xdr_rpc_loc_server_open_status_s_type (); -extern bool_t xdr_rpc_loc_server_multi_open_status_s_type (); -extern bool_t xdr_rpc_loc_server_close_status_e_type (); -extern bool_t xdr_rpc_loc_server_close_status_s_type (); -extern bool_t xdr_rpc_loc_wiper_fix_time_s_type (); -extern bool_t xdr_rpc_loc_wiper_fix_pos_s_type (); -extern bool_t xdr_rpc_loc_wiper_ap_info_s_type (); -extern bool_t xdr_rpc_loc_wiper_ap_set_s_type (); -extern bool_t xdr_rpc_loc_wiper_position_report_s_type (); -extern bool_t xdr_rpc_loc_wiper_status_e_type (); -extern bool_t xdr_rpc_loc_fs_operation_e_type (); -extern bool_t xdr_rpc_loc_efs_data_s_type (); -extern bool_t xdr_rpc_loc_error_estimate_config_e_type (); -extern bool_t xdr_rpc_loc_apn_profiles_type (); -extern bool_t xdr_rpc_loc_lock_e_type (); -extern bool_t xdr_rpc_loc_nmea_sentence_type (); -extern bool_t xdr_rpc_loc_assist_data_type (); -extern bool_t xdr_rpc_loc_assist_data_delete_s_type (); -extern bool_t xdr_rpc_loc_ioctl_data_u_type (); -extern bool_t xdr_rpc_loc_ioctl_callback_data_u_type (); -extern bool_t xdr_rpc_loc_ioctl_callback_s_type (); -extern bool_t xdr_rpc_loc_event_payload_u_type (); - -#endif /* K&R C */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_LOC_API_COMMON_RPC_H_RPCGEN */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h deleted file mode 100644 index 6138432..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_api_rpcgen_rpc.h +++ /dev/null @@ -1,288 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _LOC_API_RPC_H_RPCGEN -#define _LOC_API_RPC_H_RPCGEN - -#include "librpc.h" -#include "commondefs_rpcgen_rpc.h" -#include "loc_api_rpcgen_common_rpc.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - u_int rpc_loc_api_api_versions_return_type_len; - rpc_uint32 *rpc_loc_api_api_versions_return_type_val; -} rpc_loc_api_api_versions_return_type; - -typedef rpc_uint32 rpc_loc_event_cb_f_type; - -struct rpc_loc_open_args { - rpc_loc_event_mask_type event_reg_mask; - rpc_loc_event_cb_f_type event_callback; -}; -typedef struct rpc_loc_open_args rpc_loc_open_args; - -struct rpc_loc_close_args { - rpc_loc_client_handle_type handle; -}; -typedef struct rpc_loc_close_args rpc_loc_close_args; - -struct rpc_loc_start_fix_args { - rpc_loc_client_handle_type handle; -}; -typedef struct rpc_loc_start_fix_args rpc_loc_start_fix_args; - -struct rpc_loc_stop_fix_args { - rpc_loc_client_handle_type handle; -}; -typedef struct rpc_loc_stop_fix_args rpc_loc_stop_fix_args; - -struct rpc_loc_ioctl_args { - rpc_loc_client_handle_type handle; - rpc_loc_ioctl_e_type ioctl_type; - rpc_loc_ioctl_data_u_type *ioctl_data; -}; -typedef struct rpc_loc_ioctl_args rpc_loc_ioctl_args; - -struct rpc_loc_api_api_version_s_args { - rpc_boolean len_not_null; -}; -typedef struct rpc_loc_api_api_version_s_args rpc_loc_api_api_version_s_args; - -struct rpc_loc_api_rpc_glue_code_info_remote_rets { - rpc_uint32 toolvers; - rpc_uint32 features; - rpc_uint32 proghash; - rpc_uint32 cbproghash; -}; -typedef struct rpc_loc_api_rpc_glue_code_info_remote_rets rpc_loc_api_rpc_glue_code_info_remote_rets; - -struct rpc_loc_open_rets { - rpc_loc_client_handle_type loc_open_result; -}; -typedef struct rpc_loc_open_rets rpc_loc_open_rets; - -struct rpc_loc_close_rets { - rpc_int32 loc_close_result; -}; -typedef struct rpc_loc_close_rets rpc_loc_close_rets; - -struct rpc_loc_start_fix_rets { - rpc_int32 loc_start_fix_result; -}; -typedef struct rpc_loc_start_fix_rets rpc_loc_start_fix_rets; - -struct rpc_loc_stop_fix_rets { - rpc_int32 loc_stop_fix_result; -}; -typedef struct rpc_loc_stop_fix_rets rpc_loc_stop_fix_rets; - -struct rpc_loc_ioctl_rets { - rpc_int32 loc_ioctl_result; -}; -typedef struct rpc_loc_ioctl_rets rpc_loc_ioctl_rets; - -struct rpc_loc_api_api_versions_rets { - rpc_loc_api_api_versions_return_type loc_api_api_versions_result; - rpc_uint32 *len; -}; -typedef struct rpc_loc_api_api_versions_rets rpc_loc_api_api_versions_rets; -#define LOC_APIVERS 0x00050006 - -#define LOC_APIPROG 0x3000008C -#define LOC_APIVERS_0001 0x00050001 - -#if defined(__STDC__) || defined(__cplusplus) -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00050001(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00050001_svc(void *, void *, struct svc_req *); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00050001(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, CLIENT *); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00050001_svc(void *, rpc_loc_api_rpc_glue_code_info_remote_rets *, struct svc_req *); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00050001(rpc_loc_open_args *, rpc_loc_open_rets *, CLIENT *); -extern bool_t rpc_loc_open_0x00050001_svc(rpc_loc_open_args *, rpc_loc_open_rets *, struct svc_req *); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00050001(rpc_loc_close_args *, rpc_loc_close_rets *, CLIENT *); -extern bool_t rpc_loc_close_0x00050001_svc(rpc_loc_close_args *, rpc_loc_close_rets *, struct svc_req *); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00050001(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, CLIENT *); -extern bool_t rpc_loc_start_fix_0x00050001_svc(rpc_loc_start_fix_args *, rpc_loc_start_fix_rets *, struct svc_req *); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00050001(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, CLIENT *); -extern bool_t rpc_loc_stop_fix_0x00050001_svc(rpc_loc_stop_fix_args *, rpc_loc_stop_fix_rets *, struct svc_req *); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00050001(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, CLIENT *); -extern bool_t rpc_loc_ioctl_0x00050001_svc(rpc_loc_ioctl_args *, rpc_loc_ioctl_rets *, struct svc_req *); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00050001(void *, rpc_loc_api_api_versions_rets *, CLIENT *); -extern bool_t rpc_loc_api_api_versions_0x00050001_svc(void *, rpc_loc_api_api_versions_rets *, struct svc_req *); -extern int loc_apiprog_0x00050001_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define rpc_loc_api_null 0 -extern enum clnt_stat rpc_loc_api_null_0x00050001(); -extern bool_t rpc_loc_api_null_0x00050001_svc(); -#define rpc_loc_api_rpc_glue_code_info_remote 1 -extern enum clnt_stat rpc_loc_api_rpc_glue_code_info_remote_0x00050001(); -extern bool_t rpc_loc_api_rpc_glue_code_info_remote_0x00050001_svc(); -#define rpc_loc_open 2 -extern enum clnt_stat rpc_loc_open_0x00050001(); -extern bool_t rpc_loc_open_0x00050001_svc(); -#define rpc_loc_close 3 -extern enum clnt_stat rpc_loc_close_0x00050001(); -extern bool_t rpc_loc_close_0x00050001_svc(); -#define rpc_loc_start_fix 4 -extern enum clnt_stat rpc_loc_start_fix_0x00050001(); -extern bool_t rpc_loc_start_fix_0x00050001_svc(); -#define rpc_loc_stop_fix 5 -extern enum clnt_stat rpc_loc_stop_fix_0x00050001(); -extern bool_t rpc_loc_stop_fix_0x00050001_svc(); -#define rpc_loc_ioctl 6 -extern enum clnt_stat rpc_loc_ioctl_0x00050001(); -extern bool_t rpc_loc_ioctl_0x00050001_svc(); -#define rpc_loc_api_api_versions 0xFFFFFFFF -extern enum clnt_stat rpc_loc_api_api_versions_0x00050001(); -extern bool_t rpc_loc_api_api_versions_0x00050001_svc(); -extern int loc_apiprog_0x00050001_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0002 0x00050002 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00050002(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00050002_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00050002_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00050002(); -extern bool_t rpc_loc_api_null_0x00050002_svc(); -extern int loc_apiprog_0x00050002_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0003 0x00050003 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00050003(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00050003_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00050003_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00050003(); -extern bool_t rpc_loc_api_null_0x00050003_svc(); -extern int loc_apiprog_0x00050003_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0004 0x00050004 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00050004(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00050004_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00050004_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00050004(); -extern bool_t rpc_loc_api_null_0x00050004_svc(); -extern int loc_apiprog_0x00050004_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0005 0x00050005 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00050005(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00050005_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00050005_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00050005(); -extern bool_t rpc_loc_api_null_0x00050005_svc(); -extern int loc_apiprog_0x00050005_freeresult (); -#endif /* K&R C */ -#define LOC_APIVERS_0006 0x00050006 - -#if defined(__STDC__) || defined(__cplusplus) -extern enum clnt_stat rpc_loc_api_null_0x00050006(void *, void *, CLIENT *); -extern bool_t rpc_loc_api_null_0x00050006_svc(void *, void *, struct svc_req *); -extern int loc_apiprog_0x00050006_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -extern enum clnt_stat rpc_loc_api_null_0x00050006(); -extern bool_t rpc_loc_api_null_0x00050006_svc(); -extern int loc_apiprog_0x00050006_freeresult (); -#endif /* K&R C */ - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_rpc_loc_api_api_versions_return_type (XDR *, rpc_loc_api_api_versions_return_type*); -extern bool_t xdr_rpc_loc_event_cb_f_type (XDR *, rpc_loc_event_cb_f_type*); -extern bool_t xdr_rpc_loc_open_args (XDR *, rpc_loc_open_args*); -extern bool_t xdr_rpc_loc_close_args (XDR *, rpc_loc_close_args*); -extern bool_t xdr_rpc_loc_start_fix_args (XDR *, rpc_loc_start_fix_args*); -extern bool_t xdr_rpc_loc_stop_fix_args (XDR *, rpc_loc_stop_fix_args*); -extern bool_t xdr_rpc_loc_ioctl_args (XDR *, rpc_loc_ioctl_args*); -extern bool_t xdr_rpc_loc_api_api_version_s_args (XDR *, rpc_loc_api_api_version_s_args*); -extern bool_t xdr_rpc_loc_api_rpc_glue_code_info_remote_rets (XDR *, rpc_loc_api_rpc_glue_code_info_remote_rets*); -extern bool_t xdr_rpc_loc_open_rets (XDR *, rpc_loc_open_rets*); -extern bool_t xdr_rpc_loc_close_rets (XDR *, rpc_loc_close_rets*); -extern bool_t xdr_rpc_loc_start_fix_rets (XDR *, rpc_loc_start_fix_rets*); -extern bool_t xdr_rpc_loc_stop_fix_rets (XDR *, rpc_loc_stop_fix_rets*); -extern bool_t xdr_rpc_loc_ioctl_rets (XDR *, rpc_loc_ioctl_rets*); -extern bool_t xdr_rpc_loc_api_api_versions_rets (XDR *, rpc_loc_api_api_versions_rets*); - -#else /* K&R C */ -extern bool_t xdr_rpc_loc_api_api_versions_return_type (); -extern bool_t xdr_rpc_loc_event_cb_f_type (); -extern bool_t xdr_rpc_loc_open_args (); -extern bool_t xdr_rpc_loc_close_args (); -extern bool_t xdr_rpc_loc_start_fix_args (); -extern bool_t xdr_rpc_loc_stop_fix_args (); -extern bool_t xdr_rpc_loc_ioctl_args (); -extern bool_t xdr_rpc_loc_api_api_version_s_args (); -extern bool_t xdr_rpc_loc_api_rpc_glue_code_info_remote_rets (); -extern bool_t xdr_rpc_loc_open_rets (); -extern bool_t xdr_rpc_loc_close_rets (); -extern bool_t xdr_rpc_loc_start_fix_rets (); -extern bool_t xdr_rpc_loc_stop_fix_rets (); -extern bool_t xdr_rpc_loc_ioctl_rets (); -extern bool_t xdr_rpc_loc_api_api_versions_rets (); - -#endif /* K&R C */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_LOC_API_RPC_H_RPCGEN */ diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h deleted file mode 100644 index 875c4f0..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/inc/loc_apicb_appinit.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/* Initialization function for callbacks */ -int loc_apicb_app_init(); - -void loc_apicb_app_deinit(); - diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c deleted file mode 100644 index 2ef5852..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_svc.c +++ /dev/null @@ -1,327 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_rpcgen_cb_rpc.h" -#include -#include -#include -#include -#include -#include -#include - -#ifndef SIG_PF -#define SIG_PF void(*)(int) -#endif - -void -loc_apicbprog_0x00050001(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - rpc_loc_event_cb_f_type_args rpc_loc_event_cb_f_type_0x00050001_arg; - } argument; - union { - rpc_loc_event_cb_f_type_rets rpc_loc_event_cb_f_type_0x00050001_res; - } result; - bool_t retval; - xdrproc_t _xdr_argument, _xdr_result; - bool_t (*local)(char *, void *, struct svc_req *); - - switch (rqstp->rq_proc) { - case NULLPROC: - (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL); - return; - - case rpc_loc_event_cb_f_type: - _xdr_argument = (xdrproc_t) xdr_rpc_loc_event_cb_f_type_args; - _xdr_result = (xdrproc_t) xdr_rpc_loc_event_cb_f_type_rets; - local = (bool_t (*) (char *, void *, struct svc_req *))rpc_loc_event_cb_f_type_0x00050001_svc; - break; - - default: - svcerr_noproc (transp); - return; - } - memset ((char *)&argument, 0, sizeof (argument)); - if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - svcerr_decode (transp); - return; - } - retval = (bool_t) (*local)((char *)&argument, (void *)&result, rqstp); - if (retval > 0 && !svc_sendreply(transp, (xdrproc_t) _xdr_result, (char *)&result)) { - svcerr_systemerr (transp); - } - if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - fprintf (stderr, "%s", "unable to free arguments"); - exit (1); - } - if (!loc_apicbprog_0x00050001_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} - -void -loc_apicbprog_0x00050002(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - int fill; - } argument; - union { - int rpc_loc_api_cb_null_0x00050002_res; - } result; - bool_t retval; - xdrproc_t _xdr_argument, _xdr_result; - bool_t (*local)(char *, void *, struct svc_req *); - - switch (rqstp->rq_proc) { - case NULLPROC: - (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL); - return; - - case rpc_loc_api_cb_null: - _xdr_argument = (xdrproc_t) xdr_void; - _xdr_result = (xdrproc_t) xdr_int; - local = (bool_t (*) (char *, void *, struct svc_req *))rpc_loc_api_cb_null_0x00050002_svc; - break; - - default: - svcerr_noproc (transp); - return; - } - memset ((char *)&argument, 0, sizeof (argument)); - if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - svcerr_decode (transp); - return; - } - retval = (bool_t) (*local)((char *)&argument, (void *)&result, rqstp); - if (retval > 0 && !svc_sendreply(transp, (xdrproc_t) _xdr_result, (char *)&result)) { - svcerr_systemerr (transp); - } - if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - fprintf (stderr, "%s", "unable to free arguments"); - exit (1); - } - if (!loc_apicbprog_0x00050002_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} - -void -loc_apicbprog_0x00050003(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - int fill; - } argument; - union { - int rpc_loc_api_cb_null_0x00050003_res; - } result; - bool_t retval; - xdrproc_t _xdr_argument, _xdr_result; - bool_t (*local)(char *, void *, struct svc_req *); - - switch (rqstp->rq_proc) { - case NULLPROC: - (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL); - return; - - case rpc_loc_api_cb_null: - _xdr_argument = (xdrproc_t) xdr_void; - _xdr_result = (xdrproc_t) xdr_int; - local = (bool_t (*) (char *, void *, struct svc_req *))rpc_loc_api_cb_null_0x00050003_svc; - break; - - default: - svcerr_noproc (transp); - return; - } - memset ((char *)&argument, 0, sizeof (argument)); - if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - svcerr_decode (transp); - return; - } - retval = (bool_t) (*local)((char *)&argument, (void *)&result, rqstp); - if (retval > 0 && !svc_sendreply(transp, (xdrproc_t) _xdr_result, (char *)&result)) { - svcerr_systemerr (transp); - } - if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - fprintf (stderr, "%s", "unable to free arguments"); - exit (1); - } - if (!loc_apicbprog_0x00050003_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} - -void -loc_apicbprog_0x00050004(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - int fill; - } argument; - union { - int rpc_loc_api_cb_null_0x00050004_res; - } result; - bool_t retval; - xdrproc_t _xdr_argument, _xdr_result; - bool_t (*local)(char *, void *, struct svc_req *); - - switch (rqstp->rq_proc) { - case NULLPROC: - (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL); - return; - - case rpc_loc_api_cb_null: - _xdr_argument = (xdrproc_t) xdr_void; - _xdr_result = (xdrproc_t) xdr_int; - local = (bool_t (*) (char *, void *, struct svc_req *))rpc_loc_api_cb_null_0x00050004_svc; - break; - - default: - svcerr_noproc (transp); - return; - } - memset ((char *)&argument, 0, sizeof (argument)); - if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - svcerr_decode (transp); - return; - } - retval = (bool_t) (*local)((char *)&argument, (void *)&result, rqstp); - if (retval > 0 && !svc_sendreply(transp, (xdrproc_t) _xdr_result, (char *)&result)) { - svcerr_systemerr (transp); - } - if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - fprintf (stderr, "%s", "unable to free arguments"); - exit (1); - } - if (!loc_apicbprog_0x00050004_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} - -void -loc_apicbprog_0x00050005(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - int fill; - } argument; - union { - int rpc_loc_api_cb_null_0x00050005_res; - } result; - bool_t retval; - xdrproc_t _xdr_argument, _xdr_result; - bool_t (*local)(char *, void *, struct svc_req *); - - switch (rqstp->rq_proc) { - case NULLPROC: - (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL); - return; - - case rpc_loc_api_cb_null: - _xdr_argument = (xdrproc_t) xdr_void; - _xdr_result = (xdrproc_t) xdr_int; - local = (bool_t (*) (char *, void *, struct svc_req *))rpc_loc_api_cb_null_0x00050005_svc; - break; - - default: - svcerr_noproc (transp); - return; - } - memset ((char *)&argument, 0, sizeof (argument)); - if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - svcerr_decode (transp); - return; - } - retval = (bool_t) (*local)((char *)&argument, (void *)&result, rqstp); - if (retval > 0 && !svc_sendreply(transp, (xdrproc_t) _xdr_result, (char *)&result)) { - svcerr_systemerr (transp); - } - if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - fprintf (stderr, "%s", "unable to free arguments"); - exit (1); - } - if (!loc_apicbprog_0x00050005_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} - -void -loc_apicbprog_0x00050006(struct svc_req *rqstp, register SVCXPRT *transp) -{ - union { - int fill; - } argument; - union { - int rpc_loc_api_cb_null_0x00050006_res; - } result; - bool_t retval; - xdrproc_t _xdr_argument, _xdr_result; - bool_t (*local)(char *, void *, struct svc_req *); - - switch (rqstp->rq_proc) { - case NULLPROC: - (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL); - return; - - case rpc_loc_api_cb_null: - _xdr_argument = (xdrproc_t) xdr_void; - _xdr_result = (xdrproc_t) xdr_int; - local = (bool_t (*) (char *, void *, struct svc_req *))rpc_loc_api_cb_null_0x00050006_svc; - break; - - default: - svcerr_noproc (transp); - return; - } - memset ((char *)&argument, 0, sizeof (argument)); - if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - svcerr_decode (transp); - return; - } - retval = (bool_t) (*local)((char *)&argument, (void *)&result, rqstp); - if (retval > 0 && !svc_sendreply(transp, (xdrproc_t) _xdr_result, (char *)&result)) { - svcerr_systemerr (transp); - } - if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - fprintf (stderr, "%s", "unable to free arguments"); - exit (1); - } - if (!loc_apicbprog_0x00050006_freeresult (transp, _xdr_result, (caddr_t) &result)) - fprintf (stderr, "%s", "unable to free results"); - - return; -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c deleted file mode 100644 index ad171dc..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_cb_xdr.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_rpcgen_cb_rpc.h" - -bool_t -xdr_rpc_loc_event_cb_f_type_args (XDR *xdrs, rpc_loc_event_cb_f_type_args *objp) -{ -; - - if (!xdr_rpc_uint32 (xdrs, &objp->cb_id)) - return FALSE; - if (!xdr_rpc_loc_client_handle_type (xdrs, &objp->loc_handle)) - return FALSE; - if (!xdr_rpc_loc_event_mask_type (xdrs, &objp->loc_event)) - return FALSE; - if (!xdr_pointer (xdrs, (char **)&objp->loc_event_payload, sizeof (rpc_loc_event_payload_u_type), (xdrproc_t) xdr_rpc_loc_event_payload_u_type)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_event_cb_f_type_rets (XDR *xdrs, rpc_loc_event_cb_f_type_rets *objp) -{ -; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_event_cb_f_type_result)) - return FALSE; - return TRUE; -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c deleted file mode 100644 index 3e39576..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_clnt.c +++ /dev/null @@ -1,155 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include /* for memset */ -#include "loc_api_rpcgen_rpc.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -enum clnt_stat -rpc_loc_api_null_0x00050001(void *argp, void *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_api_null, - (xdrproc_t) xdr_void, (caddr_t) argp, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_api_rpc_glue_code_info_remote_0x00050001(void *argp, rpc_loc_api_rpc_glue_code_info_remote_rets *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_api_rpc_glue_code_info_remote, - (xdrproc_t) xdr_void, (caddr_t) argp, - (xdrproc_t) xdr_rpc_loc_api_rpc_glue_code_info_remote_rets, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_open_0x00050001(rpc_loc_open_args *argp, rpc_loc_open_rets *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_open, - (xdrproc_t) xdr_rpc_loc_open_args, (caddr_t) argp, - (xdrproc_t) xdr_rpc_loc_open_rets, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_close_0x00050001(rpc_loc_close_args *argp, rpc_loc_close_rets *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_close, - (xdrproc_t) xdr_rpc_loc_close_args, (caddr_t) argp, - (xdrproc_t) xdr_rpc_loc_close_rets, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_start_fix_0x00050001(rpc_loc_start_fix_args *argp, rpc_loc_start_fix_rets *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_start_fix, - (xdrproc_t) xdr_rpc_loc_start_fix_args, (caddr_t) argp, - (xdrproc_t) xdr_rpc_loc_start_fix_rets, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_stop_fix_0x00050001(rpc_loc_stop_fix_args *argp, rpc_loc_stop_fix_rets *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_stop_fix, - (xdrproc_t) xdr_rpc_loc_stop_fix_args, (caddr_t) argp, - (xdrproc_t) xdr_rpc_loc_stop_fix_rets, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_ioctl_0x00050001(rpc_loc_ioctl_args *argp, rpc_loc_ioctl_rets *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_ioctl, - (xdrproc_t) xdr_rpc_loc_ioctl_args, (caddr_t) argp, - (xdrproc_t) xdr_rpc_loc_ioctl_rets, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_api_api_versions_0x00050001(void *argp, rpc_loc_api_api_versions_rets *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_api_api_versions, - (xdrproc_t) xdr_void, (caddr_t) argp, - (xdrproc_t) xdr_rpc_loc_api_api_versions_rets, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_api_null_0x00050002(void *argp, void *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_api_null, - (xdrproc_t) xdr_void, (caddr_t) argp, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_api_null_0x00050003(void *argp, void *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_api_null, - (xdrproc_t) xdr_void, (caddr_t) argp, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_api_null_0x00050004(void *argp, void *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_api_null, - (xdrproc_t) xdr_void, (caddr_t) argp, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_api_null_0x00050005(void *argp, void *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_api_null, - (xdrproc_t) xdr_void, (caddr_t) argp, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); -} - -enum clnt_stat -rpc_loc_api_null_0x00050006(void *argp, void *clnt_res, CLIENT *clnt) -{ - return (clnt_call(clnt, rpc_loc_api_null, - (xdrproc_t) xdr_void, (caddr_t) argp, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c deleted file mode 100644 index 21be8f4..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_common_xdr.c +++ /dev/null @@ -1,1775 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_rpcgen_common_rpc.h" - -bool_t -xdr_rpc_loc_client_handle_type (XDR *xdrs, rpc_loc_client_handle_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_event_mask_type (XDR *xdrs, rpc_loc_event_mask_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint64 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_position_valid_mask_type (XDR *xdrs, rpc_loc_position_valid_mask_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint64 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_pos_technology_mask_type (XDR *xdrs, rpc_loc_pos_technology_mask_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_session_status_e_type (XDR *xdrs, rpc_loc_session_status_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_calendar_time_s_type (XDR *xdrs, rpc_loc_calendar_time_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint16 (xdrs, &objp->year)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->month)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->day_of_week)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->day)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->hour)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->minute)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->second)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->millisecond)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_parsed_position_s_type (XDR *xdrs, rpc_loc_parsed_position_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_position_valid_mask_type (xdrs, &objp->valid_mask)) - return FALSE; - if (!xdr_rpc_loc_session_status_e_type (xdrs, &objp->session_status)) - return FALSE; - if (!xdr_rpc_loc_calendar_time_s_type (xdrs, &objp->timestamp_calendar)) - return FALSE; - if (!xdr_rpc_uint64 (xdrs, &objp->timestamp_utc)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->leap_seconds)) - return FALSE; - if (!xdr_float (xdrs, &objp->time_unc)) - return FALSE; - if (!xdr_double (xdrs, &objp->latitude)) - return FALSE; - if (!xdr_double (xdrs, &objp->longitude)) - return FALSE; - if (!xdr_float (xdrs, &objp->altitude_wrt_ellipsoid)) - return FALSE; - if (!xdr_float (xdrs, &objp->altitude_wrt_mean_sea_level)) - return FALSE; - if (!xdr_float (xdrs, &objp->speed_horizontal)) - return FALSE; - if (!xdr_float (xdrs, &objp->speed_vertical)) - return FALSE; - if (!xdr_float (xdrs, &objp->heading)) - return FALSE; - if (!xdr_float (xdrs, &objp->hor_unc_circular)) - return FALSE; - if (!xdr_float (xdrs, &objp->hor_unc_ellipse_semi_major)) - return FALSE; - if (!xdr_float (xdrs, &objp->hor_unc_ellipse_semi_minor)) - return FALSE; - if (!xdr_float (xdrs, &objp->hor_unc_ellipse_orient_azimuth)) - return FALSE; - if (!xdr_float (xdrs, &objp->vert_unc)) - return FALSE; - if (!xdr_float (xdrs, &objp->speed_unc)) - return FALSE; - if (!xdr_float (xdrs, &objp->heading_unc)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->confidence_horizontal)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->confidence_vertical)) - return FALSE; - if (!xdr_float (xdrs, &objp->magnetic_deviation)) - return FALSE; - if (!xdr_rpc_loc_pos_technology_mask_type (xdrs, &objp->technology_mask)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_sv_system_e_type (XDR *xdrs, rpc_loc_sv_system_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_sv_status_e_type (XDR *xdrs, rpc_loc_sv_status_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_sv_info_valid_mask_type (XDR *xdrs, rpc_loc_sv_info_valid_mask_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_sv_info_s_type (XDR *xdrs, rpc_loc_sv_info_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_sv_info_valid_mask_type (xdrs, &objp->valid_mask)) - return FALSE; - if (!xdr_rpc_loc_sv_system_e_type (xdrs, &objp->system)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->prn)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->health_status)) - return FALSE; - if (!xdr_rpc_loc_sv_status_e_type (xdrs, &objp->process_status)) - return FALSE; - if (!xdr_rpc_boolean (xdrs, &objp->has_eph)) - return FALSE; - if (!xdr_rpc_boolean (xdrs, &objp->has_alm)) - return FALSE; - if (!xdr_float (xdrs, &objp->elevation)) - return FALSE; - if (!xdr_float (xdrs, &objp->azimuth)) - return FALSE; - if (!xdr_float (xdrs, &objp->snr)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_gnss_info_valid_mask_type (XDR *xdrs, rpc_loc_gnss_info_valid_mask_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_gnss_info_s_type (XDR *xdrs, rpc_loc_gnss_info_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_gnss_info_valid_mask_type (xdrs, &objp->valid_mask)) - return FALSE; - if (!xdr_float (xdrs, &objp->position_dop)) - return FALSE; - if (!xdr_float (xdrs, &objp->horizontal_dop)) - return FALSE; - if (!xdr_float (xdrs, &objp->vertical_dop)) - return FALSE; - if (!xdr_rpc_boolean (xdrs, &objp->altitude_assumed)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->sv_count)) - return FALSE; - if (!xdr_array (xdrs, (char **)&objp->sv_list.sv_list_val, (u_int *) &objp->sv_list.sv_list_len, 80, - sizeof (rpc_loc_sv_info_s_type), (xdrproc_t) xdr_rpc_loc_sv_info_s_type)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_nmea_report_s_type (XDR *xdrs, rpc_loc_nmea_report_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_opaque (xdrs, objp->nmea_sentences, 200)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_status_event_e_type (XDR *xdrs, rpc_loc_status_event_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_engine_state_e_type (XDR *xdrs, rpc_loc_engine_state_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_fix_session_state_e_type (XDR *xdrs, rpc_loc_fix_session_state_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_status_event_payload_u_type (XDR *xdrs, rpc_loc_status_event_payload_u_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_status_event_e_type (xdrs, &objp->disc)) - return FALSE; - switch (objp->disc) { - case RPC_LOC_STATUS_EVENT_ENGINE_STATE: - if (!xdr_rpc_loc_engine_state_e_type (xdrs, &objp->rpc_loc_status_event_payload_u_type_u.engine_state)) - return FALSE; - break; - case RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE: - if (!xdr_rpc_loc_fix_session_state_e_type (xdrs, &objp->rpc_loc_status_event_payload_u_type_u.fix_session_state)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_rpc_loc_status_event_s_type (XDR *xdrs, rpc_loc_status_event_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_status_event_e_type (xdrs, &objp->event)) - return FALSE; - if (!xdr_rpc_loc_status_event_payload_u_type (xdrs, &objp->payload)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_addr_e_type (XDR *xdrs, rpc_loc_server_addr_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_addr_ipv4_type (XDR *xdrs, rpc_loc_server_addr_ipv4_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, &objp->addr)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->port)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_addr_url_type (XDR *xdrs, rpc_loc_server_addr_url_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_uint16 (xdrs, &objp->length)) - return FALSE; - if (!xdr_opaque (xdrs, objp->addr, 256)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_addr_ipv6_type (XDR *xdrs, rpc_loc_server_addr_ipv6_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_vector (xdrs, (char *)objp->addr, 8, - sizeof (rpc_uint16), (xdrproc_t) xdr_rpc_uint16)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->port)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_addr_u_type (XDR *xdrs, rpc_loc_server_addr_u_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_server_addr_e_type (xdrs, &objp->disc)) - return FALSE; - switch (objp->disc) { - case RPC_LOC_SERVER_ADDR_IPV4: - if (!xdr_rpc_loc_server_addr_ipv4_type (xdrs, &objp->rpc_loc_server_addr_u_type_u.ipv4)) - return FALSE; - break; - case RPC_LOC_SERVER_ADDR_URL: - if (!xdr_rpc_loc_server_addr_url_type (xdrs, &objp->rpc_loc_server_addr_u_type_u.url)) - return FALSE; - break; - case RPC_LOC_SERVER_ADDR_IPV6: - if (!xdr_rpc_loc_server_addr_ipv6_type (xdrs, &objp->rpc_loc_server_addr_u_type_u.ipv6)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_rpc_loc_server_info_s_type (XDR *xdrs, rpc_loc_server_info_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_server_addr_e_type (xdrs, &objp->addr_type)) - return FALSE; - if (!xdr_rpc_loc_server_addr_u_type (xdrs, &objp->addr_info)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_notify_verify_e_type (XDR *xdrs, rpc_loc_ni_notify_verify_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_event_e_type (XDR *xdrs, rpc_loc_ni_event_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_datacoding_scheme_e_type (XDR *xdrs, rpc_loc_ni_datacoding_scheme_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_vx_requester_id_encoding_scheme_e_type (XDR *xdrs, rpc_loc_ni_vx_requester_id_encoding_scheme_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_vx_pos_mode_e_type (XDR *xdrs, rpc_loc_ni_vx_pos_mode_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_vx_requester_id_s_type (XDR *xdrs, rpc_loc_ni_vx_requester_id_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_u_char (xdrs, &objp->requester_id_length)) - return FALSE; - if (!xdr_opaque (xdrs, objp->requester_id, 200)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_vx_notify_verify_req_s_type (XDR *xdrs, rpc_loc_ni_vx_notify_verify_req_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_ni_notify_verify_e_type (xdrs, &objp->notification_priv_type)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->pos_qos_incl)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->pos_qos)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->num_fixes)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->tbf)) - return FALSE; - if (!xdr_rpc_loc_ni_vx_pos_mode_e_type (xdrs, &objp->pos_mode)) - return FALSE; - if (!xdr_rpc_loc_ni_vx_requester_id_encoding_scheme_e_type (xdrs, &objp->encoding_scheme)) - return FALSE; - if (!xdr_rpc_loc_ni_vx_requester_id_s_type (xdrs, &objp->requester_id)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->user_resp_timer_val)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_supl_pos_method_e_type (XDR *xdrs, rpc_loc_ni_supl_pos_method_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_supl_slp_session_id_s_type (XDR *xdrs, rpc_loc_ni_supl_slp_session_id_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_u_char (xdrs, &objp->presence)) - return FALSE; - if (!xdr_opaque (xdrs, objp->session_id, 4)) - return FALSE; - if (!xdr_rpc_loc_server_info_s_type (xdrs, &objp->slp_address)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_requestor_id_s_type (XDR *xdrs, rpc_loc_ni_requestor_id_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_opaque (xdrs, objp->requestor_id_string, 200)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->string_len)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_supl_client_name_s_type (XDR *xdrs, rpc_loc_ni_supl_client_name_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_opaque (xdrs, objp->client_name_string, 64)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->string_len)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_supl_qop_s_type (XDR *xdrs, rpc_loc_ni_supl_qop_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, &objp->bit_mask)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->horacc)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->veracc)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->maxLocAge)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->delay)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_supl_notify_verify_req_s_type (XDR *xdrs, rpc_loc_ni_supl_notify_verify_req_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_loc_ni_notify_verify_e_type (xdrs, &objp->notification_priv_type)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->flags)) - return FALSE; - if (!xdr_rpc_loc_ni_supl_slp_session_id_s_type (xdrs, &objp->supl_slp_session_id)) - return FALSE; - if (!xdr_opaque (xdrs, objp->supl_hash, 8)) - return FALSE; - if (!xdr_rpc_loc_ni_datacoding_scheme_e_type (xdrs, &objp->datacoding_scheme)) - return FALSE; - if (!xdr_rpc_loc_ni_supl_pos_method_e_type (xdrs, &objp->pos_method)) - return FALSE; - if (!xdr_rpc_loc_ni_requestor_id_s_type (xdrs, &objp->requestor_id)) - return FALSE; - if (!xdr_rpc_loc_ni_supl_client_name_s_type (xdrs, &objp->client_name)) - return FALSE; - if (!xdr_rpc_loc_ni_supl_qop_s_type (xdrs, &objp->supl_qop)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->user_response_timer)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_ext_client_address_s_type (XDR *xdrs, rpc_loc_ni_ext_client_address_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_u_char (xdrs, &objp->ext_client_address_len)) - return FALSE; - if (!xdr_opaque (xdrs, objp->ext_client_address, 20)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_location_type_e_type (XDR *xdrs, rpc_loc_ni_location_type_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_deferred_location_s_type (XDR *xdrs, rpc_loc_ni_deferred_location_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, &objp->unused_bits)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->ms_available)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_codeword_string_s_type (XDR *xdrs, rpc_loc_ni_codeword_string_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_u_char (xdrs, &objp->data_coding_scheme)) - return FALSE; - if (!xdr_opaque (xdrs, objp->lcs_codeword_string, 20)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->string_len)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_service_type_id_s_type (XDR *xdrs, rpc_loc_ni_service_type_id_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, &objp->lcs_service_type_id)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_umts_cp_notify_verify_req_s_type (XDR *xdrs, rpc_loc_ni_umts_cp_notify_verify_req_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_loc_ni_notify_verify_e_type (xdrs, &objp->notification_priv_type)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->invoke_id)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->flags)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->notification_length)) - return FALSE; - if (!xdr_opaque (xdrs, objp->notification_text, 64)) - return FALSE; - if (!xdr_rpc_loc_ni_datacoding_scheme_e_type (xdrs, &objp->datacoding_scheme)) - return FALSE; - if (!xdr_rpc_loc_ni_ext_client_address_s_type (xdrs, &objp->ext_client_address_data)) - return FALSE; - if (!xdr_rpc_loc_ni_location_type_e_type (xdrs, &objp->location_type)) - return FALSE; - if (!xdr_rpc_loc_ni_deferred_location_s_type (xdrs, &objp->deferred_location)) - return FALSE; - if (!xdr_rpc_loc_ni_requestor_id_s_type (xdrs, &objp->requestor_id)) - return FALSE; - if (!xdr_rpc_loc_ni_codeword_string_s_type (xdrs, &objp->codeword_string)) - return FALSE; - if (!xdr_rpc_loc_ni_service_type_id_s_type (xdrs, &objp->service_type_id)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->user_response_timer)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_service_interaction_e_type (XDR *xdrs, rpc_loc_ni_service_interaction_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_vx_service_interaction_req_s_type (XDR *xdrs, rpc_loc_ni_vx_service_interaction_req_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_ni_vx_notify_verify_req_s_type (xdrs, &objp->ni_vx_req)) - return FALSE; - if (!xdr_rpc_loc_ni_service_interaction_e_type (xdrs, &objp->service_interation_type)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_event_payload_u_type (XDR *xdrs, rpc_loc_ni_event_payload_u_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_ni_event_e_type (xdrs, &objp->disc)) - return FALSE; - switch (objp->disc) { - case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - if (!xdr_rpc_loc_ni_vx_notify_verify_req_s_type (xdrs, &objp->rpc_loc_ni_event_payload_u_type_u.vx_req)) - return FALSE; - break; - case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - if (!xdr_rpc_loc_ni_supl_notify_verify_req_s_type (xdrs, &objp->rpc_loc_ni_event_payload_u_type_u.supl_req)) - return FALSE; - break; - case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - if (!xdr_rpc_loc_ni_umts_cp_notify_verify_req_s_type (xdrs, &objp->rpc_loc_ni_event_payload_u_type_u.umts_cp_req)) - return FALSE; - break; - case RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ: - if (!xdr_rpc_loc_ni_vx_service_interaction_req_s_type (xdrs, &objp->rpc_loc_ni_event_payload_u_type_u.service_interaction_req)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_event_s_type (XDR *xdrs, rpc_loc_ni_event_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_ni_event_e_type (xdrs, &objp->event)) - return FALSE; - if (!xdr_rpc_loc_ni_event_payload_u_type (xdrs, &objp->payload)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_assist_data_request_e_type (XDR *xdrs, rpc_loc_assist_data_request_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_struct_loc_time_download_source_s_type_servers_ptr (XDR *xdrs, rpc_struct_loc_time_download_source_s_type_servers_ptr *objp) -{ - register int32_t *buf; - - if (!xdr_string (xdrs, objp, 256)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_struct_loc_time_download_source_s_type_servers (XDR *xdrs, rpc_struct_loc_time_download_source_s_type_servers objp) -{ - register int32_t *buf; - - if (!xdr_vector (xdrs, (char *)objp, 3, - sizeof (rpc_struct_loc_time_download_source_s_type_servers_ptr), (xdrproc_t) xdr_rpc_struct_loc_time_download_source_s_type_servers_ptr)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_time_download_source_s_type (XDR *xdrs, rpc_loc_time_download_source_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, &objp->delay_threshold)) - return FALSE; - if (!xdr_rpc_struct_loc_time_download_source_s_type_servers (xdrs, objp->servers)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr (XDR *xdrs, rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr *objp) -{ - register int32_t *buf; - - if (!xdr_string (xdrs, objp, 256)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_struct_loc_predicted_orbits_data_source_s_type_servers (XDR *xdrs, rpc_struct_loc_predicted_orbits_data_source_s_type_servers objp) -{ - register int32_t *buf; - - if (!xdr_vector (xdrs, (char *)objp, 3, - sizeof (rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr), (xdrproc_t) xdr_rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_predicted_orbits_data_source_s_type (XDR *xdrs, rpc_loc_predicted_orbits_data_source_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, &objp->max_file_size)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->max_part_size)) - return FALSE; - if (!xdr_rpc_struct_loc_predicted_orbits_data_source_s_type_servers (xdrs, objp->servers)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_pos_inj_request_s_type (XDR *xdrs, rpc_loc_pos_inj_request_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, &objp->flags)) - return FALSE; - if (!xdr_double (xdrs, &objp->latitude)) - return FALSE; - if (!xdr_double (xdrs, &objp->longitude)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->position_uncertainty)) - return FALSE; - if (!xdr_rpc_uint64 (xdrs, &objp->timestamp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_assist_data_request_payload_u_type (XDR *xdrs, rpc_loc_assist_data_request_payload_u_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_assist_data_request_e_type (xdrs, &objp->disc)) - return FALSE; - switch (objp->disc) { - case RPC_LOC_ASSIST_DATA_TIME_REQ: - if (!xdr_rpc_loc_time_download_source_s_type (xdrs, &objp->rpc_loc_assist_data_request_payload_u_type_u.time_download)) - return FALSE; - break; - case RPC_LOC_ASSIST_DATA_PREDICTED_ORBITS_REQ: - if (!xdr_rpc_loc_predicted_orbits_data_source_s_type (xdrs, &objp->rpc_loc_assist_data_request_payload_u_type_u.data_download)) - return FALSE; - break; - case RPC_LOC_ASSIST_DATA_POSITION_INJECTION_REQ: - if (!xdr_rpc_loc_pos_inj_request_s_type (xdrs, &objp->rpc_loc_assist_data_request_payload_u_type_u.pos_injection)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_rpc_loc_assist_data_request_s_type (XDR *xdrs, rpc_loc_assist_data_request_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_assist_data_request_e_type (xdrs, &objp->event)) - return FALSE; - if (!xdr_rpc_loc_assist_data_request_payload_u_type (xdrs, &objp->payload)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_connection_handle (XDR *xdrs, rpc_loc_server_connection_handle *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_protocol_e_type (XDR *xdrs, rpc_loc_server_protocol_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_connection_e_type (XDR *xdrs, rpc_loc_server_connection_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_request_e_type (XDR *xdrs, rpc_loc_server_request_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_open_req_s_type (XDR *xdrs, rpc_loc_server_open_req_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_server_connection_handle (xdrs, &objp->conn_handle)) - return FALSE; - if (!xdr_rpc_loc_server_protocol_e_type (xdrs, &objp->protocol)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_multi_open_req_s_type (XDR *xdrs, rpc_loc_server_multi_open_req_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_server_connection_handle (xdrs, &objp->conn_handle)) - return FALSE; - if (!xdr_rpc_loc_server_protocol_e_type (xdrs, &objp->protocol)) - return FALSE; - if (!xdr_rpc_loc_server_connection_e_type (xdrs, &objp->connection_type)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_close_req_s_type (XDR *xdrs, rpc_loc_server_close_req_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_server_connection_handle (xdrs, &objp->conn_handle)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_request_u_type (XDR *xdrs, rpc_loc_server_request_u_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_server_request_e_type (xdrs, &objp->disc)) - return FALSE; - switch (objp->disc) { - case RPC_LOC_SERVER_REQUEST_OPEN: - if (!xdr_rpc_loc_server_open_req_s_type (xdrs, &objp->rpc_loc_server_request_u_type_u.open_req)) - return FALSE; - break; - case RPC_LOC_SERVER_REQUEST_CLOSE: - if (!xdr_rpc_loc_server_close_req_s_type (xdrs, &objp->rpc_loc_server_request_u_type_u.close_req)) - return FALSE; - break; - case RPC_LOC_SERVER_REQUEST_MULTI_OPEN: - if (!xdr_rpc_loc_server_multi_open_req_s_type (xdrs, &objp->rpc_loc_server_request_u_type_u.multi_open_req)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_rpc_loc_server_request_s_type (XDR *xdrs, rpc_loc_server_request_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_server_request_e_type (xdrs, &objp->event)) - return FALSE; - if (!xdr_rpc_loc_server_request_u_type (xdrs, &objp->payload)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_qwip_request_e_type (XDR *xdrs, rpc_loc_qwip_request_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_qwip_request_s_type (XDR *xdrs, rpc_loc_qwip_request_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_qwip_request_e_type (xdrs, &objp->request_type)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->tbf_ms)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_reserved_payload_s_type (XDR *xdrs, rpc_loc_reserved_payload_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint16 (xdrs, &objp->data_size)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ioctl_e_type (XDR *xdrs, rpc_loc_ioctl_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_api_version_s_type (XDR *xdrs, rpc_loc_api_version_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_u_char (xdrs, &objp->major)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->minor)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_fix_recurrence_e_type (XDR *xdrs, rpc_loc_fix_recurrence_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_operation_mode_e_type (XDR *xdrs, rpc_loc_operation_mode_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_notify_e_type (XDR *xdrs, rpc_loc_notify_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_fix_criteria_s_type (XDR *xdrs, rpc_loc_fix_criteria_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, &objp->valid_mask)) - return FALSE; - if (!xdr_rpc_loc_fix_recurrence_e_type (xdrs, &objp->recurrence_type)) - return FALSE; - if (!xdr_rpc_loc_operation_mode_e_type (xdrs, &objp->preferred_operation_mode)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->preferred_accuracy)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->preferred_response_time)) - return FALSE; - if (!xdr_rpc_boolean (xdrs, &objp->intermediate_pos_report_enabled)) - return FALSE; - if (!xdr_rpc_loc_notify_e_type (xdrs, &objp->notify_type)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->min_interval)) - return FALSE; - if (!xdr_float (xdrs, &objp->min_distance)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->min_dist_sample_interval)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ni_user_resp_e_type (XDR *xdrs, rpc_loc_ni_user_resp_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_user_verify_s_type (XDR *xdrs, rpc_loc_user_verify_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_ni_user_resp_e_type (xdrs, &objp->user_resp)) - return FALSE; - if (!xdr_rpc_loc_ni_event_s_type (xdrs, &objp->ni_event_pass_back)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_predicted_orbits_data_format_e_type (XDR *xdrs, rpc_loc_predicted_orbits_data_format_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_predicted_orbits_data_s_type (XDR *xdrs, rpc_loc_predicted_orbits_data_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_predicted_orbits_data_format_e_type (xdrs, &objp->format_type)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->total_size)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->total_parts)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->part)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->part_len)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->data_ptr.data_ptr_val, (u_int *) &objp->data_ptr.data_ptr_len, ~0)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_predicted_orbits_data_validity_report_s_type (XDR *xdrs, rpc_loc_predicted_orbits_data_validity_report_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint64 (xdrs, &objp->start_time_utc)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->valid_duration_hrs)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_predicted_orbits_auto_download_config_s_type (XDR *xdrs, rpc_loc_predicted_orbits_auto_download_config_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_boolean (xdrs, &objp->enable)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->auto_check_every_hrs)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_assist_data_time_s_type (XDR *xdrs, rpc_loc_assist_data_time_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint64 (xdrs, &objp->time_utc)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->uncertainty)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_assist_pos_valid_mask_type (XDR *xdrs, rpc_loc_assist_pos_valid_mask_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint64 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_assist_data_pos_s_type (XDR *xdrs, rpc_loc_assist_data_pos_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_assist_pos_valid_mask_type (xdrs, &objp->valid_mask)) - return FALSE; - if (!xdr_rpc_uint64 (xdrs, &objp->timestamp_utc)) - return FALSE; - if (!xdr_double (xdrs, &objp->latitude)) - return FALSE; - if (!xdr_double (xdrs, &objp->longitude)) - return FALSE; - if (!xdr_float (xdrs, &objp->altitude_wrt_ellipsoid)) - return FALSE; - if (!xdr_float (xdrs, &objp->altitude_wrt_mean_sea_level)) - return FALSE; - if (!xdr_float (xdrs, &objp->hor_unc_circular)) - return FALSE; - if (!xdr_float (xdrs, &objp->vert_unc)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->confidence_horizontal)) - return FALSE; - if (!xdr_u_char (xdrs, &objp->confidence_vertical)) - return FALSE; - if (!xdr_rpc_int32 (xdrs, &objp->timestamp_age)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_open_status_e_type (XDR *xdrs, rpc_loc_server_open_status_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_pdp_type_e_type (XDR *xdrs, rpc_loc_server_pdp_type_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_open_status_s_type (XDR *xdrs, rpc_loc_server_open_status_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_loc_server_connection_handle (xdrs, &objp->conn_handle)) - return FALSE; - if (!xdr_rpc_loc_server_open_status_e_type (xdrs, &objp->open_status)) - return FALSE; - if (!xdr_opaque (xdrs, objp->apn_name, 100)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_multi_open_status_s_type (XDR *xdrs, rpc_loc_server_multi_open_status_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_loc_server_connection_handle (xdrs, &objp->conn_handle)) - return FALSE; - if (!xdr_rpc_loc_server_open_status_e_type (xdrs, &objp->open_status)) - return FALSE; - if (!xdr_rpc_loc_server_pdp_type_e_type (xdrs, &objp->pdp_type)) - return FALSE; - if (!xdr_opaque (xdrs, objp->apn_name, 100)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_close_status_e_type (XDR *xdrs, rpc_loc_server_close_status_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_server_close_status_s_type (XDR *xdrs, rpc_loc_server_close_status_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_server_connection_handle (xdrs, &objp->conn_handle)) - return FALSE; - if (!xdr_rpc_loc_server_close_status_e_type (xdrs, &objp->close_status)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_wiper_fix_time_s_type (XDR *xdrs, rpc_loc_wiper_fix_time_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, &objp->slow_clock_count)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_wiper_fix_pos_s_type (XDR *xdrs, rpc_loc_wiper_fix_pos_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_int32 (xdrs, &objp->lat)) - return FALSE; - if (!xdr_rpc_int32 (xdrs, &objp->lon)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->HEPE)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->num_of_aps_used)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->fix_error_code)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_wiper_ap_info_s_type (XDR *xdrs, rpc_loc_wiper_ap_info_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_opaque (xdrs, objp->mac_addr, 6)) - return FALSE; - if (!xdr_rpc_int32 (xdrs, &objp->rssi)) - return FALSE; - if (!xdr_rpc_uint16 (xdrs, &objp->channel)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->ap_qualifier)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_wiper_ap_set_s_type (XDR *xdrs, rpc_loc_wiper_ap_set_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_uint8 (xdrs, &objp->num_of_aps)) - return FALSE; - if (!xdr_vector (xdrs, (char *)objp->ap_info, 50, - sizeof (rpc_loc_wiper_ap_info_s_type), (xdrproc_t) xdr_rpc_loc_wiper_ap_info_s_type)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_wiper_position_report_s_type (XDR *xdrs, rpc_loc_wiper_position_report_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint8 (xdrs, &objp->wiper_valid_info_flag)) - return FALSE; - if (!xdr_rpc_loc_wiper_fix_time_s_type (xdrs, &objp->wiper_fix_time)) - return FALSE; - if (!xdr_rpc_loc_wiper_fix_pos_s_type (xdrs, &objp->wiper_fix_position)) - return FALSE; - if (!xdr_rpc_loc_wiper_ap_set_s_type (xdrs, &objp->wiper_ap_set)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_wiper_status_e_type (XDR *xdrs, rpc_loc_wiper_status_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_fs_operation_e_type (XDR *xdrs, rpc_loc_fs_operation_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_efs_data_s_type (XDR *xdrs, rpc_loc_efs_data_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_opaque (xdrs, objp->filename, 64)) - return FALSE; - if (!xdr_rpc_loc_fs_operation_e_type (xdrs, &objp->operation)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->total_size)) - return FALSE; - if (!xdr_bytes (xdrs, (char **)&objp->data_ptr.data_ptr_val, (u_int *) &objp->data_ptr.data_ptr_len, ~0)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->part_len)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->part)) - return FALSE; - if (!xdr_rpc_uint8 (xdrs, &objp->total_parts)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->reserved)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_error_estimate_config_e_type (XDR *xdrs, rpc_loc_error_estimate_config_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_apn_profiles_type (XDR *xdrs, rpc_loc_apn_profiles_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_uint32 (xdrs, &objp->srv_system_type)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->pdp_type)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->reserved)) - return FALSE; - if (!xdr_opaque (xdrs, objp->apn_name, 100)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_lock_e_type (XDR *xdrs, rpc_loc_lock_e_type *objp) -{ - register int32_t *buf; - - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_nmea_sentence_type (XDR *xdrs, rpc_loc_nmea_sentence_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_assist_data_type (XDR *xdrs, rpc_loc_assist_data_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_assist_data_delete_s_type (XDR *xdrs, rpc_loc_assist_data_delete_s_type *objp) -{ - register int32_t *buf; - - int i; - if (!xdr_rpc_loc_assist_data_type (xdrs, &objp->type)) - return FALSE; - if (!xdr_vector (xdrs, (char *)objp->reserved, 8, - sizeof (rpc_uint32), (xdrproc_t) xdr_rpc_uint32)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ioctl_data_u_type (XDR *xdrs, rpc_loc_ioctl_data_u_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_ioctl_e_type (xdrs, &objp->disc)) - return FALSE; - switch (objp->disc) { - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - if (!xdr_rpc_loc_fix_criteria_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.fix_criteria)) - return FALSE; - break; - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - if (!xdr_rpc_loc_user_verify_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.user_verify_resp)) - return FALSE; - break; - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - if (!xdr_rpc_loc_predicted_orbits_data_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.predicted_orbits_data)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - if (!xdr_rpc_loc_predicted_orbits_auto_download_config_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.predicted_orbits_auto_download)) - return FALSE; - break; - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - if (!xdr_rpc_loc_assist_data_time_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.assistance_data_time)) - return FALSE; - break; - case RPC_LOC_IOCTL_INJECT_POSITION: - if (!xdr_rpc_loc_assist_data_pos_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.assistance_data_position)) - return FALSE; - break; - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - if (!xdr_rpc_loc_server_open_status_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.conn_open_status)) - return FALSE; - break; - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - if (!xdr_rpc_loc_server_close_status_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.conn_close_status)) - return FALSE; - break; - case RPC_LOC_IOCTL_SEND_WIPER_POSITION_REPORT: - if (!xdr_rpc_loc_wiper_position_report_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.wiper_pos)) - return FALSE; - break; - case RPC_LOC_IOCTL_NOTIFY_WIPER_STATUS: - if (!xdr_rpc_loc_wiper_status_e_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.wiper_status)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - if (!xdr_rpc_loc_lock_e_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.engine_lock)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - if (!xdr_rpc_boolean (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.sbas_mode)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - if (!xdr_rpc_loc_nmea_sentence_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.nmea_types)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - if (!xdr_rpc_boolean (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.on_demand_lpm)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_CDMA_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_CDMA_MPC_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - if (!xdr_rpc_loc_server_info_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.server_addr)) - return FALSE; - break; - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - if (!xdr_rpc_loc_assist_data_delete_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.assist_data_delete)) - return FALSE; - break; - case RPC_LOC_IOCTL_ACCESS_EFS_DATA: - if (!xdr_rpc_loc_efs_data_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.efs_data)) - return FALSE; - break; - case RPC_LOC_IOCTL_ERROR_ESTIMATE_CONFIG: - if (!xdr_rpc_loc_error_estimate_config_e_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.error_estimate_config)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_XTRA_T_SESSION_CONTROL: - if (!xdr_rpc_uint8 (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.xtra_t_session_control)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_LBS_APN_PROFILE: - case RPC_LOC_IOCTL_SET_XTRA_APN_PROFILE: - if (!xdr_vector (xdrs, (char *)objp->rpc_loc_ioctl_data_u_type_u.apn_profiles, 6, - sizeof (rpc_loc_apn_profiles_type), (xdrproc_t) xdr_rpc_loc_apn_profiles_type)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_DATA_ENABLE: - if (!xdr_rpc_boolean (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.data_enable)) - return FALSE; - break; - case RPC_LOC_IOCTL_SET_SUPL_VERSION: - if (!xdr_rpc_uint32 (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.supl_version)) - return FALSE; - break; - case RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS: - if (!xdr_rpc_loc_server_multi_open_status_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.multi_conn_open_status)) - return FALSE; - break; - case RPC_LOC_IOCTL_RESERVED_CMD: - if (!xdr_rpc_loc_reserved_payload_s_type (xdrs, &objp->rpc_loc_ioctl_data_u_type_u.reserved)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_rpc_loc_ioctl_callback_data_u_type (XDR *xdrs, rpc_loc_ioctl_callback_data_u_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_ioctl_e_type (xdrs, &objp->disc)) - return FALSE; - switch (objp->disc) { - case RPC_LOC_IOCTL_GET_API_VERSION: - if (!xdr_rpc_loc_api_version_s_type (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.api_version)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - if (!xdr_rpc_loc_fix_criteria_s_type (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.fix_criteria)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - if (!xdr_rpc_loc_lock_e_type (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.engine_lock)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - if (!xdr_rpc_boolean (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.sbas_mode)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_NMEA_TYPES: - if (!xdr_rpc_loc_nmea_sentence_type (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.nmea_types)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - if (!xdr_rpc_boolean (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.on_demand_lpm)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_CDMA_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CDMA_MPC_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_UMTS_SLP_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - if (!xdr_rpc_loc_server_info_s_type (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.server_addr)) - return FALSE; - break; - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - if (!xdr_rpc_loc_predicted_orbits_data_source_s_type (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.predicted_orbits_data_source)) - return FALSE; - break; - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - if (!xdr_rpc_loc_predicted_orbits_data_validity_report_s_type (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.predicted_orbits_data_validity)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_XTRA_T_SESSION_CONTROL: - if (!xdr_rpc_uint8 (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.xtra_t_session_control)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_LBS_APN_PROFILE: - case RPC_LOC_IOCTL_GET_XTRA_APN_PROFILE: - if (!xdr_vector (xdrs, (char *)objp->rpc_loc_ioctl_callback_data_u_type_u.apn_profiles, 6, - sizeof (rpc_loc_apn_profiles_type), (xdrproc_t) xdr_rpc_loc_apn_profiles_type)) - return FALSE; - break; - case RPC_LOC_IOCTL_GET_SUPL_VERSION: - if (!xdr_rpc_uint32 (xdrs, &objp->rpc_loc_ioctl_callback_data_u_type_u.supl_version)) - return FALSE; - break; - default: - break; - } - return TRUE; -} - -bool_t -xdr_rpc_loc_ioctl_callback_s_type (XDR *xdrs, rpc_loc_ioctl_callback_s_type *objp) -{ - register int32_t *buf; - - if (!xdr_rpc_loc_ioctl_e_type (xdrs, &objp->type)) - return FALSE; - if (!xdr_rpc_int32 (xdrs, &objp->status)) - return FALSE; - if (!xdr_rpc_loc_ioctl_callback_data_u_type (xdrs, &objp->data)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_event_payload_u_type (XDR *xdrs, rpc_loc_event_payload_u_type *objp) -{ - register int32_t *buf; - - if (!xdr_u_quad_t (xdrs, &objp->disc)) - return FALSE; - switch (objp->disc) { - case RPC_LOC_EVENT_PARSED_POSITION_REPORT: - if (!xdr_rpc_loc_parsed_position_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.parsed_location_report)) - return FALSE; - break; - case RPC_LOC_EVENT_SATELLITE_REPORT: - if (!xdr_rpc_loc_gnss_info_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.gnss_report)) - return FALSE; - break; - case RPC_LOC_EVENT_NMEA_POSITION_REPORT: - case RPC_LOC_EVENT_NMEA_1HZ_REPORT: - if (!xdr_rpc_loc_nmea_report_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.nmea_report)) - return FALSE; - break; - case RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST: - if (!xdr_rpc_loc_ni_event_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.ni_request)) - return FALSE; - break; - case RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST: - if (!xdr_rpc_loc_assist_data_request_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.assist_data_request)) - return FALSE; - break; - case RPC_LOC_EVENT_LOCATION_SERVER_REQUEST: - if (!xdr_rpc_loc_server_request_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.loc_server_request)) - return FALSE; - break; - case RPC_LOC_EVENT_IOCTL_REPORT: - if (!xdr_rpc_loc_ioctl_callback_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.ioctl_report)) - return FALSE; - break; - case RPC_LOC_EVENT_STATUS_REPORT: - if (!xdr_rpc_loc_status_event_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.status_report)) - return FALSE; - break; - case RPC_LOC_EVENT_WPS_NEEDED_REQUEST: - if (!xdr_rpc_loc_qwip_request_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.qwip_request)) - return FALSE; - break; - case RPC_LOC_EVENT_RESERVED: - if (!xdr_rpc_loc_reserved_payload_s_type (xdrs, &objp->rpc_loc_event_payload_u_type_u.reserved)) - return FALSE; - break; - default: - break; - } - return TRUE; -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c deleted file mode 100644 index a0fdcab..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_api_rpcgen_xdr.c +++ /dev/null @@ -1,199 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include "loc_api_rpcgen_rpc.h" - -bool_t -xdr_rpc_loc_api_api_versions_return_type (XDR *xdrs, rpc_loc_api_api_versions_return_type *objp) -{ -; - - if (!xdr_array (xdrs, (char **)&objp->rpc_loc_api_api_versions_return_type_val, (u_int *) &objp->rpc_loc_api_api_versions_return_type_len, ~0, - sizeof (rpc_uint32), (xdrproc_t) xdr_rpc_uint32)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_event_cb_f_type (XDR *xdrs, rpc_loc_event_cb_f_type *objp) -{ -; - - if (!xdr_rpc_uint32 (xdrs, objp)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_args (XDR *xdrs, rpc_loc_open_args *objp) -{ -; - - if (!xdr_rpc_loc_event_mask_type (xdrs, &objp->event_reg_mask)) - return FALSE; - if (!xdr_rpc_loc_event_cb_f_type (xdrs, &objp->event_callback)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_close_args (XDR *xdrs, rpc_loc_close_args *objp) -{ -; - - if (!xdr_rpc_loc_client_handle_type (xdrs, &objp->handle)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_start_fix_args (XDR *xdrs, rpc_loc_start_fix_args *objp) -{ -; - - if (!xdr_rpc_loc_client_handle_type (xdrs, &objp->handle)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_stop_fix_args (XDR *xdrs, rpc_loc_stop_fix_args *objp) -{ -; - - if (!xdr_rpc_loc_client_handle_type (xdrs, &objp->handle)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ioctl_args (XDR *xdrs, rpc_loc_ioctl_args *objp) -{ -; - - if (!xdr_rpc_loc_client_handle_type (xdrs, &objp->handle)) - return FALSE; - if (!xdr_rpc_loc_ioctl_e_type (xdrs, &objp->ioctl_type)) - return FALSE; - if (!xdr_pointer (xdrs, (char **)&objp->ioctl_data, sizeof (rpc_loc_ioctl_data_u_type), (xdrproc_t) xdr_rpc_loc_ioctl_data_u_type)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_api_api_version_s_args (XDR *xdrs, rpc_loc_api_api_version_s_args *objp) -{ -; - - if (!xdr_rpc_boolean (xdrs, &objp->len_not_null)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_api_rpc_glue_code_info_remote_rets (XDR *xdrs, rpc_loc_api_rpc_glue_code_info_remote_rets *objp) -{ -; - - if (!xdr_rpc_uint32 (xdrs, &objp->toolvers)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->features)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->proghash)) - return FALSE; - if (!xdr_rpc_uint32 (xdrs, &objp->cbproghash)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_open_rets (XDR *xdrs, rpc_loc_open_rets *objp) -{ -; - - if (!xdr_rpc_loc_client_handle_type (xdrs, &objp->loc_open_result)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_close_rets (XDR *xdrs, rpc_loc_close_rets *objp) -{ -; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_close_result)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_start_fix_rets (XDR *xdrs, rpc_loc_start_fix_rets *objp) -{ -; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_start_fix_result)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_stop_fix_rets (XDR *xdrs, rpc_loc_stop_fix_rets *objp) -{ -; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_stop_fix_result)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_ioctl_rets (XDR *xdrs, rpc_loc_ioctl_rets *objp) -{ -; - - if (!xdr_rpc_int32 (xdrs, &objp->loc_ioctl_result)) - return FALSE; - return TRUE; -} - -bool_t -xdr_rpc_loc_api_api_versions_rets (XDR *xdrs, rpc_loc_api_api_versions_rets *objp) -{ -; - - if (!xdr_rpc_loc_api_api_versions_return_type (xdrs, &objp->loc_api_api_versions_result)) - return FALSE; - if (!xdr_pointer (xdrs, (char **)&objp->len, sizeof (rpc_uint32), (xdrproc_t) xdr_rpc_uint32)) - return FALSE; - return TRUE; -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c deleted file mode 100644 index b469eb0..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/src/loc_apicb_appinit.c +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "librpc.h" -#include "loc_api_rpcgen_rpc.h" -#include "loc_api_rpcgen_cb_rpc.h" - - -#define RPC_FUNC_VERSION_BASE(a,b) a ## b -#define RPC_CB_FUNC_VERS(a,b) RPC_FUNC_VERSION_BASE(a,b) - - -static SVCXPRT* svrPort = NULL; - -extern void RPC_CB_FUNC_VERS(loc_apicbprog_,LOC_APICBVERS_0001)(struct svc_req *rqstp, register SVCXPRT *transp); - -int loc_apicb_app_init(void) -{ - - /* Register a callback server to use the loc_apicbprog_0x00010001 */ - if (svrPort == NULL) { - svrPort = svcrtr_create(); - } - if (!svrPort) return -1; - - xprt_register(svrPort); - - - - if(svc_register(svrPort, LOC_APICBPROG,LOC_APICBVERS_0001, RPC_CB_FUNC_VERS(loc_apicbprog_,LOC_APICBVERS_0001),0)) - { - return 0; - } - else - { - return -1; - } -} -void loc_apicb_app_deinit(void) -{ - - if (svrPort == NULL) - { - return; - } - - - svc_unregister(svrPort, LOC_APICBPROG,LOC_APICBVERS_0001); -} diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr deleted file mode 100644 index 82dca56..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api.xdr +++ /dev/null @@ -1,261 +0,0 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* LOC_API TOOL VERSION: 4.48 */ -/* GENERATED: TUE JUN 14 2011 */ -/*============================================================================= - L O C _ A P I . X D R - -GENERAL DESCRIPTION - This is an AUTO GENERATED file that provides an xdr compatible definition of - the loc_api API. - - --------------------------------------------------------------------------- - - - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/htorpc.pl#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Start.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/XDR.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Output.pm#5 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Parser.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Metacomments.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/SymbolTable.pm#1 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#24 -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - -typedef rpc_uint32 rpc_loc_api_api_versions_return_type<>; - -/* - * Declare an rpc_uint32 type for each callback type in the API - */ -typedef rpc_uint32 rpc_loc_event_cb_f_type; - - - -/* - * These are struct declarations for the function arguments - */ - -struct rpc_loc_open_args { - rpc_loc_event_mask_type event_reg_mask; - rpc_loc_event_cb_f_type event_callback; -}; - -struct rpc_loc_close_args { - rpc_loc_client_handle_type handle; -}; - -struct rpc_loc_start_fix_args { - rpc_loc_client_handle_type handle; -}; - -struct rpc_loc_stop_fix_args { - rpc_loc_client_handle_type handle; -}; - -struct rpc_loc_ioctl_args { - rpc_loc_client_handle_type handle; - rpc_loc_ioctl_e_type ioctl_type; - rpc_loc_ioctl_data_u_type *ioctl_data; -}; - - - -struct rpc_loc_api_api_version_s_args { - rpc_boolean len_not_null; -}; - -/* - * These are struct declarations for the function results - */ - -struct rpc_loc_api_rpc_glue_code_info_remote_rets { - rpc_uint32 toolvers; /* Tool version */ - rpc_uint32 features; /* Features turned on in the code. - * 0x00000001 ONCRPC Server Cleanup Support - */ - rpc_uint32 proghash; /* Unique hash value for the API XDR definition */ - rpc_uint32 cbproghash; /* Unique hash value for the Callbacks' XDR definition */ -}; - -struct rpc_loc_open_rets { - rpc_loc_client_handle_type loc_open_result; -}; - -struct rpc_loc_close_rets { - rpc_int32 loc_close_result; -}; - -struct rpc_loc_start_fix_rets { - rpc_int32 loc_start_fix_result; -}; - -struct rpc_loc_stop_fix_rets { - rpc_int32 loc_stop_fix_result; -}; - -struct rpc_loc_ioctl_rets { - rpc_int32 loc_ioctl_result; -}; - - struct rpc_loc_api_api_versions_rets { - rpc_loc_api_api_versions_return_type loc_api_api_versions_result; - rpc_uint32 *len; -}; - -/* - * XDR definition of the LOC_API program ( vers. 0x00050006 ) - */ - -program LOC_APIPROG { - version LOC_APIVERS_0001 { - - void - rpc_loc_api_null( void ) = 0; - - rpc_loc_api_rpc_glue_code_info_remote_rets - rpc_loc_api_rpc_glue_code_info_remote( void ) = 1; - - rpc_loc_open_rets - rpc_loc_open( rpc_loc_open_args ) = 2; - - rpc_loc_close_rets - rpc_loc_close( rpc_loc_close_args ) = 3; - - rpc_loc_start_fix_rets - rpc_loc_start_fix( rpc_loc_start_fix_args ) = 4; - - rpc_loc_stop_fix_rets - rpc_loc_stop_fix( rpc_loc_stop_fix_args ) = 5; - - rpc_loc_ioctl_rets - rpc_loc_ioctl( rpc_loc_ioctl_args ) = 6; - - rpc_loc_api_api_versions_rets - rpc_loc_api_api_versions( void ) = 0xFFFFFFFF; - - - - - } = 0x00050001; - -version LOC_APIVERS_0002 { - -/* Following elements added in enum rpc_loc_assist_data_request_e_type in 0x00050002 -RPC_LOC_ASSIST_DATA_POSITION_INJECTION_REQ -*/ -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050002 -RPC_LOC_IOCTL_GET_XTRA_T_SESSION_CONTROL -RPC_LOC_IOCTL_RESERVED_CMD -RPC_LOC_IOCTL_SET_XTRA_T_SESSION_CONTROL -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00050002; - -version LOC_APIVERS_0003 { - -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050003 -RPC_LOC_IOCTL_SET_DATA_ENABLE -RPC_LOC_IOCTL_SET_LBS_APN_PROFILE -RPC_LOC_IOCTL_GET_XTRA_APN_PROFILE -RPC_LOC_IOCTL_GET_LBS_APN_PROFILE -RPC_LOC_IOCTL_SET_XTRA_APN_PROFILE -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00050003; - -version LOC_APIVERS_0004 { - -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050004 -RPC_LOC_IOCTL_GET_SUPL_VERSION -RPC_LOC_IOCTL_SET_SUPL_VERSION -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00050004; - -version LOC_APIVERS_0005 { - -/* Following elements added in enum rpc_loc_server_addr_e_type in 0x00050005 -RPC_LOC_SERVER_ADDR_IPV6 -*/ -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050005 -RPC_LOC_IOCTL_ERROR_ESTIMATE_CONFIG -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00050005; - - - - version LOC_APIVERS_0006 { - -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050006 -RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS -*/ -/* Following elements added in enum rpc_loc_server_request_e_type in 0x00050006 -RPC_LOC_SERVER_REQUEST_MULTI_OPEN -*/ - - void - rpc_loc_api_null( void ) = 0; - - } = 0x00050006; - - -} = 0x3000008C; - -const LOC_APIVERS = 0x00050006; diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr deleted file mode 100644 index 4756c6c..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_cb.xdr +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* LOC_API TOOL VERSION: 4.48 */ -/* GENERATED: TUE JUN 14 2011 */ -/*============================================================================= - L O C _ A P I _ C B . X D R - -GENERAL DESCRIPTION - This is an AUTO GENERATED file that provides an xdr compatible definition of - an api that represents the grouping of the different callback functions the - loc_api API supports. - - --------------------------------------------------------------------------- - - - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/htorpc.pl#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Start.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/XDR.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Output.pm#5 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Parser.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Metacomments.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/SymbolTable.pm#1 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#24 -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - - -/* - * These are struct declarations for the function arguments - */ - -struct rpc_loc_event_cb_f_type_args { - rpc_uint32 cb_id; - rpc_loc_client_handle_type loc_handle; - rpc_loc_event_mask_type loc_event; - rpc_loc_event_payload_u_type *loc_event_payload; -}; - - - - - -/* - * These are struct declaratios for the function results - */ - -struct rpc_loc_event_cb_f_type_rets { - rpc_int32 loc_event_cb_f_type_result; -}; - - - -/* - * XDR definition of the LOC_API callback program ( vers. 0x00050006 ) - */ - -program LOC_APICBPROG { - version LOC_APICBVERS_0001 { - - rpc_loc_event_cb_f_type_rets - rpc_loc_event_cb_f_type( rpc_loc_event_cb_f_type_args ) = 1; - - - - - } = 0x00050001; - -version LOC_APICBVERS_0002 { - -/* Following elements added in enum rpc_loc_assist_data_request_e_type in 0x00050002 -RPC_LOC_ASSIST_DATA_POSITION_INJECTION_REQ -*/ -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050002 -RPC_LOC_IOCTL_GET_XTRA_T_SESSION_CONTROL -RPC_LOC_IOCTL_RESERVED_CMD -RPC_LOC_IOCTL_SET_XTRA_T_SESSION_CONTROL -*/ - - int - rpc_loc_api_cb_null( void ) = 0xffffff00; - - } = 0x00050002; - -version LOC_APICBVERS_0003 { - -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050003 -RPC_LOC_IOCTL_SET_DATA_ENABLE -RPC_LOC_IOCTL_SET_LBS_APN_PROFILE -RPC_LOC_IOCTL_GET_XTRA_APN_PROFILE -RPC_LOC_IOCTL_GET_LBS_APN_PROFILE -RPC_LOC_IOCTL_SET_XTRA_APN_PROFILE -*/ - - int - rpc_loc_api_cb_null( void ) = 0xffffff00; - - } = 0x00050003; - -version LOC_APICBVERS_0004 { - -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050004 -RPC_LOC_IOCTL_GET_SUPL_VERSION -RPC_LOC_IOCTL_SET_SUPL_VERSION -*/ - - int - rpc_loc_api_cb_null( void ) = 0xffffff00; - - } = 0x00050004; - -version LOC_APICBVERS_0005 { - -/* Following elements added in enum rpc_loc_server_addr_e_type in 0x00050005 -RPC_LOC_SERVER_ADDR_IPV6 -*/ -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050005 -RPC_LOC_IOCTL_ERROR_ESTIMATE_CONFIG -*/ - - int - rpc_loc_api_cb_null( void ) = 0xffffff00; - - } = 0x00050005; - - - - version LOC_APICBVERS_0006 { - -/* Following elements added in enum rpc_loc_ioctl_e_type in 0x00050006 -RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS -*/ -/* Following elements added in enum rpc_loc_server_request_e_type in 0x00050006 -RPC_LOC_SERVER_REQUEST_MULTI_OPEN -*/ - - int - rpc_loc_api_cb_null( void ) = 0xffffff00; - - } = 0x00050006; - - -} = 0x3100008C; - -const LOC_APICBVERS = 0x00050006; diff --git a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr b/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr deleted file mode 100644 index e059c66..0000000 --- a/gps/loc_api/libloc_api-rpc-50001/libloc_api-rpc-stub/xdr/loc_api_common.xdr +++ /dev/null @@ -1,1021 +0,0 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* LOC_API TOOL VERSION: 4.48 */ -/* GENERATED: TUE JUN 14 2011 */ -/*============================================================================= - L O C _ A P I _ C O M M O N . X D R - -GENERAL DESCRIPTION - This is an AUTO GENERATED file that provides an xdr compatible definition of - an api that represents the grouping of the different callback functions the - loc_api API supports. - - --------------------------------------------------------------------------- - - - --------------------------------------------------------------------------- -=============================================================================*/ - -/*============================================================================= - - Edit History - - AUTO GENERATED - -Generated by following versions of Htorpc modules: -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/htorpc.pl#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Start.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Htoxdr.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/XDR.pm#3 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Output.pm#5 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Parser.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/Metacomments.pm#1 -Id: //source/qcom/qct/core/mproc/tools/rel/2h09/htorpc/lib/Htorpc/SymbolTable.pm#1 - -loc_api Definition File(s): -Id: //source/qcom/qct/modem/api/gps/main/latest/loc_api.h#24 -=============================================================================*/ -/*============================================================================= -$Header$ -=============================================================================*/ - - - -const LOC_API_TOOLVERS = 0x00040030; -const LOC_API_FEATURES = 0x00000001; - -const RPC_LOC_EVENT_STATUS_REPORT = 0x00000100; - -const RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST = 0x00000020; - -const RPC_LOC_EVENT_WPS_NEEDED_REQUEST = 0x00000200; - -const RPC_LOC_EVENT_SATELLITE_REPORT = 0x00000002; - -const RPC_LOC_EVENT_PARSED_POSITION_REPORT = 0x00000001; - -const RPC_LOC_EVENT_RESERVED = 0x8000000000000000; - -const RPC_LOC_EVENT_LOCATION_SERVER_REQUEST = 0x00000040; - -const RPC_LOC_EVENT_NMEA_POSITION_REPORT = 0x00000008; - -const RPC_LOC_EVENT_IOCTL_REPORT = 0x00000080; - -const RPC_LOC_EVENT_NMEA_1HZ_REPORT = 0x00000004; - -const RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST = 0x00000010; - -const RPC_LOC_API_CB_NULL_VERSION = 0x00050002; -const RPC_LOC_EVENT_CB_F_TYPE_VERSION = 0x00050001; -const RPC_LOC_API_API_VERSIONS_VERSION = 0x00050001; -const RPC_LOC_STOP_FIX_VERSION = 0x00050001; -const RPC_LOC_START_FIX_VERSION = 0x00050001; -const RPC_LOC_IOCTL_VERSION = 0x00050001; -const RPC_LOC_CLOSE_VERSION = 0x00050001; -const RPC_LOC_API_RPC_GLUE_CODE_INFO_REMOTE_VERSION = 0x00050001; -const RPC_LOC_OPEN_VERSION = 0x00050001; -const RPC_LOC_API_NULL_VERSION = 0x00050001; -const RPC_LOC_API_API_MAJOR_NUM = 0x0005; -const RPC_LOC_APIAPI_VERSION_IS_HASHKEY = 0; - -typedef rpc_int32 rpc_loc_client_handle_type; - -typedef rpc_uint64 rpc_loc_event_mask_type; - -typedef rpc_uint64 rpc_loc_position_valid_mask_type; - -typedef rpc_uint32 rpc_loc_pos_technology_mask_type; - -enum rpc_loc_session_status_e_type { - RPC_LOC_SESS_STATUS_SUCCESS = 0, - RPC_LOC_SESS_STATUS_IN_PROGESS = 1, - RPC_LOC_SESS_STATUS_GENERAL_FAILURE = 2, - RPC_LOC_SESS_STATUS_TIMEOUT = 3, - RPC_LOC_SESS_STATUS_USER_END = 4, - RPC_LOC_SESS_STATUS_BAD_PARAMETER = 5, - RPC_LOC_SESS_STATUS_PHONE_OFFLINE = 6, - RPC_LOC_SESS_STATUS_ENGINE_LOCKED = 7, - RPC_LOC_SESS_STATUS_MAX = 268435456 -}; - -struct rpc_loc_calendar_time_s_type { - rpc_uint16 year; - unsigned char month; - unsigned char day_of_week; - unsigned char day; - unsigned char hour; - unsigned char minute; - unsigned char second; - rpc_uint16 millisecond; -}; - -struct rpc_loc_parsed_position_s_type { - rpc_loc_position_valid_mask_type valid_mask; - rpc_loc_session_status_e_type session_status; - rpc_loc_calendar_time_s_type timestamp_calendar; - rpc_uint64 timestamp_utc; - rpc_uint8 leap_seconds; - float time_unc; - double latitude; - double longitude; - float altitude_wrt_ellipsoid; - float altitude_wrt_mean_sea_level; - float speed_horizontal; - float speed_vertical; - float heading; - float hor_unc_circular; - float hor_unc_ellipse_semi_major; - float hor_unc_ellipse_semi_minor; - float hor_unc_ellipse_orient_azimuth; - float vert_unc; - float speed_unc; - float heading_unc; - unsigned char confidence_horizontal; - unsigned char confidence_vertical; - float magnetic_deviation; - rpc_loc_pos_technology_mask_type technology_mask; -}; - -enum rpc_loc_sv_system_e_type { - RPC_LOC_SV_SYSTEM_GPS = 1, - RPC_LOC_SV_SYSTEM_GALILEO = 2, - RPC_LOC_SV_SYSTEM_SBAS = 3, - RPC_LOC_SV_SYSTEM_COMPASS = 4, - RPC_LOC_SV_SYSTEM_GLONASS = 5, - RPC_LOC_SV_SYSTEM_MAX = 268435456 -}; - -enum rpc_loc_sv_status_e_type { - RPC_LOC_SV_STATUS_IDLE = 1, - RPC_LOC_SV_STATUS_SEARCH = 2, - RPC_LOC_SV_STATUS_TRACK = 3, - RPC_LOC_SV_STATUS_MAX = 268435456 -}; - -typedef rpc_uint32 rpc_loc_sv_info_valid_mask_type; - -struct rpc_loc_sv_info_s_type { - rpc_loc_sv_info_valid_mask_type valid_mask; - rpc_loc_sv_system_e_type system; - rpc_uint8 prn; - rpc_uint8 health_status; - rpc_loc_sv_status_e_type process_status; - rpc_boolean has_eph; - rpc_boolean has_alm; - float elevation; - float azimuth; - float snr; -}; - -typedef rpc_uint32 rpc_loc_gnss_info_valid_mask_type; - -struct rpc_loc_gnss_info_s_type { - rpc_loc_gnss_info_valid_mask_type valid_mask; - float position_dop; - float horizontal_dop; - float vertical_dop; - rpc_boolean altitude_assumed; - rpc_uint16 sv_count; - rpc_loc_sv_info_s_type sv_list<80>; /* EVAL:[LOC_API_MAX_SV_COUNT]*/ -}; - -struct rpc_loc_nmea_report_s_type { - rpc_uint16 length; - opaque nmea_sentences[200]; -}; - -enum rpc_loc_status_event_e_type { - RPC_LOC_STATUS_EVENT_ENGINE_STATE = 1, - RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE = 2, - RPC_LOC_STATUS_EVENT_MAX = 268435456 -}; - -enum rpc_loc_engine_state_e_type { - RPC_LOC_ENGINE_STATE_ON = 1, - RPC_LOC_ENGINE_STATE_OFF = 2, - RPC_LOC_ENGINE_STATE_MAX = 268435456 -}; - -enum rpc_loc_fix_session_state_e_type { - RPC_LOC_FIX_SESSION_STATE_BEGIN = 1, - RPC_LOC_FIX_SESSION_STATE_END = 2, - RPC_LOC_FIX_SESSION_STATE_MAX = 268435456 -}; - -union rpc_loc_status_event_payload_u_type switch (rpc_loc_status_event_e_type disc) { - case RPC_LOC_STATUS_EVENT_ENGINE_STATE: - rpc_loc_engine_state_e_type engine_state; - case RPC_LOC_STATUS_EVENT_FIX_SESSION_STATE: - rpc_loc_fix_session_state_e_type fix_session_state; - default: - void; -}; - -struct rpc_loc_status_event_s_type { - rpc_loc_status_event_e_type event; - rpc_loc_status_event_payload_u_type payload; -}; - -enum rpc_loc_server_addr_e_type { - RPC_LOC_SERVER_ADDR_IPV4 = 1, - RPC_LOC_SERVER_ADDR_URL = 2, - RPC_LOC_SERVER_ADDR_IPV6 = 3, - RPC_LOC_SERVER_ADDR_MAX = 268435456 -}; - -struct rpc_loc_server_addr_ipv4_type { - rpc_uint32 addr; - rpc_uint16 port; -}; - -struct rpc_loc_server_addr_url_type { - rpc_uint16 length; - opaque addr[256]; -}; - -struct rpc_loc_server_addr_ipv6_type { - rpc_uint16 addr[8]; - rpc_uint32 port; -}; - -union rpc_loc_server_addr_u_type switch (rpc_loc_server_addr_e_type disc) { - case RPC_LOC_SERVER_ADDR_IPV4: - rpc_loc_server_addr_ipv4_type ipv4; - case RPC_LOC_SERVER_ADDR_URL: - rpc_loc_server_addr_url_type url; - case RPC_LOC_SERVER_ADDR_IPV6: - rpc_loc_server_addr_ipv6_type ipv6; - default: - void; -}; - -struct rpc_loc_server_info_s_type { - rpc_loc_server_addr_e_type addr_type; - rpc_loc_server_addr_u_type addr_info; -}; - -enum rpc_loc_ni_notify_verify_e_type { - RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY = 1, - RPC_LOC_NI_USER_NOTIFY_ONLY = 2, - RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP = 3, - RPC_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP = 4, - RPC_LOC_NI_USER_PRIVACY_OVERRIDE = 5, - RPC_LOC_NI_USER_NOTIFY_VERITY_TYPE_MAX = 268435456 -}; - -enum rpc_loc_ni_event_e_type { - RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ = 1, - RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ = 2, - RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ = 3, - RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ = 4, - RPC_LOC_NI_EVENT_MAX = 268435456 -}; - -enum rpc_loc_ni_datacoding_scheme_e_type { - RPC_LOC_NI_PRESUPL_ISO646IRV = 0, - RPC_LOC_NI_PRESUPL_ISO8859 = 1, - RPC_LOC_NI_PRESUPL_UTF8 = 2, - RPC_LOC_NI_PRESUPL_UTF16 = 3, - RPC_LOC_NI_PRESUPL_UCS2 = 4, - RPC_LOC_NI_PRESUPL_GSM_DEFAULT = 5, - RPC_LOC_NI_PRESUPL_SHIFT_JIS = 6, - RPC_LOC_NI_PRESUPL_JIS = 7, - RPC_LOC_NI_PRESUPL_EUC = 8, - RPC_LOC_NI_PRESUPL_GB2312 = 9, - RPC_LOC_NI_PRESUPL_CNS11643 = 10, - RPC_LOC_NI_PRESUPL_KSC1001 = 11, - RPC_LOC_NI_PRESUPL_ENCODING_UNKNOWN = 2147483647, - RPC_LOC_NI_SS_GERMAN = 12, - RPC_LOC_NI_SS_ENGLISH = 13, - RPC_LOC_NI_SS_ITALIAN = 14, - RPC_LOC_NI_SS_FRENCH = 15, - RPC_LOC_NI_SS_SPANISH = 16, - RPC_LOC_NI_SS_DUTCH = 17, - RPC_LOC_NI_SS_SWEDISH = 18, - RPC_LOC_NI_SS_DANISH = 19, - RPC_LOC_NI_SS_PORTUGUESE = 20, - RPC_LOC_NI_SS_FINNISH = 21, - RPC_LOC_NI_SS_NORWEGIAN = 22, - RPC_LOC_NI_SS_GREEK = 23, - RPC_LOC_NI_SS_TURKISH = 24, - RPC_LOC_NI_SS_HUNGARIAN = 25, - RPC_LOC_NI_SS_POLISH = 26, - RPC_LOC_NI_SS_LANGUAGE_UNSPEC = 27, - RPC_LOC_NI_SUPL_UTF8 = 28, - RPC_LOC_NI_SUPL_UCS2 = 29, - RPC_LOC_NI_SUPL_GSM_DEFAULT = 30, - RPC_LOC_NI_SUPL_ENCODING_UNKNOWN = 2147483647 -}; - -enum rpc_loc_ni_vx_requester_id_encoding_scheme_e_type { - RPC_LOC_NI_VX_OCTET = 0, - RPC_LOC_NI_VX_EXN_PROTOCOL_MSG = 1, - RPC_LOC_NI_VX_ASCII = 2, - RPC_LOC_NI_VX_IA5 = 3, - RPC_LOC_NI_VX_UNICODE = 4, - RPC_LOC_NI_VX_SHIFT_JIS = 5, - RPC_LOC_NI_VX_KOREAN = 6, - RPC_LOC_NI_VX_LATIN_HEBREW = 7, - RPC_LOC_NI_VX_LATIN = 8, - RPC_LOC_NI_VX_GSM = 9, - RPC_LOC_NI_VX_ENCODING_TYPE_MAX = 268435456 -}; - -enum rpc_loc_ni_vx_pos_mode_e_type { - RPC_LOC_VX_MS_ASSISTED_ONLY = 1, - RPC_LOC_VX_MS_BASED_ONLY = 2, - RPC_LOC_VX_MS_ASSISTED_PREF_MSBASED_ALLWD = 3, - RPC_LOC_VX_MS_BASED_PREF_ASSISTED_ALLWD = 4, - RPC_LOC_VX_POS_MODE_MAX = 268435456 -}; - -struct rpc_loc_ni_vx_requester_id_s_type { - unsigned char requester_id_length; - opaque requester_id[200]; -}; - -struct rpc_loc_ni_vx_notify_verify_req_s_type { - rpc_loc_ni_notify_verify_e_type notification_priv_type; - unsigned char pos_qos_incl; - unsigned char pos_qos; - rpc_uint32 num_fixes; - rpc_uint32 tbf; - rpc_loc_ni_vx_pos_mode_e_type pos_mode; - rpc_loc_ni_vx_requester_id_encoding_scheme_e_type encoding_scheme; - rpc_loc_ni_vx_requester_id_s_type requester_id; - rpc_uint16 user_resp_timer_val; -}; - -enum rpc_loc_ni_supl_pos_method_e_type { - RPC_LOC_NI_POSMETHOD_AGPS_SETASSISTED = 1, - RPC_LOC_NI_POSMETHOD_AGPS_SETBASED = 2, - RPC_LOC_NI_POSMETHOD_AGPS_SETASSISTED_PREF = 3, - RPC_LOC_NI_POSMETHOD_AGPS_SETBASED_PREF = 4, - RPC_LOC_NI_POSMETHOD_AUTONOMOUS_GPS = 5, - RPC_LOC_NI_POSMETHOD_AFLT = 6, - RPC_LOC_NI_POSMETHOD_ECID = 7, - RPC_LOC_NI_POSMETHOD_EOTD = 8, - RPC_LOC_NI_POSMETHOD_OTDOA = 9, - RPC_LOC_NI_POSMETHOD_NO_POSITION = 10, - RPC_LOC_NI_POSMETHOD_MAX = 268435456 -}; - -struct rpc_loc_ni_supl_slp_session_id_s_type { - unsigned char presence; - opaque session_id[4]; - rpc_loc_server_info_s_type slp_address; -}; - -struct rpc_loc_ni_requestor_id_s_type { - unsigned char data_coding_scheme; - opaque requestor_id_string[200]; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_client_name_s_type { - unsigned char data_coding_scheme; - opaque client_name_string[64]; - unsigned char string_len; -}; - -struct rpc_loc_ni_supl_qop_s_type { - unsigned char bit_mask; - unsigned char horacc; - unsigned char veracc; - rpc_uint16 maxLocAge; - unsigned char delay; -}; - -struct rpc_loc_ni_supl_notify_verify_req_s_type { - rpc_loc_ni_notify_verify_e_type notification_priv_type; - rpc_uint16 flags; - rpc_loc_ni_supl_slp_session_id_s_type supl_slp_session_id; - opaque supl_hash[8]; - rpc_loc_ni_datacoding_scheme_e_type datacoding_scheme; - rpc_loc_ni_supl_pos_method_e_type pos_method; - rpc_loc_ni_requestor_id_s_type requestor_id; - rpc_loc_ni_supl_client_name_s_type client_name; - rpc_loc_ni_supl_qop_s_type supl_qop; - rpc_uint16 user_response_timer; -}; - -struct rpc_loc_ni_ext_client_address_s_type { - unsigned char ext_client_address_len; - opaque ext_client_address[20]; -}; - -enum rpc_loc_ni_location_type_e_type { - RPC_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION = 1, - RPC_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION = 2, - RPC_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION = 3, - RPC_LOC_NI_LOCATIONTYPE_MAX = 268435456 -}; - -struct rpc_loc_ni_deferred_location_s_type { - unsigned char unused_bits; - unsigned char ms_available; -}; - -struct rpc_loc_ni_codeword_string_s_type { - unsigned char data_coding_scheme; - opaque lcs_codeword_string[20]; - unsigned char string_len; -}; - -struct rpc_loc_ni_service_type_id_s_type { - unsigned char lcs_service_type_id; -}; - -struct rpc_loc_ni_umts_cp_notify_verify_req_s_type { - rpc_loc_ni_notify_verify_e_type notification_priv_type; - unsigned char invoke_id; - rpc_uint16 flags; - unsigned char notification_length; - opaque notification_text[64]; - rpc_loc_ni_datacoding_scheme_e_type datacoding_scheme; - rpc_loc_ni_ext_client_address_s_type ext_client_address_data; - rpc_loc_ni_location_type_e_type location_type; - rpc_loc_ni_deferred_location_s_type deferred_location; - rpc_loc_ni_requestor_id_s_type requestor_id; - rpc_loc_ni_codeword_string_s_type codeword_string; - rpc_loc_ni_service_type_id_s_type service_type_id; - rpc_uint16 user_response_timer; -}; - -enum rpc_loc_ni_service_interaction_e_type { - RPC_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO = 1, - RPC_LOC_NI_SERVICE_INTERACTION_MAX = 268435456 -}; - -struct rpc_loc_ni_vx_service_interaction_req_s_type { - rpc_loc_ni_vx_notify_verify_req_s_type ni_vx_req; - rpc_loc_ni_service_interaction_e_type service_interation_type; -}; - -union rpc_loc_ni_event_payload_u_type switch (rpc_loc_ni_event_e_type disc) { - case RPC_LOC_NI_EVENT_VX_NOTIFY_VERIFY_REQ: - rpc_loc_ni_vx_notify_verify_req_s_type vx_req; - case RPC_LOC_NI_EVENT_SUPL_NOTIFY_VERIFY_REQ: - rpc_loc_ni_supl_notify_verify_req_s_type supl_req; - case RPC_LOC_NI_EVENT_UMTS_CP_NOTIFY_VERIFY_REQ: - rpc_loc_ni_umts_cp_notify_verify_req_s_type umts_cp_req; - case RPC_LOC_NI_EVENT_VX_SERVICE_INTERACTION_REQ: - rpc_loc_ni_vx_service_interaction_req_s_type service_interaction_req; - default: - void; -}; - -struct rpc_loc_ni_event_s_type { - rpc_loc_ni_event_e_type event; - rpc_loc_ni_event_payload_u_type payload; -}; - -enum rpc_loc_assist_data_request_e_type { - RPC_LOC_ASSIST_DATA_TIME_REQ = 1, - RPC_LOC_ASSIST_DATA_PREDICTED_ORBITS_REQ = 2, - RPC_LOC_ASSIST_DATA_POSITION_INJECTION_REQ = 3, - RPC_LOC_ASSIST_DATA_MAX = 268435456 -}; - -typedef string rpc_struct_loc_time_download_source_s_type_servers_ptr<256>; /* EVAL:[LOC_API_MAX_SERVER_ADDR_LENGTH]*/ - -typedef rpc_struct_loc_time_download_source_s_type_servers_ptr rpc_struct_loc_time_download_source_s_type_servers[3]; - -struct rpc_loc_time_download_source_s_type { - rpc_uint32 delay_threshold; - rpc_struct_loc_time_download_source_s_type_servers servers; -}; - -typedef string rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr; - -typedef rpc_struct_loc_predicted_orbits_data_source_s_type_servers_ptr rpc_struct_loc_predicted_orbits_data_source_s_type_servers[3]; - -struct rpc_loc_predicted_orbits_data_source_s_type { - rpc_uint32 max_file_size; - rpc_uint32 max_part_size; - rpc_struct_loc_predicted_orbits_data_source_s_type_servers servers; -}; - -struct rpc_loc_pos_inj_request_s_type { - rpc_uint32 flags; - double latitude; - double longitude; - rpc_uint32 position_uncertainty; - rpc_uint64 timestamp; -}; - -union rpc_loc_assist_data_request_payload_u_type switch (rpc_loc_assist_data_request_e_type disc) { - case RPC_LOC_ASSIST_DATA_TIME_REQ: - rpc_loc_time_download_source_s_type time_download; - case RPC_LOC_ASSIST_DATA_PREDICTED_ORBITS_REQ: - rpc_loc_predicted_orbits_data_source_s_type data_download; - case RPC_LOC_ASSIST_DATA_POSITION_INJECTION_REQ: - rpc_loc_pos_inj_request_s_type pos_injection; - default: - void; -}; - -struct rpc_loc_assist_data_request_s_type { - rpc_loc_assist_data_request_e_type event; - rpc_loc_assist_data_request_payload_u_type payload; -}; - -typedef rpc_uint32 rpc_loc_server_connection_handle; - -enum rpc_loc_server_protocol_e_type { - RPC_LOC_SERVER_PROTOCOL_DEFAULT = 0, - RPC_LOC_SERVER_PROTOCOL_SUPL = 1, - RPC_LOC_SERVER_PROTOCOL_VX_MPC = 2, - RPC_LOC_SERVER_PROTOCOL_VX_PDE = 3, - RPC_LOC_SERVER_PROTOCOL_MAX = 16777216 -}; - -enum rpc_loc_server_connection_e_type { - RPC_LOC_SERVER_CONNECTION_LBS = 0, - RPC_LOC_SERVER_CONNECTION_WWAN_INTERNET, - RPC_LOC_SERVER_CONNECTION_MAX = 16777216 -}; - -enum rpc_loc_server_request_e_type { - RPC_LOC_SERVER_REQUEST_OPEN = 1, - RPC_LOC_SERVER_REQUEST_CLOSE = 2, - RPC_LOC_SERVER_REQUEST_MULTI_OPEN = 3, - RPC_LOC_SERVER_REQUEST_MAX = 268435456 -}; - -struct rpc_loc_server_open_req_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_protocol_e_type protocol; -}; - -struct rpc_loc_server_multi_open_req_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_protocol_e_type protocol; - rpc_loc_server_connection_e_type connection_type; -}; - -struct rpc_loc_server_close_req_s_type { - rpc_loc_server_connection_handle conn_handle; -}; - -union rpc_loc_server_request_u_type switch (rpc_loc_server_request_e_type disc) { - case RPC_LOC_SERVER_REQUEST_OPEN: - rpc_loc_server_open_req_s_type open_req; - case RPC_LOC_SERVER_REQUEST_CLOSE: - rpc_loc_server_close_req_s_type close_req; - case RPC_LOC_SERVER_REQUEST_MULTI_OPEN: - rpc_loc_server_multi_open_req_s_type multi_open_req; - default: - void; -}; - -struct rpc_loc_server_request_s_type { - rpc_loc_server_request_e_type event; - rpc_loc_server_request_u_type payload; -}; - -enum rpc_loc_qwip_request_e_type { - RPC_LOC_QWIP_START_PERIODIC_HI_FREQ_FIXES = 0, - RPC_LOC_QWIP_START_PERIODIC_KEEP_WARM, - RPC_LOC_QWIP_STOP_PERIODIC_FIXES, - RPC_LOC_QWIP_SUSPEND, - RPC_LOC_QWIP_REQUEST_MAX = 268435456 -}; - -struct rpc_loc_qwip_request_s_type { - rpc_loc_qwip_request_e_type request_type; - rpc_uint16 tbf_ms; -}; - -struct rpc_loc_reserved_payload_s_type { - rpc_uint16 data_size; - opaque data<>; -}; - -enum rpc_loc_ioctl_e_type { - RPC_LOC_IOCTL_GET_API_VERSION = 1, - RPC_LOC_IOCTL_SET_FIX_CRITERIA = 2, - RPC_LOC_IOCTL_GET_FIX_CRITERIA = 3, - RPC_LOC_IOCTL_SERVICE_START_INDEX = 400, - RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE = 400, - RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA = 401, - RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY = 402, - RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE = 403, - RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD = 404, - RPC_LOC_IOCTL_INJECT_UTC_TIME = 405, - RPC_LOC_IOCTL_INJECT_RTC_VALUE = 406, - RPC_LOC_IOCTL_INJECT_POSITION = 407, - RPC_LOC_IOCTL_QUERY_ENGINE_STATE = 408, - RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS = 409, - RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS = 410, - RPC_LOC_IOCTL_SEND_WIPER_POSITION_REPORT = 411, - RPC_LOC_IOCTL_NOTIFY_WIPER_STATUS = 412, - RPC_LOC_IOCTL_ACCESS_EFS_DATA = 413, - RPC_LOC_IOCTL_ERROR_ESTIMATE_CONFIG = 414, - RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS = 415, - RPC_LOC_IOCTL_NV_SETTINGS_START_INDEX = 800, - RPC_LOC_IOCTL_SET_ENGINE_LOCK = 800, - RPC_LOC_IOCTL_GET_ENGINE_LOCK = 801, - RPC_LOC_IOCTL_SET_SBAS_CONFIG = 802, - RPC_LOC_IOCTL_GET_SBAS_CONFIG = 803, - RPC_LOC_IOCTL_SET_NMEA_TYPES = 804, - RPC_LOC_IOCTL_GET_NMEA_TYPES = 805, - RPC_LOC_IOCTL_SET_CDMA_PDE_SERVER_ADDR = 806, - RPC_LOC_IOCTL_GET_CDMA_PDE_SERVER_ADDR = 807, - RPC_LOC_IOCTL_SET_CDMA_MPC_SERVER_ADDR = 808, - RPC_LOC_IOCTL_GET_CDMA_MPC_SERVER_ADDR = 809, - RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR = 810, - RPC_LOC_IOCTL_GET_UMTS_SLP_SERVER_ADDR = 811, - RPC_LOC_IOCTL_SET_ON_DEMAND_LPM = 812, - RPC_LOC_IOCTL_GET_ON_DEMAND_LPM = 813, - RPC_LOC_IOCTL_SET_XTRA_T_SESSION_CONTROL = 814, - RPC_LOC_IOCTL_GET_XTRA_T_SESSION_CONTROL = 815, - RPC_LOC_IOCTL_SET_LBS_APN_PROFILE = 816, - RPC_LOC_IOCTL_GET_LBS_APN_PROFILE = 817, - RPC_LOC_IOCTL_SET_XTRA_APN_PROFILE = 818, - RPC_LOC_IOCTL_GET_XTRA_APN_PROFILE = 819, - RPC_LOC_IOCTL_SET_DATA_ENABLE = 820, - RPC_LOC_IOCTL_SET_SUPL_VERSION = 821, - RPC_LOC_IOCTL_GET_SUPL_VERSION = 822, - RPC_LOC_IOCTL_PROPRIETARY_START_INDEX = 1000, - RPC_LOC_IOCTL_DELETE_ASSIST_DATA = 1000, - RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR = 1001, - RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR = 1002, - RPC_LOC_IOCTL_RESERVED_CMD = 8000, - RPC_LOC_IOCTL_THIRD_PARTY_START_INDEX = 1073741824 -}; - -struct rpc_loc_api_version_s_type { - unsigned char major; - unsigned char minor; -}; - -enum rpc_loc_fix_recurrence_e_type { - RPC_LOC_PERIODIC_FIX = 1, - RPC_LOC_SINGLE_FIX = 2, - RPC_LOC_FIX_SESSION_TYPE_MAX = 268435456 -}; - -enum rpc_loc_operation_mode_e_type { - RPC_LOC_OPER_MODE_DEFAULT = 1, - RPC_LOC_OPER_MODE_MSB = 2, - RPC_LOC_OPER_MODE_MSA = 3, - RPC_LOC_OPER_MODE_STANDALONE = 4, - RPC_LOC_OPER_MODE_SPEED_OPTIMAL = 5, - RPC_LOC_OPER_MODE_ACCURACY_OPTIMAL = 6, - RPC_LOC_OPER_MODE_DATA_OPTIMAL = 7, - RPC_LOC_OPER_MODE_CELL_ID = 8, - RPC_LOC_OPER_MODE_MAX = 268435456 -}; - -enum rpc_loc_notify_e_type { - RPC_LOC_NOTIFY_ON_INTERVAL = 1, - RPC_LOC_NOTIFY_ON_DISTANCE = 2, - RPC_LOC_NOTIFY_ON_ANY = 3, - RPC_LOC_NOTIFY_ON_ALL = 4, - RPC_LOC_NOTIFY_TYPE_MAX = 268435456 -}; - -struct rpc_loc_fix_criteria_s_type { - rpc_uint32 valid_mask; - rpc_loc_fix_recurrence_e_type recurrence_type; - rpc_loc_operation_mode_e_type preferred_operation_mode; - rpc_uint32 preferred_accuracy; - rpc_uint32 preferred_response_time; - rpc_boolean intermediate_pos_report_enabled; - rpc_loc_notify_e_type notify_type; - rpc_uint32 min_interval; - float min_distance; - rpc_uint32 min_dist_sample_interval; -}; - -enum rpc_loc_ni_user_resp_e_type { - RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT = 1, - RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY = 2, - RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP = 3, - RPC_LOC_NI_LCS_NOTIFY_VERIFY_MAX = 268435456 -}; - -struct rpc_loc_user_verify_s_type { - rpc_loc_ni_user_resp_e_type user_resp; - rpc_loc_ni_event_s_type ni_event_pass_back; -}; - -enum rpc_loc_predicted_orbits_data_format_e_type { - RPC_LOC_PREDICTED_ORBITS_XTRA = 0, - RPC_LOC_PREDICTED_ORBITS_FORMAT_MAX = 268435456 -}; - -struct rpc_loc_predicted_orbits_data_s_type { - rpc_loc_predicted_orbits_data_format_e_type format_type; - rpc_uint32 total_size; - rpc_uint8 total_parts; - rpc_uint8 part; - rpc_uint16 part_len; - opaque data_ptr<>; -}; - -struct rpc_loc_predicted_orbits_data_validity_report_s_type { - rpc_uint64 start_time_utc; - rpc_uint16 valid_duration_hrs; -}; - -struct rpc_loc_predicted_orbits_auto_download_config_s_type { - rpc_boolean enable; - unsigned char auto_check_every_hrs; -}; - -struct rpc_loc_assist_data_time_s_type { - rpc_uint64 time_utc; - rpc_uint32 uncertainty; -}; - -typedef rpc_uint64 rpc_loc_assist_pos_valid_mask_type; - -struct rpc_loc_assist_data_pos_s_type { - rpc_loc_assist_pos_valid_mask_type valid_mask; - rpc_uint64 timestamp_utc; - double latitude; - double longitude; - float altitude_wrt_ellipsoid; - float altitude_wrt_mean_sea_level; - float hor_unc_circular; - float vert_unc; - unsigned char confidence_horizontal; - unsigned char confidence_vertical; - rpc_int32 timestamp_age; -}; - -enum rpc_loc_server_open_status_e_type { - RPC_LOC_SERVER_OPEN_SUCCESS = 1, - RPC_LOC_SERVER_OPEN_FAIL = 2, - RPC_LOC_SERVER_OPEN_STATUS_MAX = 268435456 -}; - -enum rpc_loc_server_pdp_type_e_type { - RPC_LOC_SERVER_PDP_IP = 0, - RPC_LOC_SERVER_PDP_PPP, - RPC_LOC_SERVER_PDP_IPV6, - RPC_LOC_SERVER_PDP_IPV4V6, - RPC_LOC_SERVER_PDP_MAX = 268435456 -}; - -struct rpc_loc_server_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - opaque apn_name[100]; -}; - -struct rpc_loc_server_multi_open_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_open_status_e_type open_status; - rpc_loc_server_pdp_type_e_type pdp_type; - opaque apn_name[100]; -}; - -enum rpc_loc_server_close_status_e_type { - RPC_LOC_SERVER_CLOSE_SUCCESS = 1, - RPC_LOC_SERVER_CLOSE_FAIL = 2, - RPC_LOC_SERVER_CLOSE_STATUS_MAX = 268435456 -}; - -struct rpc_loc_server_close_status_s_type { - rpc_loc_server_connection_handle conn_handle; - rpc_loc_server_close_status_e_type close_status; -}; - -struct rpc_loc_wiper_fix_time_s_type { - rpc_uint32 slow_clock_count; -}; - -struct rpc_loc_wiper_fix_pos_s_type { - rpc_int32 lat; - rpc_int32 lon; - rpc_uint16 HEPE; - rpc_uint8 num_of_aps_used; - rpc_uint8 fix_error_code; -}; - -struct rpc_loc_wiper_ap_info_s_type { - opaque mac_addr[6]; - rpc_int32 rssi; - rpc_uint16 channel; - rpc_uint8 ap_qualifier; -}; - -struct rpc_loc_wiper_ap_set_s_type { - rpc_uint8 num_of_aps; - rpc_loc_wiper_ap_info_s_type ap_info[50]; -}; - -struct rpc_loc_wiper_position_report_s_type { - rpc_uint8 wiper_valid_info_flag; - rpc_loc_wiper_fix_time_s_type wiper_fix_time; - rpc_loc_wiper_fix_pos_s_type wiper_fix_position; - rpc_loc_wiper_ap_set_s_type wiper_ap_set; -}; - -enum rpc_loc_wiper_status_e_type { - RPC_LOC_WIPER_STATUS_AVAILABLE = 1, - RPC_LOC_WIPER_STATUS_UNAVAILABLE = 2, - RPC_LOC_WIPER_STATUS_E_SIZE = 268435456 -}; - -enum rpc_loc_fs_operation_e_type { - RPC_LOC_FS_CREATE_WRITE_FILE = 1, - RPC_LOC_FS_APPEND_FILE = 2, - RPC_LOC_FS_DELETE_FILE = 3, - RPC_LOC_FS_READ_FILE = 4, - RPC_LOC_FS_MAX = 268435456 -}; - -struct rpc_loc_efs_data_s_type { - opaque filename[64]; - rpc_loc_fs_operation_e_type operation; - rpc_uint32 total_size; - opaque data_ptr<>; - rpc_uint32 part_len; - rpc_uint8 part; - rpc_uint8 total_parts; - rpc_uint32 reserved; -}; - -enum rpc_loc_error_estimate_config_e_type { - RPC_LOC_ERROR_ESTIMATE_CONFIG_SET = 1, - RPC_LOC_ERROR_ESTIMATE_CONFIG_CLEAR = 2, - RPC_LOC_ERROR_ESTIMATE_MAX = 268435456 -}; - -struct rpc_loc_apn_profiles_type { - rpc_uint32 srv_system_type; - rpc_uint32 pdp_type; - rpc_uint32 reserved; - opaque apn_name[100]; -}; - -enum rpc_loc_lock_e_type { - RPC_LOC_LOCK_NONE = 1, - RPC_LOC_LOCK_MI = 2, - RPC_LOC_LOCK_MT = 3, - RPC_LOC_LOCK_ALL = 4, - RPC_LOC_LOCK_MAX = 268435456 -}; - -typedef rpc_uint32 rpc_loc_nmea_sentence_type; - -typedef rpc_uint32 rpc_loc_assist_data_type; - -struct rpc_loc_assist_data_delete_s_type { - rpc_loc_assist_data_type type; - rpc_uint32 reserved[8]; -}; - -union rpc_loc_ioctl_data_u_type switch (rpc_loc_ioctl_e_type disc) { - case RPC_LOC_IOCTL_SET_FIX_CRITERIA: - rpc_loc_fix_criteria_s_type fix_criteria; - case RPC_LOC_IOCTL_INFORM_NI_USER_RESPONSE: - rpc_loc_user_verify_s_type user_verify_resp; - case RPC_LOC_IOCTL_INJECT_PREDICTED_ORBITS_DATA: - rpc_loc_predicted_orbits_data_s_type predicted_orbits_data; - case RPC_LOC_IOCTL_SET_PREDICTED_ORBITS_DATA_AUTO_DOWNLOAD: - rpc_loc_predicted_orbits_auto_download_config_s_type predicted_orbits_auto_download; - case RPC_LOC_IOCTL_INJECT_UTC_TIME: - rpc_loc_assist_data_time_s_type assistance_data_time; - case RPC_LOC_IOCTL_INJECT_POSITION: - rpc_loc_assist_data_pos_s_type assistance_data_position; - case RPC_LOC_IOCTL_INFORM_SERVER_OPEN_STATUS: - rpc_loc_server_open_status_s_type conn_open_status; - case RPC_LOC_IOCTL_INFORM_SERVER_CLOSE_STATUS: - rpc_loc_server_close_status_s_type conn_close_status; - case RPC_LOC_IOCTL_SEND_WIPER_POSITION_REPORT: - rpc_loc_wiper_position_report_s_type wiper_pos; - case RPC_LOC_IOCTL_NOTIFY_WIPER_STATUS: - rpc_loc_wiper_status_e_type wiper_status; - case RPC_LOC_IOCTL_SET_ENGINE_LOCK: - rpc_loc_lock_e_type engine_lock; - case RPC_LOC_IOCTL_SET_SBAS_CONFIG: - rpc_boolean sbas_mode; - case RPC_LOC_IOCTL_SET_NMEA_TYPES: - rpc_loc_nmea_sentence_type nmea_types; - case RPC_LOC_IOCTL_SET_ON_DEMAND_LPM: - rpc_boolean on_demand_lpm; - case RPC_LOC_IOCTL_SET_CDMA_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_CDMA_MPC_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR: - case RPC_LOC_IOCTL_SET_CUSTOM_PDE_SERVER_ADDR: - rpc_loc_server_info_s_type server_addr; - case RPC_LOC_IOCTL_DELETE_ASSIST_DATA: - rpc_loc_assist_data_delete_s_type assist_data_delete; - case RPC_LOC_IOCTL_ACCESS_EFS_DATA: - rpc_loc_efs_data_s_type efs_data; - case RPC_LOC_IOCTL_ERROR_ESTIMATE_CONFIG: - rpc_loc_error_estimate_config_e_type error_estimate_config; - case RPC_LOC_IOCTL_SET_XTRA_T_SESSION_CONTROL: - rpc_uint8 xtra_t_session_control; - case RPC_LOC_IOCTL_SET_LBS_APN_PROFILE: - case RPC_LOC_IOCTL_SET_XTRA_APN_PROFILE: - rpc_loc_apn_profiles_type apn_profiles[6]; - case RPC_LOC_IOCTL_SET_DATA_ENABLE: - rpc_boolean data_enable; - case RPC_LOC_IOCTL_SET_SUPL_VERSION: - rpc_uint32 supl_version; - case RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS: - rpc_loc_server_multi_open_status_s_type multi_conn_open_status; - case RPC_LOC_IOCTL_RESERVED_CMD: - rpc_loc_reserved_payload_s_type reserved; - default: - void; -}; - -union rpc_loc_ioctl_callback_data_u_type switch (rpc_loc_ioctl_e_type disc) { - case RPC_LOC_IOCTL_GET_API_VERSION: - rpc_loc_api_version_s_type api_version; - case RPC_LOC_IOCTL_GET_FIX_CRITERIA: - rpc_loc_fix_criteria_s_type fix_criteria; - case RPC_LOC_IOCTL_GET_ENGINE_LOCK: - rpc_loc_lock_e_type engine_lock; - case RPC_LOC_IOCTL_GET_SBAS_CONFIG: - rpc_boolean sbas_mode; - case RPC_LOC_IOCTL_GET_NMEA_TYPES: - rpc_loc_nmea_sentence_type nmea_types; - case RPC_LOC_IOCTL_GET_ON_DEMAND_LPM: - rpc_boolean on_demand_lpm; - case RPC_LOC_IOCTL_GET_CDMA_PDE_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CDMA_MPC_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_UMTS_SLP_SERVER_ADDR: - case RPC_LOC_IOCTL_GET_CUSTOM_PDE_SERVER_ADDR: - rpc_loc_server_info_s_type server_addr; - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_SOURCE: - rpc_loc_predicted_orbits_data_source_s_type predicted_orbits_data_source; - case RPC_LOC_IOCTL_QUERY_PREDICTED_ORBITS_DATA_VALIDITY: - rpc_loc_predicted_orbits_data_validity_report_s_type predicted_orbits_data_validity; - case RPC_LOC_IOCTL_GET_XTRA_T_SESSION_CONTROL: - rpc_uint8 xtra_t_session_control; - case RPC_LOC_IOCTL_GET_LBS_APN_PROFILE: - case RPC_LOC_IOCTL_GET_XTRA_APN_PROFILE: - rpc_loc_apn_profiles_type apn_profiles[6]; - case RPC_LOC_IOCTL_GET_SUPL_VERSION: - rpc_uint32 supl_version; - default: - void; -}; - -struct rpc_loc_ioctl_callback_s_type { - rpc_loc_ioctl_e_type type; - rpc_int32 status; - rpc_loc_ioctl_callback_data_u_type data; -}; - -union rpc_loc_event_payload_u_type switch (unsigned hyper disc) { - case RPC_LOC_EVENT_PARSED_POSITION_REPORT: - rpc_loc_parsed_position_s_type parsed_location_report; - case RPC_LOC_EVENT_SATELLITE_REPORT: - rpc_loc_gnss_info_s_type gnss_report; - case RPC_LOC_EVENT_NMEA_POSITION_REPORT: - case RPC_LOC_EVENT_NMEA_1HZ_REPORT: - rpc_loc_nmea_report_s_type nmea_report; - case RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST: - rpc_loc_ni_event_s_type ni_request; - case RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST: - rpc_loc_assist_data_request_s_type assist_data_request; - case RPC_LOC_EVENT_LOCATION_SERVER_REQUEST: - rpc_loc_server_request_s_type loc_server_request; - case RPC_LOC_EVENT_IOCTL_REPORT: - rpc_loc_ioctl_callback_s_type ioctl_report; - case RPC_LOC_EVENT_STATUS_REPORT: - rpc_loc_status_event_s_type status_report; - case RPC_LOC_EVENT_WPS_NEEDED_REQUEST: - rpc_loc_qwip_request_s_type qwip_request; - case RPC_LOC_EVENT_RESERVED: - rpc_loc_reserved_payload_s_type reserved; - default: - void; -}; - diff --git a/gps/loc_api/libloc_api_50001/Android.mk b/gps/loc_api/libloc_api_50001/Android.mk deleted file mode 100644 index ecb7da6..0000000 --- a/gps/loc_api/libloc_api_50001/Android.mk +++ /dev/null @@ -1,114 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libloc_eng -LOCAL_MODULE_OWNER := qcom - -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libdl \ - liblog \ - libloc_core \ - libgps.utils \ - libloc_pla - -LOCAL_SRC_FILES += \ - loc_eng.cpp \ - loc_eng_agps.cpp \ - loc_eng_xtra.cpp \ - loc_eng_ni.cpp \ - loc_eng_log.cpp \ - loc_eng_nmea.cpp \ - LocEngAdapter.cpp - -LOCAL_SRC_FILES += \ - loc_eng_dmn_conn.cpp \ - loc_eng_dmn_conn_handler.cpp \ - loc_eng_dmn_conn_thread_helper.c \ - loc_eng_dmn_conn_glue_msg.c \ - loc_eng_dmn_conn_glue_pipe.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ - $(call project-path-for,qcom-gps)/loc_api/libloc_api_50001 \ - $(TARGET_OUT_HEADERS)/libflp \ - $(TARGET_OUT_HEADERS)/libloc_pla - -LOCAL_COPY_HEADERS_TO:= libloc_eng/ -LOCAL_COPY_HEADERS:= \ - LocEngAdapter.h \ - loc.h \ - loc_eng.h \ - loc_eng_xtra.h \ - loc_eng_ni.h \ - loc_eng_agps.h \ - loc_eng_msg.h \ - loc_eng_log.h - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM) -LOCAL_MODULE_OWNER := qcom - -LOCAL_MODULE_TAGS := optional - -## Libs - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - liblog \ - libloc_eng \ - libloc_core \ - libgps.utils \ - libdl \ - libloc_pla - -ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false) -endif - -LOCAL_SRC_FILES += \ - loc.cpp \ - gps.c - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ \ - -ifeq ($(TARGET_BUILD_VARIANT),user) - LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER -endif - -ifeq ($(TARGET_USES_QCOM_BSP), true) -LOCAL_CFLAGS += -DTARGET_USES_QCOM_BSP -endif - -## Includes -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core \ - $(TARGET_OUT_HEADERS)/libflp \ - $(TARGET_OUT_HEADERS)/libloc_pla - -LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_RELATIVE_PATH := hw - -include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp b/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp deleted file mode 100644 index df6ad7c..0000000 --- a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ /dev/null @@ -1,601 +0,0 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_EngAdapter" - -#include -#include -#include -#include -#include -#include "loc_eng_msg.h" -#include "loc_log.h" - -#define CHIPSET_SERIAL_NUMBER_MAX_LEN 16 -#define USER_AGENT_MAX_LEN 512 - -using namespace loc_core; - -LocInternalAdapter::LocInternalAdapter(LocEngAdapter* adapter) : - LocAdapterBase(adapter->getMsgTask()), - mLocEngAdapter(adapter) -{ -} -void LocInternalAdapter::setPositionModeInt(LocPosMode& posMode) { - sendMsg(new LocEngPositionMode(mLocEngAdapter, posMode)); -} -void LocInternalAdapter::startFixInt() { - sendMsg(new LocEngStartFix(mLocEngAdapter)); -} -void LocInternalAdapter::stopFixInt() { - sendMsg(new LocEngStopFix(mLocEngAdapter)); -} -void LocInternalAdapter::getZppInt() { - sendMsg(new LocEngGetZpp(mLocEngAdapter)); -} - -LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, ContextBase* context, - LocThread::tCreate tCreator) : - LocAdapterBase(mask, - //Get the AFW context if VzW context has not already been intialized in - //loc_ext - context == NULL? - LocDualContext::getLocFgContext(tCreator, - NULL, - LocDualContext::mLocationHalName, - false) - :context), - mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), - mUlp(new UlpProxyBase()), mNavigating(false), - mSupportsAgpsRequests(false), - mSupportsPositionInjection(false), - mSupportsTimeInjection(false), - mPowerVote(0) -{ - memset(&mFixCriteria, 0, sizeof(mFixCriteria)); - mFixCriteria.mode = LOC_POSITION_MODE_INVALID; - clearGnssSvUsedListData(); - LOC_LOGD("LocEngAdapter created"); -} - -inline -LocEngAdapter::~LocEngAdapter() -{ - delete mInternalAdapter; - LOC_LOGV("LocEngAdapter deleted"); -} - -void LocEngAdapter::setXtraUserAgent() { - struct LocSetXtraUserAgent : public LocMsg { - const ContextBase* const mContext; - inline LocSetXtraUserAgent(ContextBase* context) : - LocMsg(), mContext(context) { - } - virtual void proc() const { - char release[PROPERTY_VALUE_MAX]; - char manufacture[PROPERTY_VALUE_MAX]; - char model[PROPERTY_VALUE_MAX]; - char board[PROPERTY_VALUE_MAX]; - char brand[PROPERTY_VALUE_MAX]; - char chipsetsn[CHIPSET_SERIAL_NUMBER_MAX_LEN]; - char userAgent[USER_AGENT_MAX_LEN]; - const char defVal[] = "-"; - - property_get("ro.build.version.release", release, defVal); - property_get("ro.product.manufacturer", manufacture, defVal); - property_get("ro.product.model", model, defVal); - property_get("ro.product.board", board, defVal); - property_get("ro.product.brand", brand, defVal); - getChipsetSerialNo(chipsetsn, sizeof(chipsetsn), defVal); - - encodeInPlace(release, PROPERTY_VALUE_MAX); - encodeInPlace(manufacture, PROPERTY_VALUE_MAX); - encodeInPlace(model, PROPERTY_VALUE_MAX); - encodeInPlace(board, PROPERTY_VALUE_MAX); - encodeInPlace(brand, PROPERTY_VALUE_MAX); - - snprintf(userAgent, sizeof(userAgent), "A/%s/%s/%s/%s/-/QCX3/s%u/-/%s/-/%s/-/-/-", - release, manufacture, model, board, - mContext->getIzatDevId(), chipsetsn, brand); - - for (int i = 0; i < sizeof(userAgent) && userAgent[i]; i++) { - if (' ' == userAgent[i]) userAgent[i] = '#'; - } - - saveUserAgentString(userAgent, strlen(userAgent)); - LOC_LOGV("%s] UserAgent %s", __func__, userAgent); - } - - void saveUserAgentString(const char* data, const int len) const { - const char XTRA_FOLDER[] = "/data/misc/location/xtra"; - const char USER_AGENT_FILE[] = "/data/misc/location/xtra/useragent.txt"; - - if (data == NULL || len < 1) { - LOC_LOGE("%s:%d]: invalid input data = %p len = %d", __func__, __LINE__, data, len); - return; - } - - struct stat s; - int err = stat(XTRA_FOLDER, &s); - if (err < 0) { - if (ENOENT == errno) { - if (mkdir(XTRA_FOLDER, 0700) < 0) { - LOC_LOGE("%s:%d]: make XTRA_FOLDER failed", __func__, __LINE__); - return; - } - } else { - LOC_LOGE("%s:%d]: XTRA_FOLDER invalid", __func__, __LINE__); - return; - } - } - - FILE* file = fopen(USER_AGENT_FILE, "wt"); - if (file == NULL) { - LOC_LOGE("%s:%d]: open USER_AGENT_FILE failed", __func__, __LINE__); - return; - } - - size_t written = fwrite(data, 1, len, file); - fclose(file); - file = NULL; - - // set file permission - chmod(USER_AGENT_FILE, 0600); - - if (written != len) { - LOC_LOGE("%s:%d]: write USER_AGENT_FILE failed", __func__, __LINE__); - } - } - - void getChipsetSerialNo(char buf[], int buflen, const char def[]) const { - const char SOC_SERIAL_NUMBER[] = "/sys/devices/soc0/serial_number"; - - FILE* file = fopen(SOC_SERIAL_NUMBER, "rt"); - if (file == NULL) { - // use default upon unreadable file - strlcpy(buf, def, buflen); - - } else { - size_t size = fread(buf, 1, buflen - 1, file); - if (size == 0) { - // use default upon empty file - strlcpy(buf, def, buflen); - - } else { - buf[size] = '\0'; - } - - fclose(file); - - // remove trailing spaces - char *s; - s = buf + strlen(buf); - while (--s >= buf) { - if (!isspace(*s)) break; - *s = 0; - } - } - - return; - } - - /** - * encode the given string value such that all separator characters ('/','+','|','%') - * in the string are repaced by their corresponding encodings (%2F","%2B","%7C", "%25") - */ - static void encodeInPlace(char value[], const int size) { - char buffer[size]; - - struct ENCODE { - const char ch; - const char *code; - }; - - const ENCODE encodings[] = { {'/', "%2F"}, {'+', "%2B"}, {'|', "%7C",}, {'%', "%25"} }; - const int nencodings = (int)sizeof(encodings) / sizeof(encodings[0]); - - int inpos = 0, outpos = 0; - while(value[inpos] != '\0' && outpos < size - 1) { - // check if escaped character - int escchar = 0; - while(escchar < nencodings && encodings[escchar].ch != value[inpos]) { - escchar++; - } - - if (escchar == nencodings) { - // non escaped character - buffer[outpos++] = value[inpos++]; - continue; - } - - // escaped character - int codepos = 0; - #define NUM_CHARS_IN_CODE 3 - - if (outpos + NUM_CHARS_IN_CODE >= size) { - // skip last character if there is insufficient space - break; - } - - while(outpos < size - 1 && codepos < NUM_CHARS_IN_CODE) { - buffer[outpos++] = encodings[escchar].code[codepos++]; - } - inpos++; - } - - // copy to ouput - value[outpos] = '\0'; - while(--outpos >= 0) { - value[outpos] = buffer[outpos]; - } - } - }; - - sendMsg(new LocSetXtraUserAgent(mContext)); -} - -void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) { - struct LocSetUlpProxy : public LocMsg { - LocAdapterBase* mAdapter; - UlpProxyBase* mUlp; - inline LocSetUlpProxy(LocAdapterBase* adapter, UlpProxyBase* ulp) : - LocMsg(), mAdapter(adapter), mUlp(ulp) { - } - virtual void proc() const { - LOC_LOGV("%s] ulp %p adapter %p", __func__, - mUlp, mAdapter); - mAdapter->setUlpProxy(mUlp); - } - }; - - sendMsg(new LocSetUlpProxy(mLocEngAdapter, ulp)); -} - -void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) -{ - if (ulp == mUlp) { - //This takes care of the case when double initalization happens - //and we get the same object back for UlpProxyBase . Do nothing - return; - } - - LOC_LOGV("%s] %p", __func__, ulp); - if (NULL == ulp) { - LOC_LOGE("%s:%d]: ulp pointer is NULL", __func__, __LINE__); - ulp = new UlpProxyBase(); - } - - if (LOC_POSITION_MODE_INVALID != mUlp->mPosMode.mode) { - // need to send this mode and start msg to ULP - ulp->sendFixMode(mUlp->mPosMode); - } - - if(mUlp->mFixSet) { - ulp->sendStartFix(); - } - - delete mUlp; - mUlp = ulp; -} - -int LocEngAdapter::setGpsLockMsg(LOC_GPS_LOCK_MASK lockMask) -{ - struct LocEngAdapterGpsLock : public LocMsg { - LocEngAdapter* mAdapter; - LOC_GPS_LOCK_MASK mLockMask; - inline LocEngAdapterGpsLock(LocEngAdapter* adapter, LOC_GPS_LOCK_MASK lockMask) : - LocMsg(), mAdapter(adapter), mLockMask(lockMask) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setGpsLock(mLockMask); - } - inline void locallog() const { - LOC_LOGV("LocEngAdapterGpsLock - mLockMask: %x", mLockMask); - } - inline virtual void log() const { - locallog(); - } - }; - sendMsg(new LocEngAdapterGpsLock(this, lockMask)); - return 0; -} - -void LocEngAdapter::requestPowerVote() -{ - if (getPowerVoteRight()) { - /* Power voting without engine lock: - * 101: vote down, 102-104 - vote up - * These codes are used not to confuse with actual engine lock - * functionality, that can't be used in SSR scenario, as it - * conflicts with initialization sequence. - */ - bool powerUp = getPowerVote(); - LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", (int)powerUp); - setGpsLock(powerUp ? 103 : 101); - } -} - -void LocInternalAdapter::reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask) -{ - sendMsg(new LocEngReportPosition(mLocEngAdapter, - location, - locationExtended, - locationExt, - status, - loc_technology_mask)); -} - - -void LocEngAdapter::reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask) -{ - if (! mUlp->reportPosition(location, - locationExtended, - locationExt, - status, - loc_technology_mask )) { - mInternalAdapter->reportPosition(location, - locationExtended, - locationExt, - status, - loc_technology_mask); - } -} - -void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt){ - sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, - locationExtended, svExt)); -} - -void LocEngAdapter::reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt) -{ - - // We want to send SV info to ULP to help it in determining GNSS - // signal strength ULP will forward the SV reports to HAL without - // any modifications - if (! mUlp->reportSv(svStatus, locationExtended, svExt)) { - mInternalAdapter->reportSv(svStatus, locationExtended, svExt); - } -} - - -void LocEngAdapter::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) -{ - // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. - if (! mUlp->reportSvMeasurement(svMeasurementSet)) { - //Send to Internal Adapter later if needed by LA - } -} - -void LocEngAdapter::reportSvPolynomial(GnssSvPolynomial &svPolynomial) -{ - // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. - if (! mUlp->reportSvPolynomial(svPolynomial)) { - //Send to Internal Adapter later if needed by LA - } -} - -void LocEngAdapter::setInSession(bool inSession) -{ - mNavigating = inSession; - mLocApi->setInSession(inSession); - if (!mNavigating) { - mFixCriteria.mode = LOC_POSITION_MODE_INVALID; - } -} - -void LocInternalAdapter::reportStatus(GpsStatusValue status) -{ - sendMsg(new LocEngReportStatus(mLocEngAdapter, status)); -} - -void LocEngAdapter::reportStatus(GpsStatusValue status) -{ - if (!mUlp->reportStatus(status)) { - mInternalAdapter->reportStatus(status); - } -} - -inline -void LocEngAdapter::reportNmea(const char* nmea, int length) -{ - sendMsg(new LocEngReportNmea(mOwner, nmea, length)); -} - -inline -bool LocEngAdapter::reportXtraServer(const char* url1, - const char* url2, - const char* url3, - const int maxlength) -{ - if (mSupportsAgpsRequests) { - sendMsg(new LocEngReportXtraServer(mOwner, url1, - url2, url3, maxlength)); - } - return mSupportsAgpsRequests; -} - -inline -bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) -{ - if (mSupportsAgpsRequests) { - sendMsg(new LocEngRequestATL(mOwner, - connHandle, agps_type)); - } - return mSupportsAgpsRequests; -} - -inline -bool LocEngAdapter::releaseATL(int connHandle) -{ - if (mSupportsAgpsRequests) { - sendMsg(new LocEngReleaseATL(mOwner, connHandle)); - } - return mSupportsAgpsRequests; -} - -inline -bool LocEngAdapter::requestXtraData() -{ - if (mSupportsAgpsRequests) { - sendMsg(new LocEngRequestXtra(mOwner)); - } - return mSupportsAgpsRequests; -} - -inline -bool LocEngAdapter::requestTime() -{ - if (mSupportsAgpsRequests) { - sendMsg(new LocEngRequestTime(mOwner)); - } - return mSupportsAgpsRequests; -} - -inline -bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) -{ - if (mSupportsAgpsRequests) { - notif.size = sizeof(notif); - notif.timeout = LOC_NI_NO_RESPONSE_TIME; - - sendMsg(new LocEngRequestNi(mOwner, notif, data)); - } - return mSupportsAgpsRequests; -} - -inline -bool LocEngAdapter::requestSuplES(int connHandle) -{ - if (mSupportsAgpsRequests) - sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return mSupportsAgpsRequests; -} - -inline -bool LocEngAdapter::reportDataCallOpened() -{ - if(mSupportsAgpsRequests) - sendMsg(new LocEngSuplEsOpened(mOwner)); - return mSupportsAgpsRequests; -} - -inline -bool LocEngAdapter::reportDataCallClosed() -{ - if(mSupportsAgpsRequests) - sendMsg(new LocEngSuplEsClosed(mOwner)); - return mSupportsAgpsRequests; -} - -inline -void LocEngAdapter::handleEngineDownEvent() -{ - sendMsg(new LocEngDown(mOwner)); -} - -inline -void LocEngAdapter::handleEngineUpEvent() -{ - sendMsg(new LocEngUp(mOwner)); -} - -enum loc_api_adapter_err LocEngAdapter::setTime(GpsUtcTime time, - int64_t timeReference, - int uncertainty) -{ - loc_api_adapter_err result = LOC_API_ADAPTER_ERR_SUCCESS; - - LOC_LOGD("%s:%d]: mSupportsTimeInjection is %d", - __func__, __LINE__, mSupportsTimeInjection); - - if (mSupportsTimeInjection) { - LOC_LOGD("%s:%d]: Injecting time", __func__, __LINE__); - result = mLocApi->setTime(time, timeReference, uncertainty); - } - - return result; -} - -enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check) -{ - enum loc_api_adapter_err ret; - ENTRY_LOG(); - enum xtra_version_check eCheck; - switch (check) { - case 0: - eCheck = DISABLED; - break; - case 1: - eCheck = AUTO; - break; - case 2: - eCheck = XTRA2; - break; - case 3: - eCheck = XTRA3; - break; - default: - eCheck = DISABLED; - } - ret = mLocApi->setXtraVersionCheck(eCheck); - EXIT_LOG(%d, ret); - return ret; -} - -void LocEngAdapter::reportGnssMeasurementData(GnssData &gnssMeasurementData) -{ - sendMsg(new LocEngReportGnssMeasurement(mOwner, - gnssMeasurementData)); -} - -/* - Set Gnss Constellation Config - */ -bool LocEngAdapter::gnssConstellationConfig() -{ - LOC_LOGD("entering %s", __func__); - bool result = false; - result = mLocApi->gnssConstellationConfig(); - return result; -} diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.h b/gps/loc_api/libloc_api_50001/LocEngAdapter.h deleted file mode 100644 index ca527d3..0000000 --- a/gps/loc_api/libloc_api_50001/LocEngAdapter.h +++ /dev/null @@ -1,376 +0,0 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_API_ENG_ADAPTER_H -#define LOC_API_ENG_ADAPTER_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAX_URL_LEN 256 - -using namespace loc_core; - -class LocEngAdapter; - -class LocInternalAdapter : public LocAdapterBase { - LocEngAdapter* mLocEngAdapter; -public: - LocInternalAdapter(LocEngAdapter* adapter); - - virtual void reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - virtual void reportStatus(GpsStatusValue status); - virtual void setPositionModeInt(LocPosMode& posMode); - virtual void startFixInt(); - virtual void stopFixInt(); - virtual void getZppInt(); - virtual void setUlpProxy(UlpProxyBase* ulp); -}; - -typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); - -class LocEngAdapter : public LocAdapterBase { - void* mOwner; - LocInternalAdapter* mInternalAdapter; - UlpProxyBase* mUlp; - LocPosMode mFixCriteria; - bool mNavigating; - // mPowerVote is encoded as - // mPowerVote & 0x20 -- powerVoteRight - // mPowerVote & 0x10 -- power On / Off - unsigned int mPowerVote; - static const unsigned int POWER_VOTE_RIGHT = 0x20; - static const unsigned int POWER_VOTE_VALUE = 0x10; - /** Gnss sv used in position data */ - GnssSvUsedInPosition mGnssSvIdUsedInPosition; - bool mGnssSvIdUsedInPosAvail; -public: - bool mSupportsAgpsRequests; - bool mSupportsPositionInjection; - bool mSupportsTimeInjection; - GnssSystemInfo mGnssInfo; - - LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, - void* owner, ContextBase* context, - LocThread::tCreate tCreator); - virtual ~LocEngAdapter(); - - virtual void setUlpProxy(UlpProxyBase* ulp); - void setXtraUserAgent(); - inline void requestUlp(unsigned long capabilities) { - mContext->requestUlp(mInternalAdapter, capabilities); - } - inline LocInternalAdapter* getInternalAdapter() { return mInternalAdapter; } - inline UlpProxyBase* getUlpProxy() { return mUlp; } - inline void* getOwner() { return mOwner; } - inline bool hasAgpsExtendedCapabilities() { - return mContext->hasAgpsExtendedCapabilities(); - } - inline bool hasCPIExtendedCapabilities() { - return mContext->hasCPIExtendedCapabilities(); - } - inline bool hasNativeXtraClient() { - return mContext->hasNativeXtraClient(); - } - inline const MsgTask* getMsgTask() { return mMsgTask; } - - inline void clearGnssSvUsedListData() { - mGnssSvIdUsedInPosAvail = false; - memset(&mGnssSvIdUsedInPosition, 0, sizeof (GnssSvUsedInPosition)); - } - - inline void setGnssSvUsedListData(GnssSvUsedInPosition gnssSvUsedIds) { - mGnssSvIdUsedInPosAvail = true; - memcpy(&mGnssSvIdUsedInPosition, &gnssSvUsedIds, - sizeof(GnssSvUsedInPosition)); - } - - inline GnssSvUsedInPosition getGnssSvUsedListData() { - return mGnssSvIdUsedInPosition; - } - - inline bool isGnssSvIdUsedInPosAvail() { - return mGnssSvIdUsedInPosAvail; - } - - inline enum loc_api_adapter_err - startFix() - { - return mLocApi->startFix(mFixCriteria); - } - inline enum loc_api_adapter_err - stopFix() - { - return mLocApi->stopFix(); - } - inline enum loc_api_adapter_err - deleteAidingData(GpsAidingData f) - { - return mLocApi->deleteAidingData(f); - } - inline enum loc_api_adapter_err - enableData(int enable) - { - return mLocApi->enableData(enable); - } - inline enum loc_api_adapter_err - setAPN(char* apn, int len) - { - return mLocApi->setAPN(apn, len); - } - inline enum loc_api_adapter_err - injectPosition(double latitude, double longitude, float accuracy) - { - return mLocApi->injectPosition(latitude, longitude, accuracy); - } - inline enum loc_api_adapter_err - setXtraData(char* data, int length) - { - return mLocApi->setXtraData(data, length); - } - inline enum loc_api_adapter_err - requestXtraServer() - { - return mLocApi->requestXtraServer(); - } - inline enum loc_api_adapter_err - atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) - { - return mLocApi->atlOpenStatus(handle, is_succ, apn, bearer, agpsType); - } - inline enum loc_api_adapter_err - atlCloseStatus(int handle, int is_succ) - { - return mLocApi->atlCloseStatus(handle, is_succ); - } - inline enum loc_api_adapter_err - setPositionMode(const LocPosMode *posMode) - { - if (NULL != posMode) { - mFixCriteria = *posMode; - } - return mLocApi->setPositionMode(mFixCriteria); - } - inline enum loc_api_adapter_err - setServer(const char* url, int len) - { - return mLocApi->setServer(url, len); - } - inline enum loc_api_adapter_err - setServer(unsigned int ip, int port, - LocServerType type) - { - return mLocApi->setServer(ip, port, type); - } - inline enum loc_api_adapter_err - informNiResponse(GpsUserResponseType userResponse, const void* passThroughData) - { - return mLocApi->informNiResponse(userResponse, passThroughData); - } - inline enum loc_api_adapter_err - setSUPLVersion(uint32_t version) - { - return mLocApi->setSUPLVersion(version); - } - inline enum loc_api_adapter_err - setNMEATypes (uint32_t typesMask) - { - return mLocApi->setNMEATypes(typesMask); - } - inline enum loc_api_adapter_err - setLPPConfig(uint32_t profile) - { - return mLocApi->setLPPConfig(profile); - } - inline enum loc_api_adapter_err - setSensorControlConfig(int sensorUsage, int sensorProvider) - { - return mLocApi->setSensorControlConfig(sensorUsage, sensorProvider); - } - inline enum loc_api_adapter_err - setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, - bool accelBiasVarianceRandomWalk_valid, float accelBiasVarianceRandomWalk, - bool angleBiasVarianceRandomWalk_valid, float angleBiasVarianceRandomWalk, - bool rateBiasVarianceRandomWalk_valid, float rateBiasVarianceRandomWalk, - bool velocityBiasVarianceRandomWalk_valid, float velocityBiasVarianceRandomWalk) - { - return mLocApi->setSensorProperties(gyroBiasVarianceRandomWalk_valid, gyroBiasVarianceRandomWalk, - accelBiasVarianceRandomWalk_valid, accelBiasVarianceRandomWalk, - angleBiasVarianceRandomWalk_valid, angleBiasVarianceRandomWalk, - rateBiasVarianceRandomWalk_valid, rateBiasVarianceRandomWalk, - velocityBiasVarianceRandomWalk_valid, velocityBiasVarianceRandomWalk); - } - inline virtual enum loc_api_adapter_err - setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, - int gyroSamplesPerBatch, int gyroBatchesPerSec, - int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, - int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig) - { - return mLocApi->setSensorPerfControlConfig(controlMode, accelSamplesPerBatch, accelBatchesPerSec, - gyroSamplesPerBatch, gyroBatchesPerSec, - accelSamplesPerBatchHigh, accelBatchesPerSecHigh, - gyroSamplesPerBatchHigh, gyroBatchesPerSecHigh, - algorithmConfig); - } - inline virtual enum loc_api_adapter_err - setAGLONASSProtocol(unsigned long aGlonassProtocol) - { - return mLocApi->setAGLONASSProtocol(aGlonassProtocol); - } - inline virtual enum loc_api_adapter_err - setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP) - { - return mLocApi->setLPPeProtocol(lppeCP, lppeUP); - } - inline virtual int initDataServiceClient() - { - return mLocApi->initDataServiceClient(); - } - inline virtual int openAndStartDataCall() - { - return mLocApi->openAndStartDataCall(); - } - inline virtual void stopDataCall() - { - mLocApi->stopDataCall(); - } - inline virtual void closeDataCall() - { - mLocApi->closeDataCall(); - } - inline enum loc_api_adapter_err - getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask) - { - return mLocApi->getBestAvailableZppFix(zppLoc, tech_mask); - } - enum loc_api_adapter_err setTime(GpsUtcTime time, - int64_t timeReference, - int uncertainty); - enum loc_api_adapter_err setXtraVersionCheck(int check); - inline virtual void installAGpsCert(const DerEncodedCertificate* pData, - size_t length, - uint32_t slotBitMask) - { - mLocApi->installAGpsCert(pData, length, slotBitMask); - } - virtual void handleEngineDownEvent(); - virtual void handleEngineUpEvent(); - virtual void reportPosition(UlpLocation &location, - GpsLocationExtended &locationExtended, - void* locationExt, - enum loc_sess_status status, - LocPosTechMask loc_technology_mask); - virtual void reportSv(GnssSvStatus &svStatus, - GpsLocationExtended &locationExtended, - void* svExt); - virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); - virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial); - virtual void reportStatus(GpsStatusValue status); - virtual void reportNmea(const char* nmea, int length); - virtual bool reportXtraServer(const char* url1, const char* url2, - const char* url3, const int maxlength); - virtual bool requestXtraData(); - virtual bool requestTime(); - virtual bool requestATL(int connHandle, AGpsType agps_type); - virtual bool releaseATL(int connHandle); - virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); - virtual bool requestSuplES(int connHandle); - virtual bool reportDataCallOpened(); - virtual bool reportDataCallClosed(); - virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData); - - inline const LocPosMode& getPositionMode() const - {return mFixCriteria;} - inline virtual bool isInSession() - { return mNavigating; } - void setInSession(bool inSession); - - // Permit/prohibit power voting - inline void setPowerVoteRight(bool powerVoteRight) { - mPowerVote = powerVoteRight ? (mPowerVote | POWER_VOTE_RIGHT) : - (mPowerVote & ~POWER_VOTE_RIGHT); - } - inline bool getPowerVoteRight() const { - return (mPowerVote & POWER_VOTE_RIGHT) != 0 ; - } - // Set the power voting up/down and do actual operation if permitted - inline void setPowerVote(bool powerOn) { - mPowerVote = powerOn ? (mPowerVote | POWER_VOTE_VALUE) : - (mPowerVote & ~POWER_VOTE_VALUE); - requestPowerVote(); - mContext->modemPowerVote(powerOn); - } - inline bool getPowerVote() const { - return (mPowerVote & POWER_VOTE_VALUE) != 0 ; - } - // Do power voting according to last settings if permitted - void requestPowerVote(); - - /*Values for lock - 1 = Do not lock any position sessions - 2 = Lock MI position sessions - 3 = Lock MT position sessions - 4 = Lock all position sessions - */ - inline int setGpsLock(LOC_GPS_LOCK_MASK lock) - { - return mLocApi->setGpsLock(lock); - } - - int setGpsLockMsg(LOC_GPS_LOCK_MASK lock); - - /* - Returns - Current value of GPS lock on success - -1 on failure - */ - inline int getGpsLock() - { - return mLocApi->getGpsLock(); - } - - /* - Set Gnss Constellation Config - */ - bool gnssConstellationConfig(); -}; - -#endif //LOC_API_ENG_ADAPTER_H diff --git a/gps/loc_api/libloc_api_50001/Makefile.am b/gps/loc_api/libloc_api_50001/Makefile.am deleted file mode 100644 index c762427..0000000 --- a/gps/loc_api/libloc_api_50001/Makefile.am +++ /dev/null @@ -1,78 +0,0 @@ -AM_CFLAGS = \ - -I../../utils \ - -I../../platform_lib_abstractions \ - -I$(WORKSPACE)/gps-noship/flp \ - -fno-short-enums \ - -D__func__=__PRETTY_FUNCTION__ \ - -DFEATURE_GNSS_BIT_API - -libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp - -if USE_GLIB -libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS) -libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif -libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la - - -libloc_eng_so_la_SOURCES = \ - loc_eng.cpp \ - loc_eng_agps.cpp \ - loc_eng_xtra.cpp \ - loc_eng_ni.cpp \ - loc_eng_log.cpp \ - loc_eng_dmn_conn.cpp \ - loc_eng_dmn_conn_handler.cpp \ - loc_eng_dmn_conn_thread_helper.c \ - loc_eng_dmn_conn_glue_msg.c \ - loc_eng_dmn_conn_glue_pipe.c - - -if USE_GLIB -libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_eng_so_la_CFLAGS = $(AM_CFLAGS) -libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la - - -libgps_default_so_la_SOURCES = \ - loc.cpp \ - gps.c - -if USE_GLIB -libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libgps_default_so_la_CFLAGS = $(AM_CFLAGS) -libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la - -library_include_HEADERS = \ - LocEngAdapter.h \ - loc.h \ - loc_eng.h \ - loc_eng_xtra.h \ - loc_eng_ni.h \ - loc_eng_agps.h \ - loc_eng_msg.h \ - loc_eng_log.h - -library_includedir = $(pkgincludedir)/libloc_api_50001 - -#Create and Install libraries -lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la libgps_default_so.la diff --git a/gps/loc_api/libloc_api_50001/gps.c b/gps/loc_api/libloc_api_50001/gps.c deleted file mode 100644 index 29f20f4..0000000 --- a/gps/loc_api/libloc_api_50001/gps.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (c) 2011,2015 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include - -#include -#include - -extern const GpsInterface* get_gps_interface(); - -const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev) -{ - return get_gps_interface(); -} - -static int open_gps(const struct hw_module_t* module, char const* name, - struct hw_device_t** device) -{ - struct gps_device_t *dev = (struct gps_device_t *) malloc(sizeof(struct gps_device_t)); - - if(dev == NULL) - return -1; - - memset(dev, 0, sizeof(*dev)); - - dev->common.tag = HARDWARE_DEVICE_TAG; - dev->common.version = 0; - dev->common.module = (struct hw_module_t*)module; - dev->get_gps_interface = gps__get_gps_interface; - - *device = (struct hw_device_t*)dev; - return 0; -} - -static struct hw_module_methods_t gps_module_methods = { - .open = open_gps -}; - -struct hw_module_t HAL_MODULE_INFO_SYM = { - .tag = HARDWARE_MODULE_TAG, - .module_api_version = 1, - .hal_api_version = 0, - .id = GPS_HARDWARE_MODULE_ID, - .name = "loc_api GPS Module", - .author = "Qualcomm USA, Inc.", - .methods = &gps_module_methods, -}; diff --git a/gps/loc_api/libloc_api_50001/loc.cpp b/gps/loc_api/libloc_api_50001/loc.cpp deleted file mode 100644 index ccefdc1..0000000 --- a/gps/loc_api/libloc_api_50001/loc.cpp +++ /dev/null @@ -1,1118 +0,0 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_afw" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace loc_core; - -#define LOC_PM_CLIENT_NAME "GPS" - -//Globals defns -static gps_location_callback gps_loc_cb = NULL; -static gps_sv_status_callback gps_sv_cb = NULL; -static gps_ni_notify_callback gps_ni_cb = NULL; - -static void local_loc_cb(UlpLocation* location, void* locExt); -static void local_sv_cb(GpsSvStatus* sv_status, void* svExt); -static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed); - -GpsNiExtCallbacks sGpsNiExtCallbacks = { - local_ni_cb -}; - -static const GpsGeofencingInterface* get_geofence_interface(void); - -// Function declarations for sLocEngInterface -static int loc_init(GpsCallbacks* callbacks); -static int loc_start(); -static int loc_stop(); -static void loc_cleanup(); -static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty); -static int loc_inject_location(double latitude, double longitude, float accuracy); -static void loc_delete_aiding_data(GpsAidingData f); -static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, - uint32_t preferred_time); -static const void* loc_get_extension(const char* name); -// Defines the GpsInterface in gps.h -static const GpsInterface sLocEngInterface = -{ - sizeof(GpsInterface), - loc_init, - loc_start, - loc_stop, - loc_cleanup, - loc_inject_time, - loc_inject_location, - loc_delete_aiding_data, - loc_set_position_mode, - loc_get_extension -}; - -// Function declarations for sLocEngAGpsInterface -static void loc_agps_init(AGpsCallbacks* callbacks); -static int loc_agps_open(const char* apn); -static int loc_agps_closed(); -static int loc_agps_open_failed(); -static int loc_agps_set_server(AGpsType type, const char *hostname, int port); -static int loc_agps_open_with_apniptype( const char* apn, ApnIpType apnIpType); - -static const AGpsInterface sLocEngAGpsInterface = -{ - sizeof(AGpsInterface), - loc_agps_init, - loc_agps_open, - loc_agps_closed, - loc_agps_open_failed, - loc_agps_set_server, - loc_agps_open_with_apniptype -}; - -static int loc_xtra_init(GpsXtraCallbacks* callbacks); -static int loc_xtra_inject_data(char* data, int length); - -static const GpsXtraInterface sLocEngXTRAInterface = -{ - sizeof(GpsXtraInterface), - loc_xtra_init, - loc_xtra_inject_data -}; - -static void loc_ni_init(GpsNiCallbacks *callbacks); -static void loc_ni_respond(int notif_id, GpsUserResponseType user_response); - -static const GpsNiInterface sLocEngNiInterface = -{ - sizeof(GpsNiInterface), - loc_ni_init, - loc_ni_respond, -}; - -static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks); -static void loc_gps_measurement_close(); - -static const GpsMeasurementInterface sLocEngGpsMeasurementInterface = -{ - sizeof(GpsMeasurementInterface), - loc_gps_measurement_init, - loc_gps_measurement_close -}; - -static void loc_agps_ril_init( AGpsRilCallbacks* callbacks ); -static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct); -static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid); -static void loc_agps_ril_ni_message(uint8_t *msg, size_t len); -static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info); -static void loc_agps_ril_update_network_availability(int avaiable, const char* apn); - -static const AGpsRilInterface sLocEngAGpsRilInterface = -{ - sizeof(AGpsRilInterface), - loc_agps_ril_init, - loc_agps_ril_set_ref_location, - loc_agps_ril_set_set_id, - loc_agps_ril_ni_message, - loc_agps_ril_update_network_state, - loc_agps_ril_update_network_availability -}; - -static int loc_agps_install_certificates(const DerEncodedCertificate* certificates, - size_t length); -static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints, - size_t length); - -static const SuplCertificateInterface sLocEngAGpsCertInterface = -{ - sizeof(SuplCertificateInterface), - loc_agps_install_certificates, - loc_agps_revoke_certificates -}; - -static void loc_configuration_update(const char* config_data, int32_t length); - -static const GnssConfigurationInterface sLocEngConfigInterface = -{ - sizeof(GnssConfigurationInterface), - loc_configuration_update -}; - -static loc_eng_data_s_type loc_afw_data; -static int gss_fd = -1; -static int sGnssType = GNSS_UNKNOWN; -/*=========================================================================== -FUNCTION gps_get_hardware_interface - -DESCRIPTION - Returns the GPS hardware interaface based on LOC API - if GPS is enabled. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -extern "C" const GpsInterface* gps_get_hardware_interface () -{ - ENTRY_LOG_CALLFLOW(); - const GpsInterface* ret_val; - - char propBuf[PROPERTY_VALUE_MAX]; - memset(propBuf, 0, sizeof(propBuf)); - - loc_eng_read_config(); - - // check to see if GPS should be disabled - platform_lib_abstraction_property_get("gps.disable", propBuf, ""); - if (propBuf[0] == '1') - { - LOC_LOGD("gps_get_interface returning NULL because gps.disable=1\n"); - ret_val = NULL; - } else { - ret_val = &sLocEngInterface; - } - - loc_eng_read_config(); - - EXIT_LOG(%p, ret_val); - return ret_val; -} - -// for gps.c -extern "C" const GpsInterface* get_gps_interface() -{ - unsigned int target = TARGET_DEFAULT; - loc_eng_read_config(); - - target = loc_get_target(); - LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - - sGnssType = getTargetGnssType(target); - switch (sGnssType) - { - case GNSS_GSS: - case GNSS_AUTO: - //APQ8064 - gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); - gss_fd = open("/dev/gss", O_RDONLY); - if (gss_fd < 0) { - LOC_LOGE("GSS open failed: %s\n", strerror(errno)); - } - else { - LOC_LOGD("GSS open success! CAPABILITIES %0lx\n", - gps_conf.CAPABILITIES); - } - break; - case GNSS_NONE: - //MPQ8064 - LOC_LOGE("No GPS HW on this target. Not returning interface."); - return NULL; - case GNSS_QCA1530: - // qca1530 chip is present - gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); - LOC_LOGD("qca1530 present: CAPABILITIES %0lx\n", gps_conf.CAPABILITIES); - break; - } - return &sLocEngInterface; -} - -/*=========================================================================== -FUNCTION loc_init - -DESCRIPTION - Initialize the location engine, this include setting up global datas - and registers location engien with loc api service. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/Ax - -===========================================================================*/ -static int loc_init(GpsCallbacks* callbacks) -{ - int retVal = -1; - unsigned int target = (unsigned int) -1; - ENTRY_LOG(); - LOC_API_ADAPTER_EVENT_MASK_T event; - - if (NULL == callbacks) { - LOC_LOGE("loc_init failed. cb = NULL\n"); - EXIT_LOG(%d, retVal); - return retVal; - } - - event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | - LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT | - LOC_API_ADAPTER_BIT_SATELLITE_REPORT | - LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST | - LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST | - LOC_API_ADAPTER_BIT_IOCTL_REPORT | - LOC_API_ADAPTER_BIT_STATUS_REPORT | - LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | - LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; - - target = loc_get_target(); - - /* If platform is "auto" and external dr enabled then enable - ** Measurement report and SV Polynomial report - */ - if((1 == gps_conf.EXTERNAL_DR_ENABLED)) - { - event |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT_REPORT | - LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; - } - - LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ - callbacks->status_cb, /* status_cb */ - local_sv_cb, /* sv_status_cb */ - callbacks->nmea_cb, /* nmea_cb */ - callbacks->set_capabilities_cb, /* set_capabilities_cb */ - callbacks->acquire_wakelock_cb, /* acquire_wakelock_cb */ - callbacks->release_wakelock_cb, /* release_wakelock_cb */ - callbacks->create_thread_cb, /* create_thread_cb */ - NULL, /* location_ext_parser */ - NULL, /* sv_ext_parser */ - callbacks->request_utc_time_cb, /* request_utc_time_cb */ - callbacks->set_system_info_cb, /* set_system_info_cb */ - callbacks->gnss_sv_status_cb, /* gnss_sv_status_cb */ - }; - - gps_loc_cb = callbacks->location_cb; - gps_sv_cb = callbacks->sv_status_cb; - - retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); - loc_afw_data.adapter->mSupportsAgpsRequests = !loc_afw_data.adapter->hasAgpsExtendedCapabilities(); - loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); - loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities() - && !loc_afw_data.adapter->hasNativeXtraClient(); - loc_afw_data.adapter->setGpsLockMsg(0); - loc_afw_data.adapter->requestUlp(ContextBase::getCarrierCapabilities()); - loc_afw_data.adapter->setXtraUserAgent(); - - if(retVal) { - LOC_LOGE("loc_eng_init() fail!"); - goto err; - } - - loc_afw_data.adapter->setPowerVoteRight(loc_get_target() == TARGET_QCA1530); - loc_afw_data.adapter->setPowerVote(true); - - LOC_LOGD("loc_eng_init() success!"); - -err: - EXIT_LOG(%d, retVal); - return retVal; -} - -/*=========================================================================== -FUNCTION loc_cleanup - -DESCRIPTION - Cleans location engine. The location client handle will be released. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_cleanup() -{ - ENTRY_LOG(); - - loc_afw_data.adapter->setPowerVote(false); - loc_afw_data.adapter->setGpsLockMsg(gps_conf.GPS_LOCK); - - loc_eng_cleanup(loc_afw_data); - gps_loc_cb = NULL; - gps_sv_cb = NULL; - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_start - -DESCRIPTION - Starts the tracking session - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_start() -{ - ENTRY_LOG(); - int ret_val = loc_eng_start(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_stop - -DESCRIPTION - Stops the tracking session - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_stop() -{ - ENTRY_LOG(); - int ret_val = -1; - ret_val = loc_eng_stop(loc_afw_data); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_set_position_mode - -DESCRIPTION - Sets the mode and fix frequency for the tracking session. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_set_position_mode(GpsPositionMode mode, - GpsPositionRecurrence recurrence, - uint32_t min_interval, - uint32_t preferred_accuracy, - uint32_t preferred_time) -{ - ENTRY_LOG(); - int ret_val = -1; - LocPositionMode locMode; - switch (mode) { - case GPS_POSITION_MODE_MS_BASED: - locMode = LOC_POSITION_MODE_MS_BASED; - break; - case GPS_POSITION_MODE_MS_ASSISTED: - locMode = LOC_POSITION_MODE_MS_ASSISTED; - break; - default: - locMode = LOC_POSITION_MODE_STANDALONE; - break; - } - - // set position sharing option to true - bool sharePosition = true; - - LocPosMode params(locMode, recurrence, min_interval, - preferred_accuracy, preferred_time, - sharePosition, NULL, NULL); - ret_val = loc_eng_set_position_mode(loc_afw_data, params); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_inject_time - -DESCRIPTION - This is used by Java native function to do time injection. - -DEPENDENCIES - None - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty) -{ - ENTRY_LOG(); - int ret_val = 0; - - ret_val = loc_eng_inject_time(loc_afw_data, time, - timeReference, uncertainty); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - - -/*=========================================================================== -FUNCTION loc_inject_location - -DESCRIPTION - This is used by Java native function to do location injection. - -DEPENDENCIES - None - -RETURN VALUE - 0 : Successful - error code : Failure - -SIDE EFFECTS - N/A -===========================================================================*/ -static int loc_inject_location(double latitude, double longitude, float accuracy) -{ - ENTRY_LOG(); - - int ret_val = 0; - ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - - -/*=========================================================================== -FUNCTION loc_delete_aiding_data - -DESCRIPTION - This is used by Java native function to delete the aiding data. The function - updates the global variable for the aiding data to be deleted. If the GPS - engine is off, the aiding data will be deleted. Otherwise, the actual action - will happen when gps engine is turned off. - -DEPENDENCIES - Assumes the aiding data type specified in GpsAidingData matches with - LOC API specification. - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_delete_aiding_data(GpsAidingData f) -{ - ENTRY_LOG(); - - loc_eng_delete_aiding_data(loc_afw_data, f); - - EXIT_LOG(%s, VOID_RET); -} - -const GpsGeofencingInterface* get_geofence_interface(void) -{ - ENTRY_LOG(); - void *handle; - const char *error; - typedef const GpsGeofencingInterface* (*get_gps_geofence_interface_function) (void); - get_gps_geofence_interface_function get_gps_geofence_interface; - static const GpsGeofencingInterface* geofence_interface = NULL; - - dlerror(); /* Clear any existing error */ - - handle = dlopen ("libgeofence.so", RTLD_NOW); - - if (!handle) - { - if ((error = dlerror()) != NULL) { - LOC_LOGE ("%s, dlopen for libgeofence.so failed, error = %s\n", __func__, error); - } - goto exit; - } - dlerror(); /* Clear any existing error */ - get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL) { - LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); - goto exit; - } - if (NULL == get_gps_geofence_interface) { - LOC_LOGE ("%s, get_gps_geofence_interface is NULL\n", __func__); - goto exit; - } - - geofence_interface = get_gps_geofence_interface(); - -exit: - EXIT_LOG(%d, geofence_interface == NULL); - return geofence_interface; -} -/*=========================================================================== -FUNCTION loc_get_extension - -DESCRIPTION - Get the gps extension to support XTRA. - -DEPENDENCIES - N/A - -RETURN VALUE - The GPS extension interface. - -SIDE EFFECTS - N/A - -===========================================================================*/ -const void* loc_get_extension(const char* name) -{ - ENTRY_LOG(); - const void* ret_val = NULL; - - LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); - if (strcmp(name, GPS_XTRA_INTERFACE) == 0) - { - ret_val = &sLocEngXTRAInterface; - } - else if (strcmp(name, AGPS_INTERFACE) == 0) - { - ret_val = &sLocEngAGpsInterface; - } - else if (strcmp(name, GPS_NI_INTERFACE) == 0) - { - ret_val = &sLocEngNiInterface; - } - else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) - { - char baseband[PROPERTY_VALUE_MAX]; - platform_lib_abstraction_property_get("ro.baseband", baseband, "msm"); - if (strcmp(baseband, "csfb") == 0) - { - ret_val = &sLocEngAGpsRilInterface; - } - } - else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) - { - if ((gps_conf.CAPABILITIES | GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){ - ret_val = get_geofence_interface(); - } - } - else if (strcmp(name, SUPL_CERTIFICATE_INTERFACE) == 0) - { - ret_val = &sLocEngAGpsCertInterface; - } - else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0) - { - ret_val = &sLocEngConfigInterface; - } - else if (strcmp(name, GPS_MEASUREMENT_INTERFACE) == 0) - { - ret_val = &sLocEngGpsMeasurementInterface; - } - else - { - LOC_LOGE ("get_extension: Invalid interface passed in\n"); - } - EXIT_LOG(%p, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_agps_init - -DESCRIPTION - Initialize the AGps interface. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_agps_init(AGpsCallbacks* callbacks) -{ - ENTRY_LOG(); - loc_eng_agps_init(loc_afw_data, (AGpsExtCallbacks*)callbacks); - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_agps_open - -DESCRIPTION - This function is called when on-demand data connection opening is successful. -It should inform ARM 9 about the data open result. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_agps_open(const char* apn) -{ - ENTRY_LOG(); - AGpsType agpsType = AGPS_TYPE_SUPL; - AGpsBearerType bearerType = AGPS_APN_BEARER_IPV4; - int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_agps_open_with_apniptype - -DESCRIPTION - This function is called when on-demand data connection opening is successful. -It should inform ARM 9 about the data open result. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType) -{ - ENTRY_LOG(); - AGpsType agpsType = AGPS_TYPE_SUPL; - AGpsBearerType bearerType; - - switch (apnIpType) { - case APN_IP_IPV4: - bearerType = AGPS_APN_BEARER_IPV4; - break; - case APN_IP_IPV6: - bearerType = AGPS_APN_BEARER_IPV6; - break; - case APN_IP_IPV4V6: - bearerType = AGPS_APN_BEARER_IPV4V6; - break; - default: - bearerType = AGPS_APN_BEARER_IPV4; - break; - } - - int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_agps_closed - -DESCRIPTION - This function is called when on-demand data connection closing is done. -It should inform ARM 9 about the data close result. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_agps_closed() -{ - ENTRY_LOG(); - AGpsType agpsType = AGPS_TYPE_SUPL; - int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_agps_open_failed - -DESCRIPTION - This function is called when on-demand data connection opening has failed. -It should inform ARM 9 about the data open result. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_agps_open_failed() -{ - ENTRY_LOG(); - AGpsType agpsType = AGPS_TYPE_SUPL; - int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_agps_set_server - -DESCRIPTION - If loc_eng_set_server is called before loc_eng_init, it doesn't work. This - proxy buffers server settings and calls loc_eng_set_server when the client is - open. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_agps_set_server(AGpsType type, const char* hostname, int port) -{ - ENTRY_LOG(); - LocServerType serverType; - switch (type) { - case AGPS_TYPE_SUPL: - serverType = LOC_AGPS_SUPL_SERVER; - break; - case AGPS_TYPE_C2K: - serverType = LOC_AGPS_CDMA_PDE_SERVER; - break; - default: - serverType = LOC_AGPS_SUPL_SERVER; - } - int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTIONf571 - loc_xtra_init - -DESCRIPTION - Initialize XTRA module. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_xtra_init(GpsXtraCallbacks* callbacks) -{ - ENTRY_LOG(); - GpsXtraExtCallbacks extCallbacks; - memset(&extCallbacks, 0, sizeof(extCallbacks)); - extCallbacks.download_request_cb = callbacks->download_request_cb; - int ret_val = loc_eng_xtra_init(loc_afw_data, &extCallbacks); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - - -/*=========================================================================== -FUNCTION loc_xtra_inject_data - -DESCRIPTION - Initialize XTRA module. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_xtra_inject_data(char* data, int length) -{ - ENTRY_LOG(); - int ret_val = -1; - if( (data != NULL) && ((unsigned int)length <= XTRA_DATA_MAX_SIZE)) - ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length); - else - LOC_LOGE("%s, Could not inject XTRA data. Buffer address: %p, length: %d", - __func__, data, length); - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_gps_measurement_init - -DESCRIPTION - This function initializes the gps measurement interface - -DEPENDENCIES - NONE - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks) -{ - ENTRY_LOG(); - int ret_val = loc_eng_gps_measurement_init(loc_afw_data, - callbacks); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_gps_measurement_close - -DESCRIPTION - This function closes the gps measurement interface - -DEPENDENCIES - NONE - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_gps_measurement_close() -{ - ENTRY_LOG(); - loc_eng_gps_measurement_close(loc_afw_data); - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_ni_init - -DESCRIPTION - This function initializes the NI interface - -DEPENDENCIES - NONE - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_ni_init(GpsNiCallbacks *callbacks) -{ - ENTRY_LOG(); - gps_ni_cb = callbacks->notify_cb; - loc_eng_ni_init(loc_afw_data, &sGpsNiExtCallbacks); - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_ni_respond - -DESCRIPTION - This function sends an NI respond to the modem processor - -DEPENDENCIES - NONE - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_ni_respond(int notif_id, GpsUserResponseType user_response) -{ - ENTRY_LOG(); - loc_eng_ni_respond(loc_afw_data, notif_id, user_response); - EXIT_LOG(%s, VOID_RET); -} - -// Below stub functions are members of sLocEngAGpsRilInterface -static void loc_agps_ril_init( AGpsRilCallbacks* callbacks ) {} -static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct) {} -static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid) {} -static void loc_agps_ril_ni_message(uint8_t *msg, size_t len) {} -static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info) {} - -/*=========================================================================== -FUNCTION loc_agps_ril_update_network_availability - -DESCRIPTION - Sets data call allow vs disallow flag to modem - This is the only member of sLocEngAGpsRilInterface implemented. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_agps_ril_update_network_availability(int available, const char* apn) -{ - ENTRY_LOG(); - loc_eng_agps_ril_update_network_availability(loc_afw_data, available, apn); - EXIT_LOG(%s, VOID_RET); -} - -static int loc_agps_install_certificates(const DerEncodedCertificate* certificates, - size_t length) -{ - ENTRY_LOG(); - int ret_val = loc_eng_agps_install_certificates(loc_afw_data, certificates, length); - EXIT_LOG(%d, ret_val); - return ret_val; -} -static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints, - size_t length) -{ - ENTRY_LOG(); - LOC_LOGE("%s:%d]: agps_revoke_certificates not supported"); - int ret_val = AGPS_CERTIFICATE_ERROR_GENERIC; - EXIT_LOG(%d, ret_val); - return ret_val; -} - -static void loc_configuration_update(const char* config_data, int32_t length) -{ - ENTRY_LOG(); - loc_eng_configuration_update(loc_afw_data, config_data, length); - switch (sGnssType) - { - case GNSS_GSS: - case GNSS_AUTO: - case GNSS_QCA1530: - //APQ - gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); - break; - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_loc_cb(UlpLocation* location, void* locExt) -{ - ENTRY_LOG(); - if (NULL != location) { - CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); - - if (NULL != gps_loc_cb) { - gps_loc_cb(&location->gpsLocation); - } - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) -{ - ENTRY_LOG(); - if (NULL != gps_sv_cb) { - CALLBACK_LOG_CALLFLOW("sv_status_cb -", %d, sv_status->num_svs); - gps_sv_cb(sv_status); - } - EXIT_LOG(%s, VOID_RET); -} - -static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed) -{ - if (NULL != gps_ni_cb) { - gps_ni_cb(notification); - } -} - diff --git a/gps/loc_api/libloc_api_50001/loc.h b/gps/loc_api/libloc_api_50001/loc.h deleted file mode 100644 index 8cf77fc..0000000 --- a/gps/loc_api/libloc_api_50001/loc.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef __LOC_H__ -#define __LOC_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include -#include - -#define XTRA_DATA_MAX_SIZE 100000 /*bytes*/ - -typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt); -typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt); -typedef void* (*loc_ext_parser)(void* data); - -typedef struct { - loc_location_cb_ext location_cb; - gps_status_callback status_cb; - loc_sv_status_cb_ext sv_status_cb; - gps_nmea_callback nmea_cb; - gps_set_capabilities set_capabilities_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - gps_create_thread create_thread_cb; - loc_ext_parser location_ext_parser; - loc_ext_parser sv_ext_parser; - gps_request_utc_time request_utc_time_cb; - gnss_set_system_info set_system_info_cb; - gnss_sv_status_callback gnss_sv_status_cb; -} LocCallbacks; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif //__LOC_H__ diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp deleted file mode 100644 index 29215fc..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng.cpp +++ /dev/null @@ -1,3081 +0,0 @@ -/* Copyright (c) 2009-2016, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_eng" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* struct sockaddr_in */ -#include -#include -#include -#include -#include -#include - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "loc_core_log.h" -#include "loc_eng_log.h" - -#define SUCCESS TRUE -#define FAILURE FALSE - -#ifndef GPS_CONF_FILE -#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent -#endif - -#ifndef SAP_CONF_FILE -#define SAP_CONF_FILE "/etc/sap.conf" -#endif - -#define XTRA1_GPSONEXTRA "xtra1.gpsonextra.net" - -using namespace loc_core; - -boolean configAlreadyRead = false; -unsigned int agpsStatus = 0; - -/* Parameter spec table */ -static const loc_param_s_type gps_conf_table[] = -{ - {"GPS_LOCK", &gps_conf.GPS_LOCK, NULL, 'n'}, - {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, - {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, - {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, - {"LPPE_CP_TECHNOLOGY", &gps_conf.LPPE_CP_TECHNOLOGY, NULL, 'n'}, - {"LPPE_UP_TECHNOLOGY", &gps_conf.LPPE_UP_TECHNOLOGY, NULL, 'n'}, - {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'}, - {"SUPL_MODE", &gps_conf.SUPL_MODE, NULL, 'n'}, - {"SUPL_ES", &gps_conf.SUPL_ES, NULL, 'n'}, - {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'}, - {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'}, - {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'}, - {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, - {"XTRA_VERSION_CHECK", &gps_conf.XTRA_VERSION_CHECK, NULL, 'n'}, - {"XTRA_SERVER_1", &gps_conf.XTRA_SERVER_1, NULL, 's'}, - {"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'}, - {"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'}, - {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, - {"AGPS_CONFIG_INJECT", &gps_conf.AGPS_CONFIG_INJECT, NULL, 'n'}, - {"EXTERNAL_DR_ENABLED", &gps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'}, -}; - -static const loc_param_s_type sap_conf_table[] = -{ - {"GYRO_BIAS_RANDOM_WALK", &sap_conf.GYRO_BIAS_RANDOM_WALK, &sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'}, - {"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, - {"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, - {"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, - {"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, - {"SENSOR_ACCEL_BATCHES_PER_SEC", &sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'}, - {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'}, - {"SENSOR_GYRO_BATCHES_PER_SEC", &sap_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'}, - {"SENSOR_GYRO_SAMPLES_PER_BATCH", &sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'}, - {"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'}, - {"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, - {"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'}, - {"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, - {"SENSOR_CONTROL_MODE", &sap_conf.SENSOR_CONTROL_MODE, NULL, 'n'}, - {"SENSOR_USAGE", &sap_conf.SENSOR_USAGE, NULL, 'n'}, - {"SENSOR_ALGORITHM_CONFIG_MASK", &sap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}, - {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'} -}; - -static void loc_default_parameters(void) -{ - /*Defaults for gps.conf*/ - gps_conf.INTERMEDIATE_POS = 0; - gps_conf.ACCURACY_THRES = 0; - gps_conf.NMEA_PROVIDER = 0; - gps_conf.GPS_LOCK = 0; - gps_conf.SUPL_VER = 0x10000; - gps_conf.SUPL_MODE = 0x3; - gps_conf.SUPL_ES = 0; - gps_conf.CAPABILITIES = 0x7; - /* LTE Positioning Profile configuration is disable by default*/ - gps_conf.LPP_PROFILE = 0; - /*By default no positioning protocol is selected on A-GLONASS system*/ - gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; - /*XTRA version check is disabled by default*/ - gps_conf.XTRA_VERSION_CHECK=0; - /*Use emergency PDN by default*/ - gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1; - /* By default no LPPe CP technology is enabled*/ - gps_conf.LPPE_CP_TECHNOLOGY = 0; - /* By default no LPPe UP technology is enabled*/ - gps_conf.LPPE_UP_TECHNOLOGY = 0; - - /*Defaults for sap.conf*/ - sap_conf.GYRO_BIAS_RANDOM_WALK = 0; - sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; - sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; - sap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; - sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; - sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4; - sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25; - sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4; - sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25; - sap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ - sap_conf.SENSOR_USAGE = 0; /* Enabled */ - sap_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/ - /* Values MUST be set by OEMs in configuration for sensor-assisted - navigation to work. There are NO default values */ - sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0; - sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0; - sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0; - sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0; - sap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; - sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; - /* default provider is SSC */ - sap_conf.SENSOR_PROVIDER = 1; - - /* None of the 10 slots for agps certificates are writable by default */ - gps_conf.AGPS_CERT_WRITABLE_MASK = 0; - - /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ - gps_conf.AGPS_CONFIG_INJECT = 1; -} - -// 2nd half of init(), singled out for -// modem restart to use. -static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data); -static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data); - -static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, - LocServerType type, const char *hostname, int port); -// Internal functions -static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, - GpsStatusValue status); -static void loc_eng_report_status(loc_eng_data_s_type &loc_eng_data, - GpsStatusValue status); -static void loc_eng_process_conn_request(loc_eng_data_s_type &loc_eng_data, - int connHandle, AGpsType agps_type); -static void loc_eng_agps_close_status(loc_eng_data_s_type &loc_eng_data, int is_succ); -static void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data) ; -static void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) ; - -static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data); -static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data); -static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data); -static void deleteAidingData(loc_eng_data_s_type &logEng); -static AgpsStateMachine* -getAgpsStateMachine(loc_eng_data_s_type& logEng, AGpsExtType agpsType); -static void createAgnssNifs(loc_eng_data_s_type& locEng); -static int dataCallCb(void *cb_data); -static void update_aiding_data_for_deletion(loc_eng_data_s_type& loc_eng_data) { - if (loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON && - loc_eng_data.aiding_data_for_deletion != 0) - { - loc_eng_data.adapter->deleteAidingData(loc_eng_data.aiding_data_for_deletion); - loc_eng_data.aiding_data_for_deletion = 0; - } -} - -static void* noProc(void* data) -{ - return NULL; -} - -/********************************************************************* - * definitions of the static messages used in the file - *********************************************************************/ -// case LOC_ENG_MSG_REQUEST_NI: -LocEngRequestNi::LocEngRequestNi(void* locEng, - GpsNiNotification ¬if, - const void* data) : - LocMsg(), mLocEng(locEng), mNotify(notif), mPayload(data) { - locallog(); -} -void LocEngRequestNi::proc() const { - loc_eng_ni_request_handler(*((loc_eng_data_s_type*)mLocEng), - &mNotify, mPayload); -} -void LocEngRequestNi::locallog() const -{ - LOC_LOGV("id: %d\n type: %s\n flags: %d\n time out: %d\n " - "default response: %s\n requestor id encoding: %s\n" - " text encoding: %s\n passThroughData: %p", - mNotify.notification_id, - loc_get_ni_type_name(mNotify.ni_type), - mNotify.notify_flags, - mNotify.timeout, - loc_get_ni_response_name(mNotify.default_response), - loc_get_ni_encoding_name(mNotify.requestor_id_encoding), - loc_get_ni_encoding_name(mNotify.text_encoding), - mPayload); -} -inline void LocEngRequestNi::log() const { - locallog(); -} - -// case LOC_ENG_MSG_INFORM_NI_RESPONSE: -// in loc_eng_ni.cpp - -// case LOC_ENG_MSG_START_FIX: -LocEngStartFix::LocEngStartFix(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) -{ - locallog(); -} -inline void LocEngStartFix::proc() const -{ - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); - loc_eng_start_handler(*locEng); -} -inline void LocEngStartFix::locallog() const -{ - LOC_LOGV("LocEngStartFix"); -} -inline void LocEngStartFix::log() const -{ - locallog(); -} -void LocEngStartFix::send() const { - mAdapter->sendMsg(this); -} - -// case LOC_ENG_MSG_STOP_FIX: -LocEngStopFix::LocEngStopFix(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) -{ - locallog(); -} -inline void LocEngStopFix::proc() const -{ - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); - mAdapter->clearGnssSvUsedListData(); - loc_eng_stop_handler(*locEng); -} -inline void LocEngStopFix::locallog() const -{ - LOC_LOGV("LocEngStopFix"); -} -inline void LocEngStopFix::log() const -{ - locallog(); -} -void LocEngStopFix::send() const { - mAdapter->sendMsg(this); -} - -// case LOC_ENG_MSG_SET_POSITION_MODE: -LocEngPositionMode::LocEngPositionMode(LocEngAdapter* adapter, - LocPosMode &mode) : - LocMsg(), mAdapter(adapter), mPosMode(mode) -{ - mPosMode.logv(); -} -inline void LocEngPositionMode::proc() const { - mAdapter->setPositionMode(&mPosMode); -} -inline void LocEngPositionMode::log() const { - mPosMode.logv(); -} -void LocEngPositionMode::send() const { - mAdapter->sendMsg(this); -} - -LocEngGetZpp::LocEngGetZpp(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) -{ - locallog(); -} -inline void LocEngGetZpp::proc() const -{ - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); - loc_eng_get_zpp_handler(*locEng); -} -inline void LocEngGetZpp::locallog() const -{ - LOC_LOGV("LocEngGetZpp"); -} -inline void LocEngGetZpp::log() const -{ - locallog(); -} -void LocEngGetZpp::send() const { - mAdapter->sendMsg(this); -} - -struct LocEngSetTime : public LocMsg { - LocEngAdapter* mAdapter; - const GpsUtcTime mTime; - const int64_t mTimeReference; - const int mUncertainty; - inline LocEngSetTime(LocEngAdapter* adapter, - GpsUtcTime t, int64_t tf, int unc) : - LocMsg(), mAdapter(adapter), - mTime(t), mTimeReference(tf), mUncertainty(unc) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setTime(mTime, mTimeReference, mUncertainty); - } - inline void locallog() const { - LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", - mTime, mTimeReference, mUncertainty); - } - inline virtual void log() const { - locallog(); - } -}; - - // case LOC_ENG_MSG_INJECT_LOCATION: -struct LocEngInjectLocation : public LocMsg { - LocEngAdapter* mAdapter; - const double mLatitude; - const double mLongitude; - const float mAccuracy; - inline LocEngInjectLocation(LocEngAdapter* adapter, - double lat, double lon, float accur) : - LocMsg(), mAdapter(adapter), - mLatitude(lat), mLongitude(lon), mAccuracy(accur) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->injectPosition(mLatitude, mLongitude, mAccuracy); - } - inline void locallog() const { - LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", - mLatitude, mLongitude, mAccuracy); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_SET_SERVER_IPV4: -struct LocEngSetServerIpv4 : public LocMsg { - LocEngAdapter* mAdapter; - const unsigned int mNlAddr; - const int mPort; - const LocServerType mServerType; - inline LocEngSetServerIpv4(LocEngAdapter* adapter, - unsigned int ip, - int port, - LocServerType type) : - LocMsg(), mAdapter(adapter), - mNlAddr(ip), mPort(port), mServerType(type) - { - locallog(); - } - inline virtual void proc() const { - if (gps_conf.AGPS_CONFIG_INJECT) { - mAdapter->setServer(mNlAddr, mPort, mServerType); - } - } - inline void locallog() const { - LOC_LOGV("LocEngSetServerIpv4 - addr: %x, port: %d, type: %s", - mNlAddr, mPort, loc_get_server_type_name(mServerType)); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_SET_SERVER_URL: -struct LocEngSetServerUrl : public LocMsg { - LocEngAdapter* mAdapter; - const int mLen; - char* mUrl; - inline LocEngSetServerUrl(LocEngAdapter* adapter, - char* urlString, - int url_len) : - LocMsg(), mAdapter(adapter), - mLen(url_len), mUrl(new char[mLen+1]) - { - memcpy((void*)mUrl, (void*)urlString, url_len); - mUrl[mLen] = 0; - locallog(); - } - inline ~LocEngSetServerUrl() - { - delete[] mUrl; - } - inline virtual void proc() const { - if (gps_conf.AGPS_CONFIG_INJECT) { - mAdapter->setServer(mUrl, mLen); - } - } - inline void locallog() const { - LOC_LOGV("LocEngSetServerUrl - url: %s", mUrl); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_A_GLONASS_PROTOCOL: -struct LocEngAGlonassProtocol : public LocMsg { - LocEngAdapter* mAdapter; - const unsigned long mAGlonassProtocl; - inline LocEngAGlonassProtocol(LocEngAdapter* adapter, - unsigned long protocol) : - LocMsg(), mAdapter(adapter), mAGlonassProtocl(protocol) - { - locallog(); - } - inline virtual void proc() const { - if (gps_conf.AGPS_CONFIG_INJECT) { - mAdapter->setAGLONASSProtocol(mAGlonassProtocl); - } - } - inline void locallog() const { - LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl); - } - inline virtual void log() const { - locallog(); - } -}; - - -struct LocEngLPPeProtocol : public LocMsg { - LocEngAdapter* mAdapter; - const unsigned long mLPPeCP; - const unsigned long mLPPeUP; - inline LocEngLPPeProtocol(LocEngAdapter* adapter, - unsigned long lppeCP, unsigned long lppeUP) : - LocMsg(), mAdapter(adapter), mLPPeCP(lppeCP), mLPPeUP(lppeUP) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setLPPeProtocol(mLPPeCP, mLPPeUP); - } - inline void locallog() const { - LOC_LOGV("LPPe CP: 0x%lx LPPe UP: 0x%1x", mLPPeCP, mLPPeUP); - } - inline virtual void log() const { - locallog(); - } -}; - - -// case LOC_ENG_MSG_SUPL_VERSION: -struct LocEngSuplVer : public LocMsg { - LocEngAdapter* mAdapter; - const int mSuplVer; - inline LocEngSuplVer(LocEngAdapter* adapter, - int suplVer) : - LocMsg(), mAdapter(adapter), mSuplVer(suplVer) - { - locallog(); - } - inline virtual void proc() const { - if (gps_conf.AGPS_CONFIG_INJECT) { - mAdapter->setSUPLVersion(mSuplVer); - } - } - inline void locallog() const { - LOC_LOGV("SUPL Version: %d", mSuplVer); - } - inline virtual void log() const { - locallog(); - } -}; - -struct LocEngSuplMode : public LocMsg { - LocEngAdapter* mAdapter; - - inline LocEngSuplMode(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->getUlpProxy()->setCapabilities(ContextBase::getCarrierCapabilities()); - } - inline void locallog() const { - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_SET_NMEA_TYPE: -struct LocEngSetNmeaTypes : public LocMsg { - LocEngAdapter* mAdapter; - uint32_t nmeaTypesMask; - inline LocEngSetNmeaTypes(LocEngAdapter* adapter, - uint32_t typesMask) : - LocMsg(), mAdapter(adapter), nmeaTypesMask(typesMask) - { - locallog(); - } - inline virtual void proc() const { - // set the nmea types - mAdapter->setNMEATypes(nmeaTypesMask); - } - inline void locallog() const - { - LOC_LOGV("LocEngSetNmeaTypes %u\n",nmeaTypesMask); - } - inline virtual void log() const - { - locallog(); - } -}; - - -// case LOC_ENG_MSG_LPP_CONFIG: -struct LocEngLppConfig : public LocMsg { - LocEngAdapter* mAdapter; - const int mLppConfig; - inline LocEngLppConfig(LocEngAdapter* adapter, - int lppConfig) : - LocMsg(), mAdapter(adapter), mLppConfig(lppConfig) - { - locallog(); - } - inline virtual void proc() const { - if (gps_conf.AGPS_CONFIG_INJECT) { - mAdapter->setLPPConfig(mLppConfig); - } - } - inline void locallog() const { - LOC_LOGV("LocEngLppConfig - profile: %d", mLppConfig); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: -struct LocEngSensorControlConfig : public LocMsg { - LocEngAdapter* mAdapter; - const int mSensorsDisabled; - const int mSensorProvider; - inline LocEngSensorControlConfig(LocEngAdapter* adapter, - int sensorsDisabled, int sensorProvider) : - LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled), - mSensorProvider(sensorProvider) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setSensorControlConfig(mSensorsDisabled, mSensorProvider); - } - inline void locallog() const { - LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d, Sensor Provider: %d", - mSensorsDisabled, mSensorProvider); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: -struct LocEngSensorProperties : public LocMsg { - LocEngAdapter* mAdapter; - const bool mGyroBiasVarianceRandomWalkValid; - const float mGyroBiasVarianceRandomWalk; - const bool mAccelRandomWalkValid; - const float mAccelRandomWalk; - const bool mAngleRandomWalkValid; - const float mAngleRandomWalk; - const bool mRateRandomWalkValid; - const float mRateRandomWalk; - const bool mVelocityRandomWalkValid; - const float mVelocityRandomWalk; - inline LocEngSensorProperties(LocEngAdapter* adapter, - bool gyroBiasRandomWalk_valid, - float gyroBiasRandomWalk, - bool accelRandomWalk_valid, - float accelRandomWalk, - bool angleRandomWalk_valid, - float angleRandomWalk, - bool rateRandomWalk_valid, - float rateRandomWalk, - bool velocityRandomWalk_valid, - float velocityRandomWalk) : - LocMsg(), mAdapter(adapter), - mGyroBiasVarianceRandomWalkValid(gyroBiasRandomWalk_valid), - mGyroBiasVarianceRandomWalk(gyroBiasRandomWalk), - mAccelRandomWalkValid(accelRandomWalk_valid), - mAccelRandomWalk(accelRandomWalk), - mAngleRandomWalkValid(angleRandomWalk_valid), - mAngleRandomWalk(angleRandomWalk), - mRateRandomWalkValid(rateRandomWalk_valid), - mRateRandomWalk(rateRandomWalk), - mVelocityRandomWalkValid(velocityRandomWalk_valid), - mVelocityRandomWalk(velocityRandomWalk) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setSensorProperties(mGyroBiasVarianceRandomWalkValid, - mGyroBiasVarianceRandomWalk, - mAccelRandomWalkValid, - mAccelRandomWalk, - mAngleRandomWalkValid, - mAngleRandomWalk, - mRateRandomWalkValid, - mRateRandomWalk, - mVelocityRandomWalkValid, - mVelocityRandomWalk); - } - inline void locallog() const { - LOC_LOGV("Sensor properties validity, Gyro Random walk: %d " - "Accel Random Walk: %d " - "Angle Random Walk: %d Rate Random Walk: %d " - "Velocity Random Walk: %d\n" - "Sensor properties, Gyro Random walk: %f " - "Accel Random Walk: %f " - "Angle Random Walk: %f Rate Random Walk: %f " - "Velocity Random Walk: %f", - mGyroBiasVarianceRandomWalkValid, - mAccelRandomWalkValid, - mAngleRandomWalkValid, - mRateRandomWalkValid, - mVelocityRandomWalkValid, - mGyroBiasVarianceRandomWalk, - mAccelRandomWalk, - mAngleRandomWalk, - mRateRandomWalk, - mVelocityRandomWalk - ); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: -struct LocEngSensorPerfControlConfig : public LocMsg { - LocEngAdapter* mAdapter; - const int mControlMode; - const int mAccelSamplesPerBatch; - const int mAccelBatchesPerSec; - const int mGyroSamplesPerBatch; - const int mGyroBatchesPerSec; - const int mAccelSamplesPerBatchHigh; - const int mAccelBatchesPerSecHigh; - const int mGyroSamplesPerBatchHigh; - const int mGyroBatchesPerSecHigh; - const int mAlgorithmConfig; - inline LocEngSensorPerfControlConfig(LocEngAdapter* adapter, - int controlMode, - int accelSamplesPerBatch, - int accelBatchesPerSec, - int gyroSamplesPerBatch, - int gyroBatchesPerSec, - int accelSamplesPerBatchHigh, - int accelBatchesPerSecHigh, - int gyroSamplesPerBatchHigh, - int gyroBatchesPerSecHigh, - int algorithmConfig) : - LocMsg(), mAdapter(adapter), - mControlMode(controlMode), - mAccelSamplesPerBatch(accelSamplesPerBatch), - mAccelBatchesPerSec(accelBatchesPerSec), - mGyroSamplesPerBatch(gyroSamplesPerBatch), - mGyroBatchesPerSec(gyroBatchesPerSec), - mAccelSamplesPerBatchHigh(accelSamplesPerBatchHigh), - mAccelBatchesPerSecHigh(accelBatchesPerSecHigh), - mGyroSamplesPerBatchHigh(gyroSamplesPerBatchHigh), - mGyroBatchesPerSecHigh(gyroBatchesPerSecHigh), - mAlgorithmConfig(algorithmConfig) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->setSensorPerfControlConfig(mControlMode, - mAccelSamplesPerBatch, - mAccelBatchesPerSec, - mGyroSamplesPerBatch, - mGyroBatchesPerSec, - mAccelSamplesPerBatchHigh, - mAccelBatchesPerSecHigh, - mGyroSamplesPerBatchHigh, - mGyroBatchesPerSecHigh, - mAlgorithmConfig); - } - inline void locallog() const { - LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " - "accel(#smp,#batches) (%u,%u) " - "gyro(#smp,#batches) (%u,%u), " - "accel_high(#smp,#batches) (%u,%u) " - "gyro_high(#smp,#batches) (%u,%u), " - "algorithmConfig(%u)\n", - mControlMode, - mAccelSamplesPerBatch, mAccelBatchesPerSec, - mGyroSamplesPerBatch, mGyroBatchesPerSec, - mAccelSamplesPerBatchHigh, mAccelBatchesPerSecHigh, - mGyroSamplesPerBatchHigh, mGyroBatchesPerSecHigh, - mAlgorithmConfig); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_REPORT_POSITION: -LocEngReportPosition::LocEngReportPosition(LocAdapterBase* adapter, - UlpLocation &loc, - GpsLocationExtended &locExtended, - void* locExt, - enum loc_sess_status st, - LocPosTechMask technology) : - LocMsg(), mAdapter(adapter), mLocation(loc), - mLocationExtended(locExtended), - mLocationExt(((loc_eng_data_s_type*) - ((LocEngAdapter*) - (mAdapter))->getOwner())->location_ext_parser(locExt)), - mStatus(st), mTechMask(technology) -{ - locallog(); -} -void LocEngReportPosition::proc() const { - LocEngAdapter* adapter = (LocEngAdapter*)mAdapter; - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner(); - - if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION) { - bool reported = false; - if (locEng->location_cb != NULL) { - if (LOC_SESS_FAILURE == mStatus) { - // in case we want to handle the failure case - locEng->location_cb(NULL, NULL); - reported = true; - } - // what's in the else if is... (line by line) - // 1. this is a final fix; and - // 1.1 it is a Satellite fix; or - // 1.2 it is a sensor fix - // 2. (must be intermediate fix... implicit) - // 2.1 we accepte intermediate; and - // 2.2 it is NOT the case that - // 2.2.1 there is inaccuracy; and - // 2.2.2 we care about inaccuracy; and - // 2.2.3 the inaccuracy exceeds our tolerance - else if ((LOC_SESS_SUCCESS == mStatus && - ((LOC_POS_TECH_MASK_SATELLITE | - LOC_POS_TECH_MASK_SENSORS | - LOC_POS_TECH_MASK_HYBRID) & - mTechMask)) || - (LOC_SESS_INTERMEDIATE == locEng->intermediateFix && - !((mLocation.gpsLocation.flags & - GPS_LOCATION_HAS_ACCURACY) && - (gps_conf.ACCURACY_THRES != 0) && - (mLocation.gpsLocation.accuracy > - gps_conf.ACCURACY_THRES)))) { - if (mLocationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA) - { - adapter->setGnssSvUsedListData(mLocationExtended.gnss_sv_used_ids); - } - locEng->location_cb((UlpLocation*)&(mLocation), - (void*)mLocationExt); - reported = true; - } - } - - // if we have reported this fix - if (reported && - // and if this is a singleshot - GPS_POSITION_RECURRENCE_SINGLE == - locEng->adapter->getPositionMode().recurrence) { - if (LOC_SESS_INTERMEDIATE == mStatus) { - // modem could be still working for a final fix, - // although we no longer need it. So stopFix(). - locEng->adapter->stopFix(); - } - // turn off the session flag. - locEng->adapter->setInSession(false); - } - - LOC_LOGV("LocEngReportPosition::proc() - generateNmea: %d, position source: %d, " - "engine_status: %d, isInSession: %d", - locEng->generateNmea, mLocation.position_source, - locEng->engine_status, locEng->adapter->isInSession()); - - if (locEng->generateNmea && - locEng->adapter->isInSession()) - { - unsigned char generate_nmea = reported && - (mStatus != LOC_SESS_FAILURE); - loc_eng_nmea_generate_pos(locEng, mLocation, mLocationExtended, - generate_nmea); - } - - // Free the allocated memory for rawData - UlpLocation* gp = (UlpLocation*)&(mLocation); - if (gp != NULL && gp->rawData != NULL) - { - delete (char*)gp->rawData; - gp->rawData = NULL; - gp->rawDataSize = 0; - } - } -} -void LocEngReportPosition::locallog() const { - LOC_LOGV("LocEngReportPosition"); -} -void LocEngReportPosition::log() const { - locallog(); -} -void LocEngReportPosition::send() const { - mAdapter->sendMsg(this); -} - - -// case LOC_ENG_MSG_REPORT_SV: -LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - GnssSvStatus &sv, - GpsLocationExtended &locExtended, - void* svExt) : - LocMsg(), mAdapter(adapter), mSvStatus(sv), - mLocationExtended(locExtended), - mSvExt(((loc_eng_data_s_type*) - ((LocEngAdapter*) - (mAdapter))->getOwner())->sv_ext_parser(svExt)) -{ - locallog(); -} -void LocEngReportSv::proc() const { - LocEngAdapter* adapter = (LocEngAdapter*)mAdapter; - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner(); - - if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - GnssSvStatus gnssSvStatus; - memcpy(&gnssSvStatus,&mSvStatus,sizeof(GnssSvStatus)); - if (adapter->isGnssSvIdUsedInPosAvail()) - { - GnssSvUsedInPosition gnssSvIdUsedInPosition = - adapter->getGnssSvUsedListData(); - int numSv = gnssSvStatus.num_svs; - int16_t gnssSvId = 0; - uint64_t svUsedIdMask = 0; - for (int i=0; i < numSv; i++) - { - gnssSvId = gnssSvStatus.gnss_sv_list[i].svid; - switch(gnssSvStatus.gnss_sv_list[i].constellation) { - case GNSS_CONSTELLATION_GPS: - svUsedIdMask = gnssSvIdUsedInPosition.gps_sv_used_ids_mask; - break; - case GNSS_CONSTELLATION_GLONASS: - svUsedIdMask = gnssSvIdUsedInPosition.glo_sv_used_ids_mask; - break; - case GNSS_CONSTELLATION_BEIDOU: - svUsedIdMask = gnssSvIdUsedInPosition.bds_sv_used_ids_mask; - break; - case GNSS_CONSTELLATION_GALILEO: - svUsedIdMask = gnssSvIdUsedInPosition.gal_sv_used_ids_mask; - break; - default: - svUsedIdMask = 0; - break; - } - - // If SV ID was used in previous position fix, then set USED_IN_FIX - // flag, else clear the USED_IN_FIX flag. - if (svUsedIdMask & (1 << (gnssSvId - 1))) - { - gnssSvStatus.gnss_sv_list[i].flags |= GNSS_SV_FLAGS_USED_IN_FIX; - } - else - { - gnssSvStatus.gnss_sv_list[i].flags &= ~GNSS_SV_FLAGS_USED_IN_FIX; - } - } - } - - if (locEng->gnss_sv_status_cb != NULL) { - LOC_LOGE("Calling gnss_sv_status_cb"); - locEng->gnss_sv_status_cb((GnssSvStatus*)&(gnssSvStatus)); - } - - if (locEng->generateNmea) - { - loc_eng_nmea_generate_sv(locEng, gnssSvStatus, mLocationExtended); - } - } -} -void LocEngReportSv::locallog() const { - LOC_LOGV("%s:%d] LocEngReportSv",__func__, __LINE__); -} -inline void LocEngReportSv::log() const { - locallog(); -} -void LocEngReportSv::send() const { - mAdapter->sendMsg(this); -} - -// case LOC_ENG_MSG_REPORT_STATUS: -LocEngReportStatus::LocEngReportStatus(LocAdapterBase* adapter, - GpsStatusValue engineStatus) : - LocMsg(), mAdapter(adapter), mStatus(engineStatus) -{ - locallog(); -} -inline void LocEngReportStatus::proc() const -{ - LocEngAdapter* adapter = (LocEngAdapter*)mAdapter; - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner(); - - loc_eng_report_status(*locEng, mStatus); - update_aiding_data_for_deletion(*locEng); -} -inline void LocEngReportStatus::locallog() const { - LOC_LOGV("LocEngReportStatus"); -} -inline void LocEngReportStatus::log() const { - locallog(); -} - -// case LOC_ENG_MSG_REPORT_NMEA: -LocEngReportNmea::LocEngReportNmea(void* locEng, - const char* data, int len) : - LocMsg(), mLocEng(locEng), mNmea(new char[len]), mLen(len) -{ - memcpy((void*)mNmea, (void*)data, len); - locallog(); -} -void LocEngReportNmea::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; - - struct timeval tv; - gettimeofday(&tv, (struct timezone *) NULL); - int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - - if (locEng->nmea_cb != NULL) - locEng->nmea_cb(now, mNmea, mLen); -} -inline void LocEngReportNmea::locallog() const { - LOC_LOGV("LocEngReportNmea"); -} -inline void LocEngReportNmea::log() const { - locallog(); -} - -// case LOC_ENG_MSG_REPORT_XTRA_SERVER: -LocEngReportXtraServer::LocEngReportXtraServer(void* locEng, - const char *url1, - const char *url2, - const char *url3, - const int maxlength) : - LocMsg(), mLocEng(locEng), mMaxLen(maxlength), - mServers(new char[3*(mMaxLen+1)]) -{ - char * cptr = mServers; - memset(mServers, 0, 3*(mMaxLen+1)); - - // Override modem URLs with uncommented gps.conf urls - if( gps_conf.XTRA_SERVER_1[0] != '\0' ) { - url1 = &gps_conf.XTRA_SERVER_1[0]; - } - if( gps_conf.XTRA_SERVER_2[0] != '\0' ) { - url2 = &gps_conf.XTRA_SERVER_2[0]; - } - if( gps_conf.XTRA_SERVER_3[0] != '\0' ) { - url3 = &gps_conf.XTRA_SERVER_3[0]; - } - // copy non xtra1.gpsonextra.net URLs into the forwarding buffer. - if( NULL == strcasestr(url1, XTRA1_GPSONEXTRA) ) { - strlcpy(cptr, url1, mMaxLen + 1); - cptr += mMaxLen + 1; - } - if( NULL == strcasestr(url2, XTRA1_GPSONEXTRA) ) { - strlcpy(cptr, url2, mMaxLen + 1); - cptr += mMaxLen + 1; - } - if( NULL == strcasestr(url3, XTRA1_GPSONEXTRA) ) { - strlcpy(cptr, url3, mMaxLen + 1); - } - locallog(); -} - -void LocEngReportXtraServer::proc() const { - loc_eng_xtra_data_s_type* locEngXtra = - &(((loc_eng_data_s_type*)mLocEng)->xtra_module_data); - - if (locEngXtra->report_xtra_server_cb != NULL) { - CALLBACK_LOG_CALLFLOW("report_xtra_server_cb", %s, mServers); - locEngXtra->report_xtra_server_cb(mServers, - &(mServers[mMaxLen+1]), - &(mServers[(mMaxLen+1)<<1])); - } else { - LOC_LOGE("Callback function for request xtra is NULL"); - } -} -inline void LocEngReportXtraServer::locallog() const { - LOC_LOGV("LocEngReportXtraServers: server1: %s\n server2: %s\n" - " server3: %s\n", - mServers, &mServers[mMaxLen+1], &mServers[(mMaxLen+1)<<1]); -} -inline void LocEngReportXtraServer::log() const { - locallog(); -} - -// case LOC_ENG_MSG_REQUEST_BIT: -// case LOC_ENG_MSG_RELEASE_BIT: -LocEngReqRelBIT::LocEngReqRelBIT(void* locEng, AGpsExtType type, - int ipv4, char* ipv6, bool isReq) : - LocMsg(), mLocEng(locEng), mType(type), mIPv4Addr(ipv4), - mIPv6Addr(ipv6 ? new char[16] : NULL), mIsReq(isReq) { - if (NULL != ipv6) - memcpy(mIPv6Addr, ipv6, 16); - locallog(); -} -inline LocEngReqRelBIT::~LocEngReqRelBIT() { - if (mIPv6Addr) { - delete[] mIPv6Addr; - } -} -void LocEngReqRelBIT::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - BITSubscriber s(getAgpsStateMachine(*locEng, mType), - mIPv4Addr, mIPv6Addr); - AgpsStateMachine* sm = (AgpsStateMachine*)s.mStateMachine; - - if (mIsReq) { - sm->subscribeRsrc((Subscriber*)&s); - } else { - sm->unsubscribeRsrc((Subscriber*)&s); - } -} -inline void LocEngReqRelBIT::locallog() const { - LOC_LOGV("LocEngRequestBIT - ipv4: %d.%d.%d.%d, ipv6: %s", - (unsigned char)mIPv4Addr, - (unsigned char)(mIPv4Addr>>8), - (unsigned char)(mIPv4Addr>>16), - (unsigned char)(mIPv4Addr>>24), - NULL != mIPv6Addr ? mIPv6Addr : ""); -} -inline void LocEngReqRelBIT::log() const { - locallog(); -} -void LocEngReqRelBIT::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); -} - -// case LOC_ENG_MSG_RELEASE_BIT: -struct LocEngReleaseBIT : public LocMsg { - const BITSubscriber mSubscriber; - inline LocEngReleaseBIT(const AgpsStateMachine* stateMachine, - unsigned int ipv4, char* ipv6) : - LocMsg(), - mSubscriber(stateMachine, ipv4, ipv6) - { - locallog(); - } - inline virtual void proc() const - { - AgpsStateMachine* sm = (AgpsStateMachine*)mSubscriber.mStateMachine; - sm->unsubscribeRsrc((Subscriber*)&mSubscriber); - } - inline void locallog() const { - LOC_LOGV("LocEngReleaseBIT - ipv4: %d.%d.%d.%d, ipv6: %s", - (unsigned char)(mSubscriber.ID>>24), - (unsigned char)(mSubscriber.ID>>16), - (unsigned char)(mSubscriber.ID>>8), - (unsigned char)mSubscriber.ID, - NULL != mSubscriber.mIPv6Addr ? mSubscriber.mIPv6Addr : ""); - } - virtual void log() const { - locallog(); - } -}; - -// LocEngSuplEsOpened -LocEngSuplEsOpened::LocEngSuplEsOpened(void* locEng) : - LocMsg(), mLocEng(locEng) { - locallog(); -} -void LocEngSuplEsOpened::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - if (locEng->ds_nif) { - AgpsStateMachine* sm = locEng->ds_nif; - sm->onRsrcEvent(RSRC_GRANTED); - } -} -void LocEngSuplEsOpened::locallog() const { - LOC_LOGV("LocEngSuplEsOpened"); -} -void LocEngSuplEsOpened::log() const { - locallog(); -} - -// LocEngSuplEsClosed -LocEngSuplEsClosed::LocEngSuplEsClosed(void* locEng) : - LocMsg(), mLocEng(locEng) { - locallog(); -} -void LocEngSuplEsClosed::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - if (locEng->ds_nif) { - AgpsStateMachine* sm = locEng->ds_nif; - sm->onRsrcEvent(RSRC_RELEASED); - } -} -void LocEngSuplEsClosed::locallog() const { - LOC_LOGV("LocEngSuplEsClosed"); -} -void LocEngSuplEsClosed::log() const { - locallog(); -} - - -// case LOC_ENG_MSG_REQUEST_SUPL_ES: -LocEngRequestSuplEs::LocEngRequestSuplEs(void* locEng, int id) : - LocMsg(), mLocEng(locEng), mID(id) { - locallog(); -} -void LocEngRequestSuplEs::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - if (locEng->ds_nif && gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { - AgpsStateMachine* sm = locEng->ds_nif; - DSSubscriber s(sm, mID); - sm->subscribeRsrc((Subscriber*)&s); - } - else if (locEng->agnss_nif) { - AgpsStateMachine *sm = locEng->agnss_nif; - ATLSubscriber s(mID, - sm, - locEng->adapter, - false); - sm->subscribeRsrc((Subscriber*)&s); - LOC_LOGD("%s:%d]: Using regular ATL for SUPL ES", __func__, __LINE__); - } - else { - locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, -1); - } -} -inline void LocEngRequestSuplEs::locallog() const { - LOC_LOGV("LocEngRequestSuplEs"); -} -inline void LocEngRequestSuplEs::log() const { - locallog(); -} - -// case LOC_ENG_MSG_REQUEST_ATL: -LocEngRequestATL::LocEngRequestATL(void* locEng, int id, - AGpsExtType agps_type) : - LocMsg(), mLocEng(locEng), mID(id), mType(agps_type) { - locallog(); -} -void LocEngRequestATL::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - AgpsStateMachine* sm = (AgpsStateMachine*) - getAgpsStateMachine(*locEng, mType); - if (sm) { - ATLSubscriber s(mID, - sm, - locEng->adapter, - AGPS_TYPE_INVALID == mType); - sm->subscribeRsrc((Subscriber*)&s); - } else { - locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, mType); - } -} -inline void LocEngRequestATL::locallog() const { - LOC_LOGV("LocEngRequestATL"); -} -inline void LocEngRequestATL::log() const { - locallog(); -} - -// case LOC_ENG_MSG_RELEASE_ATL: -LocEngReleaseATL::LocEngReleaseATL(void* locEng, int id) : - LocMsg(), mLocEng(locEng), mID(id) { - locallog(); -} -void LocEngReleaseATL::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - - if (locEng->agnss_nif) { - ATLSubscriber s1(mID, locEng->agnss_nif, locEng->adapter, false); - if (locEng->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { - LOC_LOGD("%s:%d]: Unsubscribed from agnss_nif", - __func__, __LINE__); - return; - } - } - - if (locEng->internet_nif) { - ATLSubscriber s2(mID, locEng->internet_nif, locEng->adapter, false); - if (locEng->internet_nif->unsubscribeRsrc((Subscriber*)&s2)) { - LOC_LOGD("%s:%d]: Unsubscribed from internet_nif", - __func__, __LINE__); - return; - } - } - - if (locEng->ds_nif) { - DSSubscriber s3(locEng->ds_nif, mID); - if (locEng->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { - LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", - __func__, __LINE__); - return; - } - } - - LOC_LOGW("%s:%d]: Could not release ATL. " - "No subscribers found\n", - __func__, __LINE__); - locEng->adapter->atlCloseStatus(mID, 0); -} -inline void LocEngReleaseATL::locallog() const { - LOC_LOGV("LocEngReleaseATL"); -} -inline void LocEngReleaseATL::log() const { - locallog(); -} - -// case LOC_ENG_MSG_REQUEST_WIFI: -// case LOC_ENG_MSG_RELEASE_WIFI: -LocEngReqRelWifi::LocEngReqRelWifi(void* locEng, AGpsExtType type, - loc_if_req_sender_id_e_type sender_id, - char* s, char* p, bool isReq) : - LocMsg(), mLocEng(locEng), mType(type), mSenderId(sender_id), - mSSID(NULL == s ? NULL : new char[SSID_BUF_SIZE]), - mPassword(NULL == p ? NULL : new char[SSID_BUF_SIZE]), - mIsReq(isReq) { - if (NULL != s) - strlcpy(mSSID, s, SSID_BUF_SIZE); - if (NULL != p) - strlcpy(mPassword, p, SSID_BUF_SIZE); - locallog(); -} -LocEngReqRelWifi::~LocEngReqRelWifi() { - if (NULL != mSSID) { - delete[] mSSID; - } - if (NULL != mPassword) { - delete[] mPassword; - } -} -void LocEngReqRelWifi::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType); -} -inline void LocEngReqRelWifi::locallog() const { - LOC_LOGV("%s - senderId: %d, ssid: %s, password: %s", - mIsReq ? "LocEngRequestWifi" : "LocEngReleaseWifi", - mSenderId, - NULL != mSSID ? mSSID : "", - NULL != mPassword ? mPassword : ""); -} -inline void LocEngReqRelWifi::log() const { - locallog(); -} -void LocEngReqRelWifi::send() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - locEng->adapter->sendMsg(this); -} - -// case LOC_ENG_MSG_REQUEST_XTRA_DATA: -LocEngRequestXtra::LocEngRequestXtra(void* locEng) : - mLocEng(locEng) { - locallog(); -} -void LocEngRequestXtra::proc() const -{ - loc_eng_xtra_data_s_type* locEngXtra = - &(((loc_eng_data_s_type*)mLocEng)->xtra_module_data); - - if (locEngXtra->download_request_cb != NULL) { - CALLBACK_LOG_CALLFLOW("download_request_cb", %p, mLocEng); - locEngXtra->download_request_cb(); - } else { - LOC_LOGE("Callback function for request xtra is NULL"); - } -} -inline void LocEngRequestXtra::locallog() const { - LOC_LOGV("LocEngReqXtra"); -} -inline void LocEngRequestXtra::log() const { - locallog(); -} - -// case LOC_ENG_MSG_REQUEST_TIME: -LocEngRequestTime::LocEngRequestTime(void* locEng) : - LocMsg(), mLocEng(locEng) -{ - locallog(); -} -void LocEngRequestTime::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - if (gps_conf.CAPABILITIES & GPS_CAPABILITY_ON_DEMAND_TIME) { - if (locEng->request_utc_time_cb != NULL) { - locEng->request_utc_time_cb(); - } else { - LOC_LOGE("Callback function for request time is NULL"); - } - } -} -inline void LocEngRequestTime::locallog() const { - LOC_LOGV("LocEngReqTime"); -} -inline void LocEngRequestTime::log() const { - locallog(); -} - -// case LOC_ENG_MSG_DELETE_AIDING_DATA: -struct LocEngDelAidData : public LocMsg { - loc_eng_data_s_type* mLocEng; - const GpsAidingData mType; - inline LocEngDelAidData(loc_eng_data_s_type* locEng, - GpsAidingData f) : - LocMsg(), mLocEng(locEng), mType(f) - { - locallog(); - } - inline virtual void proc() const { - mLocEng->aiding_data_for_deletion = mType; - update_aiding_data_for_deletion(*mLocEng); - } - inline void locallog() const { - LOC_LOGV("aiding data msak %d", mType); - } - virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_ENABLE_DATA: -struct LocEngEnableData : public LocMsg { - LocEngAdapter* mAdapter; - const int mEnable; - char* mAPN; - const int mLen; - inline LocEngEnableData(LocEngAdapter* adapter, - const char* name, int len, int enable) : - LocMsg(), mAdapter(adapter), - mEnable(enable), mAPN(NULL), mLen(len) - { - if (NULL != name) { - mAPN = new char[len+1]; - memcpy((void*)mAPN, (void*)name, len); - mAPN[len] = 0; - } - locallog(); - } - inline ~LocEngEnableData() { - if (NULL != mAPN) { - delete[] mAPN; - } - } - inline virtual void proc() const { - mAdapter->enableData(mEnable); - if (NULL != mAPN) { - mAdapter->setAPN(mAPN, mLen); - } - } - inline void locallog() const { - LOC_LOGV("apn: %s\n enable: %d", - (NULL == mAPN) ? "NULL" : mAPN, mEnable); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_INJECT_XTRA_DATA: -// loc_eng_xtra.cpp - -// case LOC_ENG_MSG_SET_CAPABILITIES: -struct LocEngSetCapabilities : public LocMsg { - loc_eng_data_s_type* mLocEng; - inline LocEngSetCapabilities(loc_eng_data_s_type* locEng) : - LocMsg(), mLocEng(locEng) - { - locallog(); - } - inline virtual void proc() const { - if (NULL != mLocEng->set_capabilities_cb) { - LOC_LOGV("calling set_capabilities_cb 0x%x", - gps_conf.CAPABILITIES); - mLocEng->set_capabilities_cb(gps_conf.CAPABILITIES); - } else { - LOC_LOGV("set_capabilities_cb is NULL.\n"); - } - } - inline void locallog() const - { - LOC_LOGV("LocEngSetCapabilities"); - } - inline virtual void log() const - { - locallog(); - } -}; - -struct LocEngSetSystemInfo : public LocMsg { - loc_eng_data_s_type* mLocEng; - inline LocEngSetSystemInfo(loc_eng_data_s_type* locEng) : - LocMsg(), mLocEng(locEng) - { - locallog(); - } - inline virtual void proc() const { - if (NULL != mLocEng->set_system_info_cb) { - LOC_LOGV("calling set_system_info_cb 0x%x", - mLocEng->adapter->mGnssInfo.year_of_hw); - mLocEng->set_system_info_cb(&(mLocEng->adapter->mGnssInfo)); - } - else { - LOC_LOGV("set_system_info_cb is NULL.\n"); - } - } - inline void locallog() const - { - LOC_LOGV("LocEngSetSystemInfo"); - } - inline virtual void log() const - { - locallog(); - } -}; -// case LOC_ENG_MSG_LOC_INIT: -struct LocEngInit : public LocMsg { - loc_eng_data_s_type* mLocEng; - inline LocEngInit(loc_eng_data_s_type* locEng) : - LocMsg(), mLocEng(locEng) - { - locallog(); - } - inline virtual void proc() const { - loc_eng_reinit(*mLocEng); - // set the capabilities - mLocEng->adapter->sendMsg(new LocEngSetCapabilities(mLocEng)); - mLocEng->adapter->sendMsg(new LocEngSetSystemInfo(mLocEng)); - } - inline void locallog() const - { - LOC_LOGV("LocEngInit"); - } - inline virtual void log() const - { - locallog(); - } -}; - -// case LOC_ENG_MSG_REQUEST_XTRA_SERVER: -// loc_eng_xtra.cpp - -// case LOC_ENG_MSG_ATL_OPEN_SUCCESS: -struct LocEngAtlOpenSuccess : public LocMsg { - loc_eng_data_s_type* mLocEng; - const AGpsExtType mAgpsType; - const int mLen; - char* mAPN; - const AGpsBearerType mBearerType; - inline LocEngAtlOpenSuccess(loc_eng_data_s_type* locEng, - const AGpsExtType agpsType, - const char* name, - int len, - AGpsBearerType btype) : - LocMsg(), - mLocEng(locEng), mAgpsType(agpsType), mLen(len), - mAPN(new char[len+1]), mBearerType(btype) - { - memcpy((void*)mAPN, (void*)name, len); - mAPN[len] = 0; - locallog(); - } - inline ~LocEngAtlOpenSuccess() - { - delete[] mAPN; - } - inline virtual void proc() const { - AgpsStateMachine* sm = getAgpsStateMachine(*mLocEng, mAgpsType); - sm->setBearer(mBearerType); - sm->setAPN(mAPN, mLen); - sm->onRsrcEvent(RSRC_GRANTED); - } - inline void locallog() const { - LOC_LOGV("LocEngAtlOpenSuccess agps type: %s\n apn: %s\n" - " bearer type: %s", - loc_get_agps_type_name(mAgpsType), - mAPN, - loc_get_agps_bear_name(mBearerType)); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_ATL_CLOSED: -struct LocEngAtlClosed : public LocMsg { - loc_eng_data_s_type* mLocEng; - const AGpsExtType mAgpsType; - inline LocEngAtlClosed(loc_eng_data_s_type* locEng, - const AGpsExtType agpsType) : - LocMsg(), mLocEng(locEng), mAgpsType(agpsType) { - locallog(); - } - inline virtual void proc() const { - AgpsStateMachine* sm = getAgpsStateMachine(*mLocEng, mAgpsType); - sm->onRsrcEvent(RSRC_RELEASED); - } - inline void locallog() const { - LOC_LOGV("LocEngAtlClosed"); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_ATL_OPEN_FAILED: -struct LocEngAtlOpenFailed : public LocMsg { - loc_eng_data_s_type* mLocEng; - const AGpsExtType mAgpsType; - inline LocEngAtlOpenFailed(loc_eng_data_s_type* locEng, - const AGpsExtType agpsType) : - LocMsg(), mLocEng(locEng), mAgpsType(agpsType) { - locallog(); - } - inline virtual void proc() const { - AgpsStateMachine* sm = getAgpsStateMachine(*mLocEng, mAgpsType); - sm->onRsrcEvent(RSRC_DENIED); - } - inline void locallog() const { - LOC_LOGV("LocEngAtlOpenFailed"); - } - inline virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_ENGINE_DOWN: -LocEngDown::LocEngDown(void* locEng) : - LocMsg(), mLocEng(locEng) { - locallog(); -} -inline void LocEngDown::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - loc_eng_handle_engine_down(*locEng); -} -inline void LocEngDown::locallog() const { - LOC_LOGV("LocEngDown"); -} -inline void LocEngDown::log() const { - locallog(); -} - -// case LOC_ENG_MSG_ENGINE_UP: -LocEngUp::LocEngUp(void* locEng) : - LocMsg(), mLocEng(locEng) { - locallog(); -} -inline void LocEngUp::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; - loc_eng_handle_engine_up(*locEng); -} -inline void LocEngUp::locallog() const { - LOC_LOGV("LocEngUp"); -} -inline void LocEngUp::log() const { - locallog(); -} - -struct LocEngAgnssNifInit : public LocMsg { - loc_eng_data_s_type* mLocEng; - inline LocEngAgnssNifInit(loc_eng_data_s_type* locEng) : - LocMsg(), mLocEng(locEng) { - locallog(); - } - virtual void proc() const { - createAgnssNifs(*mLocEng); - } - void locallog() const { - LOC_LOGV("LocEngAgnssNifInit\n"); - } - virtual void log() const { - locallog(); - } -}; - -struct LocEngInstallAGpsCert : public LocMsg { - LocEngAdapter* mpAdapter; - const size_t mNumberOfCerts; - const uint32_t mSlotBitMask; - DerEncodedCertificate* mpData; - inline LocEngInstallAGpsCert(LocEngAdapter* adapter, - const DerEncodedCertificate* pData, - size_t numberOfCerts, - uint32_t slotBitMask) : - LocMsg(), mpAdapter(adapter), - mNumberOfCerts(numberOfCerts), mSlotBitMask(slotBitMask), - mpData(new DerEncodedCertificate[mNumberOfCerts]) - { - for (int i=0; i < mNumberOfCerts; i++) { - mpData[i].data = new u_char[pData[i].length]; - if (mpData[i].data) { - memcpy(mpData[i].data, (void*)pData[i].data, pData[i].length); - mpData[i].length = pData[i].length; - } else { - LOC_LOGE("malloc failed for cert#%d", i); - break; - } - } - locallog(); - } - inline ~LocEngInstallAGpsCert() - { - for (int i=0; i < mNumberOfCerts; i++) { - if (mpData[i].data) { - delete[] mpData[i].data; - } - } - delete[] mpData; - } - inline virtual void proc() const { - mpAdapter->installAGpsCert(mpData, mNumberOfCerts, mSlotBitMask); - } - inline void locallog() const { - LOC_LOGV("LocEngInstallAGpsCert - certs=%u mask=%u", - mNumberOfCerts, mSlotBitMask); - } - inline virtual void log() const { - locallog(); - } -}; - -struct LocEngGnssConstellationConfig : public LocMsg { - LocEngAdapter* mAdapter; - inline LocEngGnssConstellationConfig(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) { - locallog(); - } - inline virtual void proc() const { - mAdapter->mGnssInfo.size = sizeof(GnssSystemInfo); - if (mAdapter->gnssConstellationConfig()) { - LOC_LOGV("Modem supports GNSS measurements\n"); - gps_conf.CAPABILITIES |= GPS_CAPABILITY_MEASUREMENTS; - mAdapter->mGnssInfo.year_of_hw = 2016; - } else { - mAdapter->mGnssInfo.year_of_hw = 2015; - LOC_LOGV("Modem does not support GNSS measurements\n"); - } - } - void locallog() const { - LOC_LOGV("LocEngGnssConstellationConfig\n"); - } - virtual void log() const { - locallog(); - } -}; - -// case LOC_ENG_MSG_REPORT_GNSS_MEASUREMENT: -LocEngReportGnssMeasurement::LocEngReportGnssMeasurement(void* locEng, - GnssData &gnssData) : - LocMsg(), mLocEng(locEng), mGnssData(gnssData) -{ - locallog(); -} -void LocEngReportGnssMeasurement::proc() const { - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; - if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - if (locEng->gnss_measurement_cb != NULL) { - LOC_LOGV("Calling gnss_measurement_cb"); - locEng->gnss_measurement_cb((GnssData*)&(mGnssData)); - } - } -} -void LocEngReportGnssMeasurement::locallog() const { - IF_LOC_LOGV { - LOC_LOGV("%s:%d]: Received in GPS HAL." - "GNSS Measurements count: %d \n", - __func__, __LINE__, mGnssData.measurement_count); - for (int i =0; i< mGnssData.measurement_count && i < GNSS_MAX_SVS; i++) { - LOC_LOGV(" GNSS measurement data in GPS HAL: \n" - " GPS_HAL => Measurement ID | svid | time_offset_ns | state |" - " c_n0_dbhz | pseudorange_rate_mps |" - " pseudorange_rate_uncertainty_mps |" - " accumulated_delta_range_state | flags \n" - " GPS_HAL => %d | %d | %f | %d | %f | %f | %f | %d | %d \n", - i, - mGnssData.measurements[i].svid, - mGnssData.measurements[i].time_offset_ns, - mGnssData.measurements[i].state, - mGnssData.measurements[i].c_n0_dbhz, - mGnssData.measurements[i].pseudorange_rate_mps, - mGnssData.measurements[i].pseudorange_rate_uncertainty_mps, - mGnssData.measurements[i].accumulated_delta_range_state, - mGnssData.measurements[i].flags); - } - LOC_LOGV(" GPS_HAL => Clocks Info: \n" - " time_ns | full_bias_ns | bias_ns | bias_uncertainty_ns | " - " drift_nsps | drift_uncertainty_nsps | hw_clock_discontinuity_count | flags" - " GPS_HAL => Clocks Info: %lld | %lld | %g | %g | %g | %g | %d | 0x%04x\n", - mGnssData.clock.time_ns, - mGnssData.clock.full_bias_ns, - mGnssData.clock.bias_ns, - mGnssData.clock.bias_uncertainty_ns, - mGnssData.clock.drift_nsps, - mGnssData.clock.drift_uncertainty_nsps, - mGnssData.clock.hw_clock_discontinuity_count, - mGnssData.clock.flags); - } -} -inline void LocEngReportGnssMeasurement::log() const { - locallog(); -} - -/********************************************************************* - * Initialization checking macros - *********************************************************************/ -#define STATE_CHECK(ctx, x, ret) \ - if (!(ctx)) \ - { \ - /* Not intialized, abort */\ - LOC_LOGE("%s: log_eng state error: %s", __func__, x); \ - EXIT_LOG(%s, x); \ - ret; \ - } -#define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) - -/*=========================================================================== -FUNCTION loc_eng_init - -DESCRIPTION - Initialize the location engine, this include setting up global datas - and registers location engien with loc api service. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event, ContextBase* context) - -{ - int ret_val = 0; - - ENTRY_LOG_CALLFLOW(); - if (NULL == callbacks || 0 == event) { - LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); - ret_val = -1; - EXIT_LOG(%d, ret_val); - return ret_val; - } - - STATE_CHECK((NULL == loc_eng_data.adapter), - "instance already initialized", return 0); - - memset(&loc_eng_data, 0, sizeof (loc_eng_data)); - - // Save callbacks - loc_eng_data.location_cb = callbacks->location_cb; - loc_eng_data.sv_status_cb = callbacks->sv_status_cb; - loc_eng_data.status_cb = callbacks->status_cb; - loc_eng_data.nmea_cb = callbacks->nmea_cb; - loc_eng_data.set_capabilities_cb = callbacks->set_capabilities_cb; - loc_eng_data.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; - loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; - loc_eng_data.request_utc_time_cb = callbacks->request_utc_time_cb; - loc_eng_data.set_system_info_cb = callbacks->set_system_info_cb; - loc_eng_data.gnss_sv_status_cb = callbacks->gnss_sv_status_cb; - loc_eng_data.location_ext_parser = callbacks->location_ext_parser ? - callbacks->location_ext_parser : noProc; - loc_eng_data.sv_ext_parser = callbacks->sv_ext_parser ? - callbacks->sv_ext_parser : noProc; - loc_eng_data.intermediateFix = gps_conf.INTERMEDIATE_POS; - // initial states taken care of by the memset above - // loc_eng_data.engine_status -- GPS_STATUS_NONE; - // loc_eng_data.fix_session_status -- GPS_STATUS_NONE; - // loc_eng_data.mute_session_state -- LOC_MUTE_SESS_NONE; - - if ((event & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) && (gps_conf.NMEA_PROVIDER == NMEA_PROVIDER_AP)) - { - event = event ^ LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; // unregister for modem NMEA report - loc_eng_data.generateNmea = true; - } - else if (gps_conf.NMEA_PROVIDER == NMEA_PROVIDER_MP) - { - loc_eng_data.generateNmea = false; - } - - loc_eng_data.adapter = - new LocEngAdapter(event, &loc_eng_data, context, - (LocThread::tCreate)callbacks->create_thread_cb); - - loc_eng_data.adapter->mGnssInfo.size = sizeof(GnssSystemInfo); - loc_eng_data.adapter->mGnssInfo.year_of_hw = 2015; - LOC_LOGD("loc_eng_init created client, id = %p\n", - loc_eng_data.adapter); - loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data)); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - LocEngAdapter* adapter = loc_eng_data.adapter; - - adapter->sendMsg(new LocEngGnssConstellationConfig(adapter)); - adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); - adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); - adapter->sendMsg(new LocEngSensorControlConfig(adapter, sap_conf.SENSOR_USAGE, - sap_conf.SENSOR_PROVIDER)); - adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); - adapter->sendMsg(new LocEngLPPeProtocol(adapter, gps_conf.LPPE_CP_TECHNOLOGY, - gps_conf.LPPE_UP_TECHNOLOGY)); - - if (!loc_eng_data.generateNmea) - { - NmeaSentenceTypesMask typesMask = LOC_NMEA_ALL_SUPPORTED_MASK; - LOC_LOGD("loc_eng_init setting nmea types, mask = %u\n",typesMask); - adapter->sendMsg(new LocEngSetNmeaTypes(adapter,typesMask)); - } - - /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */ - if( sap_conf.GYRO_BIAS_RANDOM_WALK_VALID || - sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { - adapter->sendMsg(new LocEngSensorProperties(adapter, - sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, - sap_conf.GYRO_BIAS_RANDOM_WALK, - sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, - sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, - sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, - sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY)); - } - - adapter->sendMsg(new LocEngSensorPerfControlConfig(adapter, - sap_conf.SENSOR_CONTROL_MODE, - sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, - sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, - sap_conf.SENSOR_GYRO_BATCHES_PER_SEC, - sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, - sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, - sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, - sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, - sap_conf.SENSOR_ALGORITHM_CONFIG_MASK)); - - adapter->sendMsg(new LocEngEnableData(adapter, NULL, 0, (agpsStatus ? 1:0))); - - loc_eng_xtra_version_check(loc_eng_data, gps_conf.XTRA_VERSION_CHECK); - - LOC_LOGD("loc_eng_reinit reinit() successful"); - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_cleanup - -DESCRIPTION - Cleans location engine. The location client handle will be released. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return); - - // XTRA has no state, so we are fine with it. - - // we need to check and clear NI -#if 0 - // we need to check and clear ATL - if (NULL != loc_eng_data.agnss_nif) { - delete loc_eng_data.agnss_nif; - loc_eng_data.agnss_nif = NULL; - } - if (NULL != loc_eng_data.internet_nif) { - delete loc_eng_data.internet_nif; - loc_eng_data.internet_nif = NULL; - } -#endif - if (loc_eng_data.adapter->isInSession()) - { - LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now."); - loc_eng_stop(loc_eng_data); - } - -#if 0 // can't afford to actually clean up, for many reason. - - LOC_LOGD("loc_eng_init: client opened. close it now."); - delete loc_eng_data.adapter; - loc_eng_data.adapter = NULL; - - loc_eng_dmn_conn_loc_api_server_unblock(); - loc_eng_dmn_conn_loc_api_server_join(); - -#endif - - EXIT_LOG(%s, VOID_RET); -} - - -/*=========================================================================== -FUNCTION loc_eng_start - -DESCRIPTION - Starts the tracking session - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_start(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return -1); - - if(! loc_eng_data.adapter->getUlpProxy()->sendStartFix()) - { - loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter)); - } - - EXIT_LOG(%d, 0); - return 0; -} - -static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - - if (!loc_eng_data.adapter->isInSession()) { - ret_val = loc_eng_data.adapter->startFix(); - - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || - ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN || - ret_val == LOC_API_ADAPTER_ERR_PHONE_OFFLINE || - ret_val == LOC_API_ADAPTER_ERR_INTERNAL) - { - loc_eng_data.adapter->setInSession(TRUE); - } - } - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_stop_wrapper - -DESCRIPTION - Stops the tracking session - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return -1); - - if(! loc_eng_data.adapter->getUlpProxy()->sendStopFix()) - { - loc_eng_data.adapter->sendMsg(new LocEngStopFix(loc_eng_data.adapter)); - } - - EXIT_LOG(%d, 0); - return 0; -} - -static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - - if (loc_eng_data.adapter->isInSession()) { - ret_val = loc_eng_data.adapter->stopFix(); - loc_eng_data.adapter->setInSession(FALSE); - } - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_mute_one_session - -DESCRIPTION - Mutes one session - -DEPENDENCIES - None - -RETURN VALUE - 0: Success - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - loc_eng_data.mute_session_state = LOC_MUTE_SESS_WAIT; - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_eng_set_position_mode - -DESCRIPTION - Sets the mode and fix frequency for the tracking session. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, - LocPosMode ¶ms) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return -1); - - // The position mode for AUTO/GSS/QCA1530 can only be standalone - if (!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) && - !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && - (params.mode != LOC_POSITION_MODE_STANDALONE)) { - params.mode = LOC_POSITION_MODE_STANDALONE; - LOC_LOGD("Position mode changed to standalone for target with AUTO/GSS/qca1530."); - } - - if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) - { - LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngPositionMode(adapter, params)); - } - - EXIT_LOG(%d, 0); - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_inject_time - -DESCRIPTION - This is used by Java native function to do time injection. - -DEPENDENCIES - None - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time, - int64_t timeReference, int uncertainty) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return -1); - LocEngAdapter* adapter = loc_eng_data.adapter; - - adapter->sendMsg(new LocEngSetTime(adapter, time, timeReference, - uncertainty)); - - EXIT_LOG(%d, 0); - return 0; -} - - -/*=========================================================================== -FUNCTION loc_eng_inject_location - -DESCRIPTION - This is used by Java native function to do location injection. - -DEPENDENCIES - None - -RETURN VALUE - 0 : Successful - error code : Failure - -SIDE EFFECTS - N/A -===========================================================================*/ -int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude, - double longitude, float accuracy) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return -1); - LocEngAdapter* adapter = loc_eng_data.adapter; - if(adapter->mSupportsPositionInjection) - { - adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, - accuracy)); - } - - EXIT_LOG(%d, 0); - return 0; -} - - -/*=========================================================================== -FUNCTION loc_eng_delete_aiding_data - -DESCRIPTION - This is used by Java native function to delete the aiding data. The function - updates the global variable for the aiding data to be deleted. If the GPS - engine is off, the aiding data will be deleted. Otherwise, the actual action - will happen when gps engine is turned off. - -DEPENDENCIES - Assumes the aiding data type specified in GpsAidingData matches with - LOC API specification. - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData f) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return); - - //report delete aiding data to ULP to send to DRPlugin - loc_eng_data.adapter->getUlpProxy()->reportDeleteAidingData(f); - - loc_eng_data.adapter->sendMsg(new LocEngDelAidData(&loc_eng_data, f)); - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== - -FUNCTION loc_inform_gps_state - -DESCRIPTION - Informs the GPS Provider about the GPS status - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusValue status) -{ - ENTRY_LOG(); - - if (loc_eng_data.status_cb) - { - GpsStatus gs = { sizeof(gs),status }; - CALLBACK_LOG_CALLFLOW("status_cb", %s, - loc_get_gps_status_name(gs.status)); - loc_eng_data.status_cb(&gs); - } - - EXIT_LOG(%s, VOID_RET); -} - -static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - UlpLocation location; - LocPosTechMask tech_mask = LOC_POS_TECH_MASK_DEFAULT; - GpsLocationExtended locationExtended; - memset(&locationExtended, 0, sizeof (GpsLocationExtended)); - locationExtended.size = sizeof(locationExtended); - - ret_val = loc_eng_data.adapter->getZpp(location.gpsLocation, tech_mask); - //Mark the location source as from ZPP - location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; - location.position_source = ULP_LOCATION_IS_FROM_ZPP; - - loc_eng_data.adapter->getUlpProxy()->reportPosition(location, - locationExtended, - NULL, - LOC_SESS_SUCCESS, - tech_mask); - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/* - Callback function passed to Data Services State Machine - This becomes part of the state machine's servicer and - is used to send requests to the data services client -*/ -static int dataCallCb(void *cb_data) -{ - LOC_LOGD("Enter dataCallCb\n"); - int ret=0; - if(cb_data != NULL) { - dsCbData *cbData = (dsCbData *)cb_data; - LocEngAdapter *locAdapter = (LocEngAdapter *)cbData->mAdapter; - if(cbData->action == GPS_REQUEST_AGPS_DATA_CONN) { - LOC_LOGD("dataCallCb GPS_REQUEST_AGPS_DATA_CONN\n"); - ret = locAdapter->openAndStartDataCall(); - } - else if(cbData->action == GPS_RELEASE_AGPS_DATA_CONN) { - LOC_LOGD("dataCallCb GPS_RELEASE_AGPS_DATA_CONN\n"); - locAdapter->stopDataCall(); - } - } - else { - LOC_LOGE("NULL argument received. Failing.\n"); - ret = -1; - goto err; - } - -err: - LOC_LOGD("Exit dataCallCb ret = %d\n", ret); - return ret; -} - -/*=========================================================================== -FUNCTION loc_eng_agps_reinit - -DESCRIPTION - 2nd half of loc_eng_agps_init(), singled out for modem restart to use. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - - // Set server addresses which came before init - if (loc_eng_data.supl_host_set) - { - loc_eng_set_server(loc_eng_data, LOC_AGPS_SUPL_SERVER, - loc_eng_data.supl_host_buf, - loc_eng_data.supl_port_buf); - } - - if (loc_eng_data.c2k_host_set) - { - loc_eng_set_server(loc_eng_data, LOC_AGPS_CDMA_PDE_SERVER, - loc_eng_data.c2k_host_buf, - loc_eng_data.c2k_port_buf); - } - EXIT_LOG(%s, VOID_RET); -} -/*=========================================================================== -FUNCTION loc_eng_agps_init - -DESCRIPTION - Initialize the AGps interface. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* callbacks) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter, return); - STATE_CHECK((NULL == loc_eng_data.agps_status_cb), - "agps instance already initialized", - return); - if (callbacks == NULL) { - LOC_LOGE("loc_eng_agps_init: bad parameters cb %p", callbacks); - EXIT_LOG(%s, VOID_RET); - return; - } - LocEngAdapter* adapter = loc_eng_data.adapter; - loc_eng_data.agps_status_cb = callbacks->status_cb; - - if (NULL != adapter) { - if (adapter->mSupportsAgpsRequests) { - adapter->sendMsg(new LocEngAgnssNifInit(&loc_eng_data)); - } - loc_eng_agps_reinit(loc_eng_data); - } - - EXIT_LOG(%s, VOID_RET); -} - -static void deleteAidingData(loc_eng_data_s_type &logEng) { - if (logEng.engine_status != GPS_STATUS_ENGINE_ON && - logEng.aiding_data_for_deletion != 0) { - logEng.adapter->deleteAidingData(logEng.aiding_data_for_deletion); - logEng.aiding_data_for_deletion = 0; - } -} - -// must be called under msg handler context -static void createAgnssNifs(loc_eng_data_s_type& locEng) { - bool agpsCapable = ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) || - (gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)); - LocEngAdapter* adapter = locEng.adapter; - if (NULL != adapter && adapter->mSupportsAgpsRequests) { - if (NULL == locEng.internet_nif) { - locEng.internet_nif= new AgpsStateMachine(servicerTypeAgps, - (void *)locEng.agps_status_cb, - AGPS_TYPE_WWAN_ANY, - false); - } - if (agpsCapable) { - if (NULL == locEng.agnss_nif) { - locEng.agnss_nif = new AgpsStateMachine(servicerTypeAgps, - (void *)locEng.agps_status_cb, - AGPS_TYPE_SUPL, - false); - } - if (NULL == locEng.ds_nif && - gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL && - 0 == adapter->initDataServiceClient()) { - locEng.ds_nif = new DSStateMachine(servicerTypeExt, - (void *)dataCallCb, - locEng.adapter); - } - } - } -} - -// must be called under msg handler context -static AgpsStateMachine* -getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { - AgpsStateMachine* stateMachine; - switch (agpsType) { - case AGPS_TYPE_INVALID: - case AGPS_TYPE_SUPL: { - stateMachine = locEng.agnss_nif; - break; - } - case AGPS_TYPE_SUPL_ES: { - if (gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { - if (NULL == locEng.ds_nif) { - createAgnssNifs(locEng); - } - stateMachine = locEng.ds_nif; - } else { - stateMachine = locEng.agnss_nif; - } - break; - } - default: - stateMachine = locEng.internet_nif; - } - return stateMachine; -} - -/*=========================================================================== -FUNCTION loc_eng_agps_open - -DESCRIPTION - This function is called when on-demand data connection opening is successful. -It should inform engine about the data open result. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, - const char* apn, AGpsBearerType bearerType) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, - return -1); - - if (apn == NULL) - { - LOC_LOGE("APN Name NULL\n"); - return 0; - } - - LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn); - - int apn_len = smaller_of(strlen (apn), MAX_APN_LEN); - loc_eng_data.adapter->sendMsg( - new LocEngAtlOpenSuccess(&loc_eng_data, agpsType, - apn, apn_len, bearerType)); - - EXIT_LOG(%d, 0); - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_agps_closed - -DESCRIPTION - This function is called when on-demand data connection closing is done. -It should inform engine about the data close result. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(&loc_eng_data, - agpsType)); - - EXIT_LOG(%d, 0); - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_agps_open_failed - -DESCRIPTION - This function is called when on-demand data connection opening has failed. -It should inform engine about the data open result. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) -{ - ENTRY_LOG_CALLFLOW(); - INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, - return -1); - - loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(&loc_eng_data, - agpsType)); - - EXIT_LOG(%d, 0); - return 0; -} - -/*=========================================================================== - -FUNCTION resolve_in_addr - -DESCRIPTION - Translates a hostname to in_addr struct - -DEPENDENCIES - n/a - -RETURN VALUE - TRUE if successful - -SIDE EFFECTS - n/a - -===========================================================================*/ -static boolean resolve_in_addr(const char *host_addr, struct in_addr *in_addr_ptr) -{ - ENTRY_LOG(); - boolean ret_val = TRUE; - - struct hostent *hp; - hp = gethostbyname(host_addr); - if (hp != NULL) /* DNS OK */ - { - memcpy(in_addr_ptr, hp->h_addr_list[0], hp->h_length); - } - else - { - /* Try IP representation */ - if (inet_aton(host_addr, in_addr_ptr) == 0) - { - /* IP not valid */ - LOC_LOGE("DNS query on '%s' failed\n", host_addr); - ret_val = FALSE; - } - } - - EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_set_server - -DESCRIPTION - This is used to set the default AGPS server. Server address is obtained - from gps.conf. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, - LocServerType type, const char* hostname, int port) -{ - ENTRY_LOG(); - int ret = 0; - LocEngAdapter* adapter = loc_eng_data.adapter; - - if (LOC_AGPS_SUPL_SERVER == type) { - char url[MAX_URL_LEN]; - unsigned int len = 0; - const char nohost[] = "NONE"; - if (hostname == NULL || - strncasecmp(nohost, hostname, sizeof(nohost)) == 0) { - url[0] = NULL; - } else { - len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); - } - - if (sizeof(url) > len) { - adapter->sendMsg(new LocEngSetServerUrl(adapter, url, len)); - } - } else if (LOC_AGPS_CDMA_PDE_SERVER == type || - LOC_AGPS_CUSTOM_PDE_SERVER == type || - LOC_AGPS_MPC_SERVER == type) { - struct in_addr addr; - if (!resolve_in_addr(hostname, &addr)) - { - LOC_LOGE("loc_eng_set_server, hostname %s cannot be resolved.\n", hostname); - ret = -2; - } else { - unsigned int ip = htonl(addr.s_addr); - adapter->sendMsg(new LocEngSetServerIpv4(adapter, ip, port, type)); - } - } else { - LOC_LOGE("loc_eng_set_server, type %d cannot be resolved.\n", type); - } - - EXIT_LOG(%d, ret); - return ret; -} - -/*=========================================================================== -FUNCTION loc_eng_set_server_proxy - -DESCRIPTION - If loc_eng_set_server is called before loc_eng_init, it doesn't work. This - proxy buffers server settings and calls loc_eng_set_server when the client is - open. - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, - LocServerType type, - const char* hostname, int port) -{ - ENTRY_LOG_CALLFLOW(); - int ret_val = 0; - - LOC_LOGV("save the address, type: %d, hostname: %s, port: %d", - (int) type, hostname, port); - switch (type) - { - case LOC_AGPS_SUPL_SERVER: - strlcpy(loc_eng_data.supl_host_buf, hostname, - sizeof(loc_eng_data.supl_host_buf)); - loc_eng_data.supl_port_buf = port; - loc_eng_data.supl_host_set = 1; - break; - case LOC_AGPS_CDMA_PDE_SERVER: - strlcpy(loc_eng_data.c2k_host_buf, hostname, - sizeof(loc_eng_data.c2k_host_buf)); - loc_eng_data.c2k_port_buf = port; - loc_eng_data.c2k_host_set = 1; - break; - default: - LOC_LOGE("loc_eng_set_server_proxy, unknown server type = %d", (int) type); - } - - if (NULL != loc_eng_data.adapter) - { - ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); - } - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_agps_ril_update_network_availability - -DESCRIPTION - Sets data call allow vs disallow flag to modem - This is the only member of sLocEngAGpsRilInterface implemented. - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, - int available, const char* apn) -{ - ENTRY_LOG_CALLFLOW(); - - //This is to store the status of data availability over the network. - //If GPS is not enabled, the INIT_CHECK will fail and the modem will - //not be updated with the network's availability. Since the data status - //can change before GPS is enabled the, storing the status will enable - //us to inform the modem after GPS is enabled - agpsStatus = available; - - INIT_CHECK(loc_eng_data.adapter, return); - if (apn != NULL) - { - LOC_LOGD("loc_eng_agps_ril_update_network_availability: APN Name = [%s]\n", apn); - int apn_len = smaller_of(strlen (apn), MAX_APN_LEN); - LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngEnableData(adapter, apn, apn_len, available)); - } - EXIT_LOG(%s, VOID_RET); -} - -int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data, - const DerEncodedCertificate* certificates, - size_t numberOfCerts) -{ - ENTRY_LOG_CALLFLOW(); - int ret_val = AGPS_CERTIFICATE_OPERATION_SUCCESS; - - uint32_t slotBitMask = gps_conf.AGPS_CERT_WRITABLE_MASK; - uint32_t slotCount = 0; - for (uint32_t slotBitMaskCounter=slotBitMask; slotBitMaskCounter; slotCount++) { - slotBitMaskCounter &= slotBitMaskCounter - 1; - } - LOC_LOGD("SlotBitMask=%u SlotCount=%u NumberOfCerts=%u", - slotBitMask, slotCount, numberOfCerts); - - LocEngAdapter* adapter = loc_eng_data.adapter; - - if (numberOfCerts == 0) { - LOC_LOGE("No certs to install, since numberOfCerts is zero"); - ret_val = AGPS_CERTIFICATE_OPERATION_SUCCESS; - } else if (!adapter) { - LOC_LOGE("adapter is null!"); - ret_val = AGPS_CERTIFICATE_ERROR_GENERIC; - } else if (slotCount < numberOfCerts) { - LOC_LOGE("Not enough cert slots (%u) to install %u certs!", - slotCount, numberOfCerts); - ret_val = AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES; - } else { - for (int i=0; i < numberOfCerts; ++i) - { - if (certificates[i].length > AGPS_CERTIFICATE_MAX_LENGTH) { - LOC_LOGE("cert#(%u) length of %u is too big! greater than %u", - certificates[i].length, AGPS_CERTIFICATE_MAX_LENGTH); - ret_val = AGPS_CERTIFICATE_ERROR_GENERIC; - break; - } - } - - if (ret_val == AGPS_CERTIFICATE_OPERATION_SUCCESS) { - adapter->sendMsg(new LocEngInstallAGpsCert(adapter, - certificates, - numberOfCerts, - slotBitMask)); - } - } - - EXIT_LOG(%d, ret_val); - return ret_val; -} - -void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, - const char* config_data, int32_t length) -{ - ENTRY_LOG_CALLFLOW(); - - if (config_data && length > 0) { - loc_gps_cfg_s_type gps_conf_tmp = gps_conf; - UTIL_UPDATE_CONF(config_data, length, gps_conf_table); - LocEngAdapter* adapter = loc_eng_data.adapter; - - // it is possible that HAL is not init'ed at this time - if (adapter) { - if (gps_conf_tmp.SUPL_VER != gps_conf.SUPL_VER) { - adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); - } - if (gps_conf_tmp.LPP_PROFILE != gps_conf.LPP_PROFILE) { - adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); - } - if (gps_conf_tmp.A_GLONASS_POS_PROTOCOL_SELECT != gps_conf.A_GLONASS_POS_PROTOCOL_SELECT) { - adapter->sendMsg(new LocEngAGlonassProtocol(adapter, - gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); - } - if (gps_conf_tmp.SUPL_MODE != gps_conf.SUPL_MODE) { - adapter->sendMsg(new LocEngSuplMode(adapter)); - } - // we always update lock mask, this is because if this is dsds device, we would not - // know if modem has switched dds, if so, lock mask may also need to be updated. - // if we have power vote, HAL is on, lock mask 0; else gps_conf.GPS_LOCK. - adapter->setGpsLockMsg(adapter->getPowerVote() ? 0 : gps_conf.GPS_LOCK); - } - - gps_conf_tmp.SUPL_VER = gps_conf.SUPL_VER; - gps_conf_tmp.LPP_PROFILE = gps_conf.LPP_PROFILE; - gps_conf_tmp.A_GLONASS_POS_PROTOCOL_SELECT = gps_conf.A_GLONASS_POS_PROTOCOL_SELECT; - gps_conf_tmp.SUPL_MODE = gps_conf.SUPL_MODE; - gps_conf_tmp.SUPL_ES = gps_conf.SUPL_ES; - gps_conf_tmp.GPS_LOCK = gps_conf.GPS_LOCK; - gps_conf_tmp.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = - gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL; - gps_conf = gps_conf_tmp; - } - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_eng_report_status - -DESCRIPTION - Reports GPS engine state to Java layer. - -DEPENDENCIES - N/A - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusValue status) -{ - ENTRY_LOG(); - // Switch from WAIT to MUTE, for "engine on" or "session begin" event - if (status == GPS_STATUS_SESSION_BEGIN || status == GPS_STATUS_ENGINE_ON) - { - if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_WAIT) - { - LOC_LOGD("loc_eng_report_status: mute_session_state changed from WAIT to IN SESSION"); - loc_eng_data.mute_session_state = LOC_MUTE_SESS_IN_SESSION; - } - } - - // Switch off MUTE session - if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_IN_SESSION && - (status == GPS_STATUS_SESSION_END || status == GPS_STATUS_ENGINE_OFF)) - { - LOC_LOGD("loc_eng_report_status: mute_session_state changed from IN SESSION to NONE"); - loc_eng_data.mute_session_state = LOC_MUTE_SESS_NONE; - } - - // Session End is not reported during Android navigating state - boolean navigating = loc_eng_data.adapter->isInSession(); - if (status != GPS_STATUS_NONE && - !(status == GPS_STATUS_SESSION_END && navigating) && - !(status == GPS_STATUS_SESSION_BEGIN && !navigating)) - { - if (loc_eng_data.mute_session_state != LOC_MUTE_SESS_IN_SESSION) - { - // Inform GpsLocationProvider about mNavigating status - loc_inform_gps_status(loc_eng_data, status); - } - else { - LOC_LOGD("loc_eng_report_status: muting the status report."); - } - } - - // Only keeps ENGINE ON/OFF in engine_status - if (status == GPS_STATUS_ENGINE_ON || status == GPS_STATUS_ENGINE_OFF) - { - loc_eng_data.engine_status = status; - } - - // Only keeps SESSION BEGIN/END in fix_session_status - if (status == GPS_STATUS_SESSION_BEGIN || status == GPS_STATUS_SESSION_END) - { - loc_eng_data.fix_session_status = status; - } - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_eng_handle_engine_down - loc_eng_handle_engine_up - -DESCRIPTION - Calls this function when it is detected that modem restart is happening. - Either we detected the modem is down or received modem up event. - This must be called from the deferred thread to avoid race condition. - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - loc_eng_ni_reset_on_engine_restart(loc_eng_data); - loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_OFF); - EXIT_LOG(%s, VOID_RET); -} - -void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - loc_eng_reinit(loc_eng_data); - - loc_eng_data.adapter->requestPowerVote(); - - if (loc_eng_data.agps_status_cb != NULL) { - if (loc_eng_data.agnss_nif) - loc_eng_data.agnss_nif->dropAllSubscribers(); - if (loc_eng_data.internet_nif) - loc_eng_data.internet_nif->dropAllSubscribers(); - - loc_eng_agps_reinit(loc_eng_data); - } - - // modem is back up. If we crashed in the middle of navigating, we restart. - if (loc_eng_data.adapter->isInSession()) { - // This sets the copy in adapter to modem - loc_eng_data.adapter->setInSession(false); - loc_eng_start_handler(loc_eng_data); - } - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_eng_read_config - -DESCRIPTION - Initiates the reading of the gps config file stored in /etc dir - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_read_config(void) -{ - ENTRY_LOG_CALLFLOW(); - if(configAlreadyRead == false) - { - // Initialize our defaults before reading of configuration file overwrites them. - loc_default_parameters(); - // We only want to parse the conf file once. This is a good place to ensure that. - // In fact one day the conf file should go into context. - UTIL_READ_CONF(GPS_CONF_FILE, gps_conf_table); - UTIL_READ_CONF(SAP_CONF_FILE, sap_conf_table); - configAlreadyRead = true; - } else { - LOC_LOGV("GPS Config file has already been read\n"); - } - - EXIT_LOG(%d, 0); - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_gps_measurement_init - -DESCRIPTION - Initialize gps measurement module. - -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data, - GpsMeasurementCallbacks* callbacks) -{ - ENTRY_LOG_CALLFLOW(); - - STATE_CHECK((NULL == loc_eng_data.gnss_measurement_cb), - "gnss measurement already initialized", - return GPS_MEASUREMENT_ERROR_ALREADY_INIT); - STATE_CHECK((callbacks != NULL), - "callbacks can not be NULL", - return GPS_MEASUREMENT_ERROR_GENERIC); - STATE_CHECK(loc_eng_data.adapter, - "GpsInterface must be initialized first", - return GPS_MEASUREMENT_ERROR_GENERIC); - - // updated the mask - LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; - loc_eng_data.adapter->updateEvtMask(event, LOC_REGISTRATION_MASK_ENABLED); - // set up the callback - loc_eng_data.gnss_measurement_cb = callbacks->gnss_measurement_callback; - LOC_LOGD ("%s, event masks updated successfully", __func__); - - return GPS_MEASUREMENT_OPERATION_SUCCESS; -} - -/*=========================================================================== -FUNCTION loc_eng_gps_measurement_close - -DESCRIPTION - Close gps measurement module. - -DEPENDENCIES - N/A - -RETURN VALUE - N/A - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_gps_measurement_close(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG_CALLFLOW(); - - INIT_CHECK(loc_eng_data.adapter, return); - - // updated the mask - LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; - loc_eng_data.adapter->updateEvtMask(event, LOC_REGISTRATION_MASK_DISABLED); - // set up the callback - loc_eng_data.gnss_measurement_cb = NULL; - EXIT_LOG(%d, 0); -} diff --git a/gps/loc_api/libloc_api_50001/loc_eng.h b/gps/loc_api/libloc_api_50001/loc_eng.h deleted file mode 100644 index 6deebaa..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng.h +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright (c) 2009-2014, 2016 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_ENG_H -#define LOC_ENG_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -// Uncomment to keep all LOG messages (LOGD, LOGI, LOGV, etc.) -#define MAX_NUM_ATL_CONNECTIONS 2 - -// Define boolean type to be used by libgps on loc api module -typedef unsigned char boolean; - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -// The data connection minimal open time -#define DATA_OPEN_MIN_TIME 1 /* sec */ - -// The system sees GPS engine turns off after inactive for this period of time -#define GPS_AUTO_OFF_TIME 2 /* secs */ -#define SUCCESS TRUE -#define FAILURE FALSE -#define INVALID_ATL_CONNECTION_HANDLE -1 - -#define gps_conf ContextBase::mGps_conf -#define sap_conf ContextBase::mSap_conf - -enum loc_nmea_provider_e_type { - NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA - NMEA_PROVIDER_MP // Modem Processor Provider of NMEA -}; - -enum loc_mute_session_e_type { - LOC_MUTE_SESS_NONE = 0, - LOC_MUTE_SESS_WAIT, - LOC_MUTE_SESS_IN_SESSION -}; - -// Module data -typedef struct loc_eng_data_s -{ - LocEngAdapter *adapter; - loc_location_cb_ext location_cb; - gps_status_callback status_cb; - loc_sv_status_cb_ext sv_status_cb; - agps_status_extended agps_status_cb; - gps_nmea_callback nmea_cb; - loc_ni_notify_callback ni_notify_cb; - gps_set_capabilities set_capabilities_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - gps_request_utc_time request_utc_time_cb; - gnss_set_system_info set_system_info_cb; - gnss_sv_status_callback gnss_sv_status_cb; - gnss_measurement_callback gnss_measurement_cb; - boolean intermediateFix; - AGpsStatusValue agps_status; - loc_eng_xtra_data_s_type xtra_module_data; - loc_eng_ni_data_s_type loc_eng_ni_data; - - // AGPS state machines - AgpsStateMachine* agnss_nif; - AgpsStateMachine* internet_nif; - //State machine for Data Services - AgpsStateMachine* ds_nif; - - // GPS engine status - GpsStatusValue engine_status; - GpsStatusValue fix_session_status; - - // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off - GpsAidingData aiding_data_for_deletion; - - // For muting session broadcast - loc_mute_session_e_type mute_session_state; - - // For nmea generation - boolean generateNmea; - uint32_t gps_used_mask; - uint32_t glo_used_mask; - float hdop; - float pdop; - float vdop; - - // Address buffers, for addressing setting before init - int supl_host_set; - char supl_host_buf[101]; - int supl_port_buf; - int c2k_host_set; - char c2k_host_buf[101]; - int c2k_port_buf; - int mpc_host_set; - char mpc_host_buf[101]; - int mpc_port_buf; - - loc_ext_parser location_ext_parser; - loc_ext_parser sv_ext_parser; -} loc_eng_data_s_type; - -//loc_eng functions -int loc_eng_init(loc_eng_data_s_type &loc_eng_data, - LocCallbacks* callbacks, - LOC_API_ADAPTER_EVENT_MASK_T event, - ContextBase* context); -int loc_eng_start(loc_eng_data_s_type &loc_eng_data); -int loc_eng_stop(loc_eng_data_s_type &loc_eng_data); -void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data); -int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, - GpsUtcTime time, int64_t timeReference, - int uncertainty); -int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, - double latitude, double longitude, - float accuracy); -void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, - GpsAidingData f); -int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, - LocPosMode ¶ms); -const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, - const char* name); -int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, - LocServerType type, const char *hostname, int port); -void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); -int loc_eng_read_config(void); - -//loc_eng_agps functions -void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, - AGpsExtCallbacks* callbacks); -int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, - const char* apn, AGpsBearerType bearerType); -int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType); -int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType); -void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, - int avaiable, const char* apn); -int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data, - const DerEncodedCertificate* certificates, - size_t length); - -//loc_eng_xtra functions -int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, - GpsXtraExtCallbacks* callbacks); -int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, - char* data, int length); -int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data); -void loc_eng_xtra_version_check(loc_eng_data_s_type &loc_eng_data, int check); - -//loc_eng_ni functions -extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, - GpsNiExtCallbacks *callbacks); -extern void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, - int notif_id, GpsUserResponseType user_response); -extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, - const GpsNiNotification *notif, - const void* passThrough); -extern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data); - -void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, - const char* config_data, int32_t length); -int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data, - GpsMeasurementCallbacks* callbacks); -void loc_eng_gps_measurement_close(loc_eng_data_s_type &loc_eng_data); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif // LOC_ENG_H diff --git a/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp b/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp deleted file mode 100644 index 43af70f..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ /dev/null @@ -1,969 +0,0 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_eng" - -#include -#include -#include -#include -#include -#include - -//====================================================================== -// C callbacks -//====================================================================== - -// This is given to linked_list_add as the dealloc callback -// data -- an instance of Subscriber -static void deleteObj(void* data) -{ - delete (Subscriber*)data; -} - -// This is given to linked_list_search() as the comparison callback -// when the state manchine needs to process for particular subscriber -// fromCaller -- caller provides this obj -// fromList -- linked_list_search() function take this one from list -static bool hasSubscriber(void* fromCaller, void* fromList) -{ - Notification* notification = (Notification*)fromCaller; - Subscriber* s1 = (Subscriber*)fromList; - - return s1->forMe(*notification); -} - -// This is gvien to linked_list_search() to notify subscriber objs -// when the state machine needs to inform all subscribers of resource -// status changes, e.g. when resource is GRANTED. -// fromCaller -- caller provides this ptr to a Notification obj. -// fromList -- linked_list_search() function take this one from list -static bool notifySubscriber(void* fromCaller, void* fromList) -{ - Notification* notification = (Notification*)fromCaller; - Subscriber* s1 = (Subscriber*)fromList; - - // we notify every subscriber indiscriminatively - // each subscriber decides if this notification is interesting. - return s1->notifyRsrcStatus(*notification) && - // if we do not want to delete the subscriber from the - // the list, we must set this to false so this function - // returns false - notification->postNotifyDelete; -} - -//====================================================================== -// Notification -//====================================================================== -const int Notification::BROADCAST_ALL = 0x80000000; -const int Notification::BROADCAST_ACTIVE = 0x80000001; -const int Notification::BROADCAST_INACTIVE = 0x80000002; -const unsigned char DSStateMachine::MAX_START_DATA_CALL_RETRIES = 4; -const unsigned int DSStateMachine::DATA_CALL_RETRY_DELAY_MSEC = 500; -//====================================================================== -// Subscriber: BITSubscriber / ATLSubscriber / WIFISubscriber -//====================================================================== -bool Subscriber::forMe(Notification ¬ification) -{ - if (NULL != notification.rcver) { - return equals(notification.rcver); - } else { - return Notification::BROADCAST_ALL == notification.groupID || - (Notification::BROADCAST_ACTIVE == notification.groupID && - !isInactive()) || - (Notification::BROADCAST_INACTIVE == notification.groupID && - isInactive()); - } -} -bool BITSubscriber::equals(const Subscriber *s) const -{ - BITSubscriber* bitS = (BITSubscriber*)s; - - return (ID == bitS->ID && - (INADDR_NONE != (unsigned int)ID || - 0 == strncmp(mIPv6Addr, bitS->mIPv6Addr, sizeof(mIPv6Addr)))); -} - -bool BITSubscriber::notifyRsrcStatus(Notification ¬ification) -{ - bool notify = forMe(notification); - - if (notify) { - switch(notification.rsrcStatus) - { - case RSRC_UNSUBSCRIBE: - case RSRC_RELEASED: - loc_eng_dmn_conn_loc_api_server_data_conn( - LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, - GPSONE_LOC_API_IF_RELEASE_SUCCESS); - break; - case RSRC_DENIED: - loc_eng_dmn_conn_loc_api_server_data_conn( - LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, - GPSONE_LOC_API_IF_FAILURE); - break; - case RSRC_GRANTED: - loc_eng_dmn_conn_loc_api_server_data_conn( - LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, - GPSONE_LOC_API_IF_REQUEST_SUCCESS); - break; - default: - notify = false; - } - } - - return notify; -} - -bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) -{ - bool notify = forMe(notification); - - if (notify) { - switch(notification.rsrcStatus) - { - case RSRC_UNSUBSCRIBE: - case RSRC_RELEASED: - ((LocEngAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); - break; - case RSRC_DENIED: - { - AGpsExtType type = mBackwardCompatibleMode ? - AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, - (char*)mStateMachine->getAPN(), - mStateMachine->getBearer(), - type); - } - break; - case RSRC_GRANTED: - { - AGpsExtType type = mBackwardCompatibleMode ? - AGPS_TYPE_INVALID : mStateMachine->getType(); - ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, - (char*)mStateMachine->getAPN(), - mStateMachine->getBearer(), - type); - } - break; - default: - notify = false; - } - } - - return notify; -} - -bool WIFISubscriber::notifyRsrcStatus(Notification ¬ification) -{ - bool notify = forMe(notification); - - if (notify) { - switch(notification.rsrcStatus) - { - case RSRC_UNSUBSCRIBE: - break; - case RSRC_RELEASED: - loc_eng_dmn_conn_loc_api_server_data_conn( - senderId, - GPSONE_LOC_API_IF_RELEASE_SUCCESS); - break; - case RSRC_DENIED: - loc_eng_dmn_conn_loc_api_server_data_conn( - senderId, - GPSONE_LOC_API_IF_FAILURE); - break; - case RSRC_GRANTED: - loc_eng_dmn_conn_loc_api_server_data_conn( - senderId, - GPSONE_LOC_API_IF_REQUEST_SUCCESS); - break; - default: - notify = false; - } - } - - return notify; -} -bool DSSubscriber::notifyRsrcStatus(Notification ¬ification) -{ - bool notify = forMe(notification); - LOC_LOGD("DSSubscriber::notifyRsrcStatus. notify:%d \n",(int)(notify)); - if(notify) { - switch(notification.rsrcStatus) { - case RSRC_UNSUBSCRIBE: - case RSRC_RELEASED: - case RSRC_DENIED: - case RSRC_GRANTED: - ((DSStateMachine *)mStateMachine)->informStatus(notification.rsrcStatus, ID); - break; - default: - notify = false; - } - } - return notify; -} -void DSSubscriber :: setInactive() -{ - mIsInactive = true; - ((DSStateMachine *)mStateMachine)->informStatus(RSRC_UNSUBSCRIBE, ID); -} -//====================================================================== -// AgpsState: AgpsReleasedState / AgpsPendingState / AgpsAcquiredState -//====================================================================== - -// AgpsReleasedState -class AgpsReleasedState : public AgpsState -{ - friend class AgpsStateMachine; - - inline AgpsReleasedState(AgpsStateMachine* stateMachine) : - AgpsState(stateMachine) - { mReleasedState = this; } - - inline ~AgpsReleasedState() {} -public: - virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data); - inline virtual char* whoami() {return (char*)"AgpsReleasedState";} -}; - -AgpsState* AgpsReleasedState::onRsrcEvent(AgpsRsrcStatus event, void* data) -{ - LOC_LOGD("AgpsReleasedState::onRsrcEvent; event:%d\n", (int)event); - if (mStateMachine->hasSubscribers()) { - LOC_LOGE("Error: %s subscriber list not empty!!!", whoami()); - // I don't know how to recover from it. I am adding this rather - // for debugging purpose. - } - - AgpsState* nextState = this; - switch (event) - { - case RSRC_SUBSCRIBE: - { - // no notification until we get RSRC_GRANTED - // but we need to add subscriber to the list - mStateMachine->addSubscriber((Subscriber*)data); - // request from connecivity service for NIF - //The if condition is added so that if the data call setup fails - //for DS State Machine, we want to retry in released state. - //for AGps State Machine, sendRsrcRequest() will always return success - if(!mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN)) { - // move the state to PENDING - nextState = mPendingState; - } - } - break; - - case RSRC_UNSUBSCRIBE: - { - // the list should really be empty, nothing to remove. - // but we might as well just tell the client it is - // unsubscribed. False tolerance, right? - Subscriber* subscriber = (Subscriber*) data; - Notification notification(subscriber, event, false); - subscriber->notifyRsrcStatus(notification); - } - // break; - case RSRC_GRANTED: - case RSRC_RELEASED: - case RSRC_DENIED: - default: - LOC_LOGW("%s: unrecognized event %d", whoami(), event); - // no state change. - break; - } - - LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d", - whoami(), nextState->whoami(), event); - return nextState; -} - -// AgpsPendingState -class AgpsPendingState : public AgpsState -{ - friend class AgpsStateMachine; - - inline AgpsPendingState(AgpsStateMachine* stateMachine) : - AgpsState(stateMachine) - { mPendingState = this; } - - inline ~AgpsPendingState() {} -public: - virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data); - inline virtual char* whoami() {return (char*)"AgpsPendingState";} -}; - -AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data) -{ - AgpsState* nextState = this;; - LOC_LOGD("AgpsPendingState::onRsrcEvent; event:%d\n", (int)event); - switch (event) - { - case RSRC_SUBSCRIBE: - { - // already requested for NIF resource, - // do nothing until we get RSRC_GRANTED indication - // but we need to add subscriber to the list - mStateMachine->addSubscriber((Subscriber*)data); - // no state change. - } - break; - - case RSRC_UNSUBSCRIBE: - { - Subscriber* subscriber = (Subscriber*) data; - if (subscriber->waitForCloseComplete()) { - subscriber->setInactive(); - } else { - // auto notify this subscriber of the unsubscribe - Notification notification(subscriber, event, true); - mStateMachine->notifySubscribers(notification); - } - - // now check if there is any subscribers left - if (!mStateMachine->hasSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasedState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } else if (!mStateMachine->hasActiveSubscribers()) { - // only inactive subscribers, move to RELEASING state - nextState = mReleasingState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } - } - break; - - case RSRC_GRANTED: - { - nextState = mAcquiredState; - Notification notification(Notification::BROADCAST_ACTIVE, event, false); - // notify all subscribers NIF resource GRANTED - // by setting false, we keep subscribers on the linked list - mStateMachine->notifySubscribers(notification); - } - break; - - case RSRC_RELEASED: - // no state change. - // we are expecting either GRANTED or DENIED. Handling RELEASED - // may like break our state machine in race conditions. - break; - - case RSRC_DENIED: - { - nextState = mReleasedState; - Notification notification(Notification::BROADCAST_ALL, event, true); - // notify all subscribers NIF resource RELEASED or DENIED - // by setting true, we remove subscribers from the linked list - mStateMachine->notifySubscribers(notification); - } - break; - - default: - LOC_LOGE("%s: unrecognized event %d", whoami(), event); - // no state change. - } - - LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d", - whoami(), nextState->whoami(), event); - return nextState; -} - - -class AgpsAcquiredState : public AgpsState -{ - friend class AgpsStateMachine; - - inline AgpsAcquiredState(AgpsStateMachine* stateMachine) : - AgpsState(stateMachine) - { mAcquiredState = this; } - - inline ~AgpsAcquiredState() {} -public: - virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data); - inline virtual char* whoami() { return (char*)"AgpsAcquiredState"; } -}; - - -AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data) -{ - AgpsState* nextState = this; - LOC_LOGD("AgpsAcquiredState::onRsrcEvent; event:%d\n", (int)event); - switch (event) - { - case RSRC_SUBSCRIBE: - { - // we already have the NIF resource, simply notify subscriber - Subscriber* subscriber = (Subscriber*) data; - // we have rsrc in hand, so grant it right away - Notification notification(subscriber, RSRC_GRANTED, false); - subscriber->notifyRsrcStatus(notification); - // add subscriber to the list - mStateMachine->addSubscriber(subscriber); - // no state change. - } - break; - - case RSRC_UNSUBSCRIBE: - { - Subscriber* subscriber = (Subscriber*) data; - if (subscriber->waitForCloseComplete()) { - subscriber->setInactive(); - } else { - // auto notify this subscriber of the unsubscribe - Notification notification(subscriber, event, true); - mStateMachine->notifySubscribers(notification); - } - - // now check if there is any subscribers left - if (!mStateMachine->hasSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasedState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } else if (!mStateMachine->hasActiveSubscribers()) { - // only inactive subscribers, move to RELEASING state - nextState = mReleasingState; - - // tell connecivity service we can release NIF - mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); - } - } - break; - - case RSRC_GRANTED: - LOC_LOGW("%s: %d, RSRC_GRANTED already received", whoami(), event); - // no state change. - break; - - case RSRC_RELEASED: - { - LOC_LOGW("%s: %d, a force rsrc release", whoami(), event); - nextState = mReleasedState; - Notification notification(Notification::BROADCAST_ALL, event, true); - // by setting true, we remove subscribers from the linked list - mStateMachine->notifySubscribers(notification); - } - break; - - case RSRC_DENIED: - // no state change. - // we are expecting RELEASED. Handling DENIED - // may like break our state machine in race conditions. - break; - - default: - LOC_LOGE("%s: unrecognized event %d", whoami(), event); - // no state change. - } - - LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d", - whoami(), nextState->whoami(), event); - return nextState; -} - -// AgpsPendingState -class AgpsReleasingState : public AgpsState -{ - friend class AgpsStateMachine; - - inline AgpsReleasingState(AgpsStateMachine* stateMachine) : - AgpsState(stateMachine) - { mReleasingState = this; } - - inline ~AgpsReleasingState() {} -public: - virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data); - inline virtual char* whoami() {return (char*)"AgpsReleasingState";} -}; - -AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) -{ - AgpsState* nextState = this;; - LOC_LOGD("AgpsReleasingState::onRsrcEvent; event:%d\n", (int)event); - - switch (event) - { - case RSRC_SUBSCRIBE: - { - // already requested for NIF resource, - // do nothing until we get RSRC_GRANTED indication - // but we need to add subscriber to the list - mStateMachine->addSubscriber((Subscriber*)data); - // no state change. - } - break; - - case RSRC_UNSUBSCRIBE: - { - Subscriber* subscriber = (Subscriber*) data; - if (subscriber->waitForCloseComplete()) { - subscriber->setInactive(); - } else { - // auto notify this subscriber of the unsubscribe - Notification notification(subscriber, event, true); - mStateMachine->notifySubscribers(notification); - } - - // now check if there is any subscribers left - if (!mStateMachine->hasSubscribers()) { - // no more subscribers, move to RELEASED state - nextState = mReleasedState; - } - } - break; - - case RSRC_DENIED: - // A race condition subscriber unsubscribes before AFW denies resource. - case RSRC_RELEASED: - { - nextState = mAcquiredState; - Notification notification(Notification::BROADCAST_INACTIVE, event, true); - // notify all subscribers that are active NIF resource RELEASE - // by setting false, we keep subscribers on the linked list - mStateMachine->notifySubscribers(notification); - - if (mStateMachine->hasActiveSubscribers()) { - nextState = mPendingState; - // request from connecivity service for NIF - mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); - } else { - nextState = mReleasedState; - } - } - break; - - case RSRC_GRANTED: - default: - LOC_LOGE("%s: unrecognized event %d", whoami(), event); - // no state change. - } - - LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d", - whoami(), nextState->whoami(), event); - return nextState; -} -//====================================================================== -//Servicer -//====================================================================== -Servicer* Servicer :: getServicer(servicerType type, void *cb_func) -{ - LOC_LOGD(" Enter getServicer type:%d\n", (int)type); - switch(type) { - case servicerTypeNoCbParam: - return (new Servicer(cb_func)); - case servicerTypeExt: - return (new ExtServicer(cb_func)); - case servicerTypeAgps: - return (new AGpsServicer(cb_func)); - default: - return NULL; - } -} - -int Servicer :: requestRsrc(void *cb_data) -{ - callback(); - return 0; -} - -int ExtServicer :: requestRsrc(void *cb_data) -{ - int ret=-1; - LOC_LOGD("Enter ExtServicer :: requestRsrc\n"); - ret = callbackExt(cb_data); - LOC_LOGD("Exit ExtServicer :: requestRsrc\n"); - return(ret); -} - -int AGpsServicer :: requestRsrc(void *cb_data) -{ - callbackAGps((AGpsStatus *)cb_data); - return 0; -} - -//====================================================================== -// AgpsStateMachine -//====================================================================== - -AgpsStateMachine::AgpsStateMachine(servicerType servType, - void *cb_func, - AGpsExtType type, - bool enforceSingleSubscriber) : - mStatePtr(new AgpsReleasedState(this)),mType(type), - mAPN(NULL), - mAPNLen(0), - mBearer(AGPS_APN_BEARER_INVALID), - mEnforceSingleSubscriber(enforceSingleSubscriber), - mServicer(Servicer :: getServicer(servType, (void *)cb_func)) -{ - linked_list_init(&mSubscribers); - - // setting up mReleasedState - mStatePtr->mPendingState = new AgpsPendingState(this); - mStatePtr->mAcquiredState = new AgpsAcquiredState(this); - mStatePtr->mReleasingState = new AgpsReleasingState(this); - - // setting up mAcquiredState - mStatePtr->mAcquiredState->mReleasedState = mStatePtr; - mStatePtr->mAcquiredState->mPendingState = mStatePtr->mPendingState; - mStatePtr->mAcquiredState->mReleasingState = mStatePtr->mReleasingState; - - // setting up mPendingState - mStatePtr->mPendingState->mAcquiredState = mStatePtr->mAcquiredState; - mStatePtr->mPendingState->mReleasedState = mStatePtr; - mStatePtr->mPendingState->mReleasingState = mStatePtr->mReleasingState; - - // setting up mReleasingState - mStatePtr->mReleasingState->mReleasedState = mStatePtr; - mStatePtr->mReleasingState->mPendingState = mStatePtr->mPendingState; - mStatePtr->mReleasingState->mAcquiredState = mStatePtr->mAcquiredState; -} - -AgpsStateMachine::~AgpsStateMachine() -{ - dropAllSubscribers(); - - // free the 3 states. We must read out all 3 pointers first. - // Otherwise we run the risk of getting pointers from already - // freed memory. - AgpsState* acquiredState = mStatePtr->mAcquiredState; - AgpsState* releasedState = mStatePtr->mReleasedState; - AgpsState* pendindState = mStatePtr->mPendingState; - AgpsState* releasingState = mStatePtr->mReleasingState; - - delete acquiredState; - delete releasedState; - delete pendindState; - delete releasingState; - delete mServicer; - linked_list_destroy(&mSubscribers); - - if (NULL != mAPN) { - delete[] mAPN; - mAPN = NULL; - } -} - -void AgpsStateMachine::setAPN(const char* apn, unsigned int len) -{ - if (NULL != mAPN) { - delete mAPN; - } - - if (NULL != apn) { - mAPN = new char[len+1]; - memcpy(mAPN, apn, len); - mAPN[len] = NULL; - - mAPNLen = len; - } else { - mAPN = NULL; - mAPNLen = 0; - } -} - -void AgpsStateMachine::onRsrcEvent(AgpsRsrcStatus event) -{ - switch (event) - { - case RSRC_GRANTED: - case RSRC_RELEASED: - case RSRC_DENIED: - mStatePtr = mStatePtr->onRsrcEvent(event, NULL); - break; - default: - LOC_LOGW("AgpsStateMachine: unrecognized event %d", event); - break; - } -} - -void AgpsStateMachine::notifySubscribers(Notification& notification) const -{ - if (notification.postNotifyDelete) { - // just any non NULL value to get started - Subscriber* s = (Subscriber*)~0; - while (NULL != s) { - s = NULL; - // if the last param sets to true, _search will delete - // the node from the list for us. But the problem is - // once that is done, _search returns, leaving the - // rest of the list unprocessed. So we need a loop. - linked_list_search(mSubscribers, (void**)&s, notifySubscriber, - (void*)¬ification, true); - delete s; - } - } else { - // no loop needed if it the last param sets to false, which - // mean nothing gets deleted from the list. - linked_list_search(mSubscribers, NULL, notifySubscriber, - (void*)¬ification, false); - } -} - -void AgpsStateMachine::addSubscriber(Subscriber* subscriber) const -{ - Subscriber* s = NULL; - Notification notification((const Subscriber*)subscriber); - linked_list_search(mSubscribers, (void**)&s, - hasSubscriber, (void*)¬ification, false); - - if (NULL == s) { - linked_list_add(mSubscribers, subscriber->clone(), deleteObj); - } -} - -int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const -{ - Subscriber* s = NULL; - Notification notification(Notification::BROADCAST_ACTIVE); - linked_list_search(mSubscribers, (void**)&s, hasSubscriber, - (void*)¬ification, false); - - if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) { - AGpsExtStatus nifRequest; - nifRequest.size = sizeof(nifRequest); - nifRequest.type = mType; - nifRequest.status = action; - - if (s == NULL) { - nifRequest.ipv4_addr = INADDR_NONE; - memset(&nifRequest.addr, 0, sizeof(nifRequest.addr)); - nifRequest.ssid[0] = '\0'; - nifRequest.password[0] = '\0'; - } else { - s->setIPAddresses(nifRequest.addr); - s->setWifiInfo(nifRequest.ssid, nifRequest.password); - } - - CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); - mServicer->requestRsrc((void *)&nifRequest); - } - return 0; -} - -void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) -{ - if (mEnforceSingleSubscriber && hasSubscribers()) { - Notification notification(Notification::BROADCAST_ALL, RSRC_DENIED, true); - notifySubscriber(¬ification, subscriber); - } else { - mStatePtr = mStatePtr->onRsrcEvent(RSRC_SUBSCRIBE, (void*)subscriber); - } -} - -bool AgpsStateMachine::unsubscribeRsrc(Subscriber *subscriber) -{ - Subscriber* s = NULL; - Notification notification((const Subscriber*)subscriber); - linked_list_search(mSubscribers, (void**)&s, - hasSubscriber, (void*)¬ification, false); - - if (NULL != s) { - mStatePtr = mStatePtr->onRsrcEvent(RSRC_UNSUBSCRIBE, (void*)s); - return true; - } - return false; -} - -bool AgpsStateMachine::hasActiveSubscribers() const -{ - Subscriber* s = NULL; - Notification notification(Notification::BROADCAST_ACTIVE); - linked_list_search(mSubscribers, (void**)&s, - hasSubscriber, (void*)¬ification, false); - return NULL != s; -} - -//====================================================================== -// DSStateMachine -//====================================================================== -void delay_callback(void *callbackData, int result) -{ - if(callbackData) { - DSStateMachine *DSSMInstance = (DSStateMachine *)callbackData; - DSSMInstance->retryCallback(); - } - else { - LOC_LOGE(" NULL argument received. Failing.\n"); - goto err; - } -err: - return; -} - -DSStateMachine :: DSStateMachine(servicerType type, void *cb_func, - LocEngAdapter* adapterHandle): - AgpsStateMachine(type, cb_func, AGPS_TYPE_INVALID,false), - mLocAdapter(adapterHandle) -{ - LOC_LOGD("%s:%d]: New DSStateMachine\n", __func__, __LINE__); - mRetries = 0; -} - -void DSStateMachine :: retryCallback(void) -{ - DSSubscriber *subscriber = NULL; - Notification notification(Notification::BROADCAST_ACTIVE); - linked_list_search(mSubscribers, (void**)&subscriber, hasSubscriber, - (void*)¬ification, false); - if(subscriber) - mLocAdapter->requestSuplES(subscriber->ID); - else - LOC_LOGE("DSStateMachine :: retryCallback: No subscriber found." \ - "Cannot retry data call\n"); - return; -} - -int DSStateMachine :: sendRsrcRequest(AGpsStatusValue action) const -{ - DSSubscriber* s = NULL; - dsCbData cbData; - int ret=-1; - int connHandle=-1; - LOC_LOGD("Enter DSStateMachine :: sendRsrcRequest\n"); - Notification notification(Notification::BROADCAST_ACTIVE); - linked_list_search(mSubscribers, (void**)&s, hasSubscriber, - (void*)¬ification, false); - if(s) { - connHandle = s->ID; - LOC_LOGD("DSStateMachine :: sendRsrcRequest - subscriber found\n"); - } - else - LOC_LOGD("DSStateMachine :: sendRsrcRequest - No subscriber found\n"); - - cbData.action = action; - cbData.mAdapter = mLocAdapter; - ret = mServicer->requestRsrc((void *)&cbData); - //Only the request to start data call returns a success/failure - //The request to stop data call will always succeed - //Hence, the below block will only be executed when the - //request to start the data call fails - switch(ret) { - case LOC_API_ADAPTER_ERR_ENGINE_BUSY: - LOC_LOGD("DSStateMachine :: sendRsrcRequest - Failure returned: %d\n",ret); - ((DSStateMachine *)this)->incRetries(); - if(mRetries > MAX_START_DATA_CALL_RETRIES) { - LOC_LOGE(" Failed to start Data call. Fallback to normal ATL SUPL\n"); - informStatus(RSRC_DENIED, connHandle); - } - else { - if(loc_timer_start(DATA_CALL_RETRY_DELAY_MSEC, delay_callback, (void *)this)) { - LOC_LOGE("Error: Could not start delay thread\n"); - ret = -1; - goto err; - } - } - break; - case LOC_API_ADAPTER_ERR_UNSUPPORTED: - LOC_LOGE("No profile found for emergency call. Fallback to normal SUPL ATL\n"); - informStatus(RSRC_DENIED, connHandle); - break; - case LOC_API_ADAPTER_ERR_SUCCESS: - LOC_LOGD("%s:%d]: Request to start data call sent\n", __func__, __LINE__); - break; - case -1: - //One of the ways this case can be encountered is if the callback function - //receives a null argument, it just exits with -1 error - LOC_LOGE("Error: Something went wrong somewhere. Falling back to normal SUPL ATL\n"); - informStatus(RSRC_DENIED, connHandle); - break; - default: - LOC_LOGE("%s:%d]: Unrecognized return value\n", __func__, __LINE__); - } -err: - LOC_LOGD("EXIT DSStateMachine :: sendRsrcRequest; ret = %d\n", ret); - return ret; -} - -void DSStateMachine :: onRsrcEvent(AgpsRsrcStatus event) -{ - void* currState = (void *)mStatePtr; - LOC_LOGD("Enter DSStateMachine :: onRsrcEvent. event = %d\n", (int)event); - switch (event) - { - case RSRC_GRANTED: - LOC_LOGD("DSStateMachine :: onRsrcEvent RSRC_GRANTED\n"); - mStatePtr = mStatePtr->onRsrcEvent(event, NULL); - break; - case RSRC_RELEASED: - LOC_LOGD("DSStateMachine :: onRsrcEvent RSRC_RELEASED\n"); - mStatePtr = mStatePtr->onRsrcEvent(event, NULL); - //To handle the case where we get a RSRC_RELEASED in - //pending state, we translate that to a RSRC_DENIED state - //since the callback from DSI is either RSRC_GRANTED or RSRC_RELEASED - //for when the call is connected or disconnected respectively. - if((void *)mStatePtr != currState) - break; - else { - event = RSRC_DENIED; - LOC_LOGE(" Switching event to RSRC_DENIED\n"); - } - case RSRC_DENIED: - mStatePtr = mStatePtr->onRsrcEvent(event, NULL); - break; - default: - LOC_LOGW("AgpsStateMachine: unrecognized event %d", event); - break; - } - LOC_LOGD("Exit DSStateMachine :: onRsrcEvent. event = %d\n", (int)event); -} - -void DSStateMachine :: informStatus(AgpsRsrcStatus status, int ID) const -{ - LOC_LOGD("DSStateMachine :: informStatus. Status=%d\n",(int)status); - switch(status) { - case RSRC_UNSUBSCRIBE: - mLocAdapter->atlCloseStatus(ID, 1); - break; - case RSRC_RELEASED: - mLocAdapter->closeDataCall(); - break; - case RSRC_DENIED: - ((DSStateMachine *)this)->mRetries = 0; - mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL); - break; - case RSRC_GRANTED: - mLocAdapter->atlOpenStatus(ID, 1, - NULL, - AGPS_APN_BEARER_INVALID, - AGPS_TYPE_INVALID); - break; - default: - LOC_LOGW("DSStateMachine :: informStatus - unknown status"); - } - return; -} diff --git a/gps/loc_api/libloc_api_50001/loc_eng_agps.h b/gps/loc_api/libloc_api_50001/loc_eng_agps.h deleted file mode 100644 index 58ce084..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_agps.h +++ /dev/null @@ -1,435 +0,0 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef __LOC_ENG_AGPS_H__ -#define __LOC_ENG_AGPS_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(USE_GLIB) && !defined(OFF_TARGET) -#include -#endif /* USE_GLIB */ - -// forward declaration -class AgpsStateMachine; -struct Subscriber; - -// NIF resource events -typedef enum { - RSRC_SUBSCRIBE, - RSRC_UNSUBSCRIBE, - RSRC_GRANTED, - RSRC_RELEASED, - RSRC_DENIED, - RSRC_STATUS_MAX -} AgpsRsrcStatus; - -typedef enum { - servicerTypeNoCbParam, - servicerTypeAgps, - servicerTypeExt -}servicerType; - -//DS Callback struct -typedef struct { - LocEngAdapter *mAdapter; - AGpsStatusValue action; -}dsCbData; - -// information bundle for subscribers -struct Notification { - // goes to every subscriber - static const int BROADCAST_ALL; - // goes to every ACTIVE subscriber - static const int BROADCAST_ACTIVE; - // goes to every INACTIVE subscriber - static const int BROADCAST_INACTIVE; - - // go to a specific subscriber - const Subscriber* rcver; - // broadcast - const int groupID; - // the new resource status event - const AgpsRsrcStatus rsrcStatus; - // should the subscriber be deleted after the notification - const bool postNotifyDelete; - - // convenient constructor - inline Notification(const int broadcast, - const AgpsRsrcStatus status, - const bool deleteAfterwards) : - rcver(NULL), groupID(broadcast), rsrcStatus(status), - postNotifyDelete(deleteAfterwards) {} - - // convenient constructor - inline Notification(const Subscriber* subscriber, - const AgpsRsrcStatus status, - const bool deleteAfterwards) : - rcver(subscriber), groupID(-1), rsrcStatus(status), - postNotifyDelete(deleteAfterwards) {} - - // convenient constructor - inline Notification(const int broadcast) : - rcver(NULL), groupID(broadcast), rsrcStatus(RSRC_STATUS_MAX), - postNotifyDelete(false) {} - - // convenient constructor - inline Notification(const Subscriber* subscriber) : - rcver(subscriber), groupID(-1), rsrcStatus(RSRC_STATUS_MAX), - postNotifyDelete(false) {} -}; - -class AgpsState { - // allows AgpsStateMachine to access private data - // no class members are public. We don't want - // anyone but state machine to use state. - friend class AgpsStateMachine; - friend class DSStateMachine; - // state transitions are done here. - // Each state implements its own transitions (of course). - inline virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data) = 0; - -protected: - // handle back to state machine - const AgpsStateMachine* mStateMachine; - // each state has pointers to all 3 states - // one of which is to itself. - AgpsState* mReleasedState; - AgpsState* mAcquiredState; - AgpsState* mPendingState; - AgpsState* mReleasingState; - - inline AgpsState(const AgpsStateMachine *stateMachine) : - mStateMachine(stateMachine), - mReleasedState(NULL), - mAcquiredState(NULL), - mPendingState(NULL), - mReleasingState(NULL) {} - virtual ~AgpsState() {} - -public: - // for logging purpose - inline virtual char* whoami() = 0; -}; - -class Servicer { - void (*callback)(void); -public: - static Servicer* getServicer(servicerType type, void *cb_func); - virtual int requestRsrc(void *cb_data); - Servicer() {} - Servicer(void *cb_func) - { callback = (void(*)(void))(cb_func); } - virtual ~Servicer(){} - inline virtual char *whoami() {return (char*)"Servicer";} -}; - -class ExtServicer : public Servicer { - int (*callbackExt)(void *cb_data); -public: - int requestRsrc(void *cb_data); - ExtServicer() {} - ExtServicer(void *cb_func) - { callbackExt = (int(*)(void *))(cb_func); } - virtual ~ExtServicer(){} - inline virtual char *whoami() {return (char*)"ExtServicer";} -}; - -class AGpsServicer : public Servicer { - void (*callbackAGps)(AGpsStatus* status); -public: - int requestRsrc(void *cb_data); - AGpsServicer() {} - AGpsServicer(void *cb_func) - { callbackAGps = (void(*)(AGpsStatus *))(cb_func); } - virtual ~AGpsServicer(){} - inline virtual char *whoami() {return (char*)"AGpsServicer";} -}; - -class AgpsStateMachine { -protected: - // a linked list of subscribers. - void* mSubscribers; - //handle to whoever provides the service - Servicer *mServicer; - // allows AgpsState to access private data - // each state is really internal data to the - // state machine, so it should be able to - // access anything within the state machine. - friend class AgpsState; - // pointer to the current state. - AgpsState* mStatePtr; -private: - // NIF type: AGNSS or INTERNET. - const AGpsExtType mType; - // apn to the NIF. Each state machine tracks - // resource state of a particular NIF. For each - // NIF, there is also an active APN. - char* mAPN; - // for convenience, we don't do strlen each time. - unsigned int mAPNLen; - // bear - AGpsBearerType mBearer; - // ipv4 address for routing - bool mEnforceSingleSubscriber; - -public: - AgpsStateMachine(servicerType servType, void *cb_func, - AGpsExtType type, bool enforceSingleSubscriber); - virtual ~AgpsStateMachine(); - - // self explanatory methods below - void setAPN(const char* apn, unsigned int len); - inline const char* getAPN() const { return (const char*)mAPN; } - inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } - inline AGpsBearerType getBearer() const { return mBearer; } - inline AGpsExtType getType() const { return (AGpsExtType)mType; } - - // someone, a ATL client or BIT, is asking for NIF - void subscribeRsrc(Subscriber *subscriber); - - // someone, a ATL client or BIT, is done with NIF - bool unsubscribeRsrc(Subscriber *subscriber); - - // add a subscriber in the linked list, if not already there. - void addSubscriber(Subscriber* subscriber) const; - - virtual void onRsrcEvent(AgpsRsrcStatus event); - - // put the data together and send the FW - virtual int sendRsrcRequest(AGpsStatusValue action) const; - - //if list is empty, linked_list_empty returns 1 - //else if list is not empty, returns 0 - //so hasSubscribers() returns 1 if list is not empty - //and returns 0 if list is empty - inline bool hasSubscribers() const - { return !linked_list_empty(mSubscribers); } - - bool hasActiveSubscribers() const; - - inline void dropAllSubscribers() const - { linked_list_flush(mSubscribers); } - - // private. Only a state gets to call this. - void notifySubscribers(Notification& notification) const; - -}; - -class DSStateMachine : public AgpsStateMachine { - static const unsigned char MAX_START_DATA_CALL_RETRIES; - static const unsigned int DATA_CALL_RETRY_DELAY_MSEC; - LocEngAdapter* mLocAdapter; - unsigned char mRetries; -public: - DSStateMachine(servicerType type, - void *cb_func, - LocEngAdapter* adapterHandle); - int sendRsrcRequest(AGpsStatusValue action) const; - void onRsrcEvent(AgpsRsrcStatus event); - void retryCallback(); - void informStatus(AgpsRsrcStatus status, int ID) const; - inline void incRetries() {mRetries++;} - inline virtual char *whoami() {return (char*)"DSStateMachine";} -}; - -// each subscriber is a AGPS client. In the case of ATL, there could be -// multiple clients from modem. In the case of BIT, there is only one -// cilent from BIT daemon. -struct Subscriber { - const uint32_t ID; - const AgpsStateMachine* mStateMachine; - inline Subscriber(const int id, - const AgpsStateMachine* stateMachine) : - ID(id), mStateMachine(stateMachine) {} - inline virtual ~Subscriber() {} - - virtual void setIPAddresses(uint32_t &v4, char* v6) = 0; - virtual void setIPAddresses(struct sockaddr_storage& addr) = 0; - inline virtual void setWifiInfo(char* ssid, char* password) - { ssid[0] = 0; password[0] = 0; } - - inline virtual bool equals(const Subscriber *s) const - { return ID == s->ID; } - - // notifies a subscriber a new NIF resource status, usually - // either GRANTE, DENIED, or RELEASED - virtual bool notifyRsrcStatus(Notification ¬ification) = 0; - - virtual bool waitForCloseComplete() { return false; } - virtual void setInactive() {} - virtual bool isInactive() { return false; } - - virtual Subscriber* clone() = 0; - // checks if this notification is for me, i.e. - // either has my id, or has a broadcast id. - bool forMe(Notification ¬ification); -}; - -// BITSubscriber, created with requests from BIT daemon -struct BITSubscriber : public Subscriber { - char mIPv6Addr[16]; - - inline BITSubscriber(const AgpsStateMachine* stateMachine, - unsigned int ipv4, char* ipv6) : - Subscriber(ipv4, stateMachine) - { - if (NULL == ipv6) { - mIPv6Addr[0] = 0; - } else { - memcpy(mIPv6Addr, ipv6, sizeof(mIPv6Addr)); - } - } - - virtual bool notifyRsrcStatus(Notification ¬ification); - - inline virtual void setIPAddresses(uint32_t &v4, char* v6) - { v4 = ID; memcpy(v6, mIPv6Addr, sizeof(mIPv6Addr)); } - - inline virtual void setIPAddresses(struct sockaddr_storage& addr) - { addr.ss_family = AF_INET6;/*todo: convert mIPv6Addr into addr */ } - - virtual Subscriber* clone() - { - return new BITSubscriber(mStateMachine, ID, mIPv6Addr); - } - - virtual bool equals(const Subscriber *s) const; - inline virtual ~BITSubscriber(){} -}; - -// ATLSubscriber, created with requests from ATL -struct ATLSubscriber : public Subscriber { - const LocEngAdapter* mLocAdapter; - const bool mBackwardCompatibleMode; - inline ATLSubscriber(const int id, - const AgpsStateMachine* stateMachine, - const LocEngAdapter* adapter, - const bool compatibleMode) : - Subscriber(id, stateMachine), mLocAdapter(adapter), - mBackwardCompatibleMode(compatibleMode){} - virtual bool notifyRsrcStatus(Notification ¬ification); - - inline virtual void setIPAddresses(uint32_t &v4, char* v6) - { v4 = INADDR_NONE; v6[0] = 0; } - - inline virtual void setIPAddresses(struct sockaddr_storage& addr) - { addr.ss_family = AF_INET6; } - - inline virtual Subscriber* clone() - { - return new ATLSubscriber(ID, mStateMachine, mLocAdapter, - mBackwardCompatibleMode); - } - inline virtual ~ATLSubscriber(){} -}; - -// WIFISubscriber, created with requests from MSAPM or QuIPC -struct WIFISubscriber : public Subscriber { - char * mSSID; - char * mPassword; - loc_if_req_sender_id_e_type senderId; - bool mIsInactive; - inline WIFISubscriber(const AgpsStateMachine* stateMachine, - char * ssid, char * password, loc_if_req_sender_id_e_type sender_id) : - Subscriber(sender_id, stateMachine), - mSSID(NULL == ssid ? NULL : new char[SSID_BUF_SIZE]), - mPassword(NULL == password ? NULL : new char[SSID_BUF_SIZE]), - senderId(sender_id) - { - if (NULL != mSSID) - strlcpy(mSSID, ssid, SSID_BUF_SIZE); - if (NULL != mPassword) - strlcpy(mPassword, password, SSID_BUF_SIZE); - mIsInactive = false; - } - - virtual bool notifyRsrcStatus(Notification ¬ification); - - inline virtual void setIPAddresses(uint32_t &v4, char* v6) {} - - inline virtual void setIPAddresses(struct sockaddr_storage& addr) - { addr.ss_family = AF_INET6; } - - inline virtual void setWifiInfo(char* ssid, char* password) - { - if (NULL != mSSID) - strlcpy(ssid, mSSID, SSID_BUF_SIZE); - else - ssid[0] = '\0'; - if (NULL != mPassword) - strlcpy(password, mPassword, SSID_BUF_SIZE); - else - password[0] = '\0'; - } - - inline virtual bool waitForCloseComplete() { return true; } - - inline virtual void setInactive() { mIsInactive = true; } - inline virtual bool isInactive() { return mIsInactive; } - - virtual Subscriber* clone() - { - return new WIFISubscriber(mStateMachine, mSSID, mPassword, senderId); - } - inline virtual ~WIFISubscriber(){} -}; - -struct DSSubscriber : public Subscriber { - bool mIsInactive; - inline DSSubscriber(const AgpsStateMachine *stateMachine, - const int id) : - Subscriber(id, stateMachine) - { - mIsInactive = false; - } - inline virtual void setIPAddresses(uint32_t &v4, char* v6) {} - inline virtual void setIPAddresses(struct sockaddr_storage& addr) - { addr.ss_family = AF_INET6; } - virtual Subscriber* clone() - {return new DSSubscriber(mStateMachine, ID);} - virtual bool notifyRsrcStatus(Notification ¬ification); - inline virtual bool waitForCloseComplete() { return true; } - virtual void setInactive(); - inline virtual bool isInactive() - { return mIsInactive; } - inline virtual ~DSSubscriber(){} - inline virtual char *whoami() {return (char*)"DSSubscriber";} -}; - -#endif //__LOC_ENG_AGPS_H__ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp deleted file mode 100644 index 5510fc5..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "loc_eng_dmn_conn_glue_msg.h" -#include "loc_eng_dmn_conn_handler.h" -#include "loc_eng_dmn_conn.h" -#include "loc_eng_msg.h" - -static int loc_api_server_msgqid; -static int loc_api_resp_msgqid; -static int quipc_msgqid; -static int msapm_msgqid; -static int msapu_msgqid; - -static const char * global_loc_api_q_path = GPSONE_LOC_API_Q_PATH; -static const char * global_loc_api_resp_q_path = GPSONE_LOC_API_RESP_Q_PATH; -static const char * global_quipc_ctrl_q_path = QUIPC_CTRL_Q_PATH; -static const char * global_msapm_ctrl_q_path = MSAPM_CTRL_Q_PATH; -static const char * global_msapu_ctrl_q_path = MSAPU_CTRL_Q_PATH; - -static int loc_api_server_proc_init(void *context) -{ - loc_api_server_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_q_path, O_RDWR); - //change mode/group for the global_loc_api_q_path pipe - int result = chmod (global_loc_api_q_path, 0660); - if (result != 0) - { - LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_q_path, strerror(errno)); - } - - struct group * gps_group = getgrnam("gps"); - if (gps_group != NULL) - { - result = chown (global_loc_api_q_path, -1, gps_group->gr_gid); - if (result != 0) - { - LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n", - global_loc_api_q_path, gps_group->gr_gid, result, strerror(errno)); - } - } - else - { - LOC_LOGE("getgrnam for gps failed, error code = %d\n", errno); - } - - loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_q_path, O_RDWR); - - //change mode/group for the global_loc_api_resp_q_path pipe - result = chmod (global_loc_api_resp_q_path, 0660); - if (result != 0) - { - LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_resp_q_path, strerror(errno)); - } - - if (gps_group != NULL) - { - result = chown (global_loc_api_resp_q_path, -1, gps_group->gr_gid); - if (result != 0) - { - LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n", - global_loc_api_resp_q_path, - gps_group->gr_gid, result, strerror(errno)); - } - } - - quipc_msgqid = loc_eng_dmn_conn_glue_msgget(global_quipc_ctrl_q_path, O_RDWR); - msapm_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapm_ctrl_q_path , O_RDWR); - msapu_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapu_ctrl_q_path , O_RDWR); - - LOC_LOGD("%s:%d] loc_api_server_msgqid = %d\n", __func__, __LINE__, loc_api_server_msgqid); - return 0; -} - -static int loc_api_server_proc_pre(void *context) -{ - return 0; -} - -static int loc_api_server_proc(void *context) -{ - int length, sz; - int result = 0; - static int cnt = 0; - struct ctrl_msgbuf * p_cmsgbuf; - struct ctrl_msgbuf cmsg_resp; - - sz = sizeof(struct ctrl_msgbuf) + 256; - p_cmsgbuf = (struct ctrl_msgbuf *) malloc(sz); - - if (!p_cmsgbuf) { - LOC_LOGE("%s:%d] Out of memory\n", __func__, __LINE__); - return -1; - } - - cnt ++; - LOC_LOGD("%s:%d] %d listening on %s...\n", __func__, __LINE__, cnt, (char *) context); - length = loc_eng_dmn_conn_glue_msgrcv(loc_api_server_msgqid, p_cmsgbuf, sz); - if (length <= 0) { - free(p_cmsgbuf); - LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); - usleep(1000); - return -1; - } - - LOC_LOGD("%s:%d] received ctrl_type = %d\n", __func__, __LINE__, p_cmsgbuf->ctrl_type); - switch(p_cmsgbuf->ctrl_type) { - case GPSONE_LOC_API_IF_REQUEST: - result = loc_eng_dmn_conn_loc_api_server_if_request_handler(p_cmsgbuf, length); - break; - - case GPSONE_LOC_API_IF_RELEASE: - result = loc_eng_dmn_conn_loc_api_server_if_release_handler(p_cmsgbuf, length); - break; - - case GPSONE_UNBLOCK: - LOC_LOGD("%s:%d] GPSONE_UNBLOCK\n", __func__, __LINE__); - break; - - default: - LOC_LOGE("%s:%d] unsupported ctrl_type = %d\n", - __func__, __LINE__, p_cmsgbuf->ctrl_type); - break; - } - - free(p_cmsgbuf); - return 0; -} - -static int loc_api_server_proc_post(void *context) -{ - LOC_LOGD("%s:%d]\n", __func__, __LINE__); - loc_eng_dmn_conn_glue_msgremove( global_loc_api_q_path, loc_api_server_msgqid); - loc_eng_dmn_conn_glue_msgremove( global_loc_api_resp_q_path, loc_api_resp_msgqid); - loc_eng_dmn_conn_glue_msgremove( global_quipc_ctrl_q_path, quipc_msgqid); - loc_eng_dmn_conn_glue_msgremove( global_msapm_ctrl_q_path, msapm_msgqid); - loc_eng_dmn_conn_glue_msgremove( global_msapu_ctrl_q_path, msapu_msgqid); - return 0; -} - -static int loc_eng_dmn_conn_unblock_proc(void) -{ - struct ctrl_msgbuf cmsgbuf; - cmsgbuf.ctrl_type = GPSONE_UNBLOCK; - LOC_LOGD("%s:%d]\n", __func__, __LINE__); - loc_eng_dmn_conn_glue_msgsnd(loc_api_server_msgqid, & cmsgbuf, sizeof(cmsgbuf)); - return 0; -} - -static struct loc_eng_dmn_conn_thelper thelper; - -int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread_cb, - const char * loc_api_q_path, const char * resp_q_path, void *agps_handle) -{ - int result; - - loc_api_handle = agps_handle; - - if (loc_api_q_path) global_loc_api_q_path = loc_api_q_path; - if (resp_q_path) global_loc_api_resp_q_path = resp_q_path; - - result = loc_eng_dmn_conn_launch_thelper( &thelper, - loc_api_server_proc_init, - loc_api_server_proc_pre, - loc_api_server_proc, - loc_api_server_proc_post, - create_thread_cb, - (char *) global_loc_api_q_path); - if (result != 0) { - LOC_LOGE("%s:%d]\n", __func__, __LINE__); - return -1; - } - return 0; -} - -int loc_eng_dmn_conn_loc_api_server_unblock(void) -{ - loc_eng_dmn_conn_unblock_thelper(&thelper); - loc_eng_dmn_conn_unblock_proc(); - return 0; -} - -int loc_eng_dmn_conn_loc_api_server_join(void) -{ - loc_eng_dmn_conn_join_thelper(&thelper); - return 0; -} - -int loc_eng_dmn_conn_loc_api_server_data_conn(int sender_id, int status) { - struct ctrl_msgbuf cmsgbuf; - LOC_LOGD("%s:%d] quipc_msgqid = %d\n", __func__, __LINE__, quipc_msgqid); - cmsgbuf.ctrl_type = GPSONE_LOC_API_RESPONSE; - cmsgbuf.cmsg.cmsg_response.result = status; - switch (sender_id) { - case LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC: { - LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC", __func__, __LINE__); - if (loc_eng_dmn_conn_glue_msgsnd(quipc_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) { - LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__); - return -1; - } - break; - } - case LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM: { - LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM", __func__, __LINE__); - if (loc_eng_dmn_conn_glue_msgsnd(msapm_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) { - LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__); - return -1; - } - break; - } - case LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU: { - LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU", __func__, __LINE__); - if (loc_eng_dmn_conn_glue_msgsnd(msapu_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) { - LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__); - return -1; - } - break; - } - case LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON: { - LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON", __func__, __LINE__); - if (loc_eng_dmn_conn_glue_msgsnd(loc_api_resp_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) { - LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__); - return -1; - } - break; - } - default: { - LOC_LOGD("%s:%d] invalid sender ID!", __func__, __LINE__); - } - } - return 0; -} - diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h deleted file mode 100644 index 1d8c142..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_ENG_DATA_SERVER_H -#define LOC_ENG_DATA_SERVER_H - -#include "loc_eng_dmn_conn_thread_helper.h" - -#ifdef _ANDROID_ - -#define GPSONE_LOC_API_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_q" -#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_resp_q" -#define QUIPC_CTRL_Q_PATH "/data/misc/location/gpsone_d/quipc_ctrl_q" -#define MSAPM_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapm_ctrl_q" -#define MSAPU_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapu_ctrl_q" - -#else - -#define GPSONE_LOC_API_Q_PATH "/tmp/gpsone_loc_api_q" -#define GPSONE_LOC_API_RESP_Q_PATH "/tmp/gpsone_loc_api_resp_q" -#define QUIPC_CTRL_Q_PATH "/tmp/quipc_ctrl_q" -#define MSAPM_CTRL_Q_PATH "/tmp/msapm_ctrl_q" -#define MSAPU_CTRL_Q_PATH "/tmp/msapu_ctrl_q" - -#endif - -int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread_cb, - const char * loc_api_q_path, const char * ctrl_q_path, void *agps_handle); -int loc_eng_dmn_conn_loc_api_server_unblock(void); -int loc_eng_dmn_conn_loc_api_server_join(void); -int loc_eng_dmn_conn_loc_api_server_data_conn(int, int); - -#endif /* LOC_ENG_DATA_SERVER_H */ - diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c deleted file mode 100644 index e947fa1..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c +++ /dev/null @@ -1,222 +0,0 @@ -/* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include -#include - -#include - -#include -#include "loc_eng_dmn_conn_glue_msg.h" -#include "loc_eng_dmn_conn_handler.h" - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_msgget - -DESCRIPTION - This function get a message queue - - q_path - name path of the message queue - mode - - -DEPENDENCIES - None - -RETURN VALUE - message queue id - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_msgget(const char * q_path, int mode) -{ - int msgqid; - msgqid = loc_eng_dmn_conn_glue_pipeget(q_path, mode); - return msgqid; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_msgremove - -DESCRIPTION - remove a message queue - - q_path - name path of the message queue - msgqid - message queue id - -DEPENDENCIES - None - -RETURN VALUE - 0: success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_msgremove(const char * q_path, int msgqid) -{ - int result; - result = loc_eng_dmn_conn_glue_piperemove(q_path, msgqid); - return result; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_msgsnd - -DESCRIPTION - Send a message - - msgqid - message queue id - msgp - pointer to the message to be sent - msgsz - size of the message - -DEPENDENCIES - None - -RETURN VALUE - number of bytes sent out or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_msgsnd(int msgqid, const void * msgp, size_t msgsz) -{ - int result; - struct ctrl_msgbuf *pmsg = (struct ctrl_msgbuf *) msgp; - pmsg->msgsz = msgsz; - - result = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, msgsz); - if (result != (int) msgsz) { - LOC_LOGE("%s:%d] pipe broken %d, msgsz = %d\n", __func__, __LINE__, result, (int) msgsz); - return -1; - } - - return result; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_msgrcv - -DESCRIPTION - receive a message - - msgqid - message queue id - msgp - pointer to the buffer to hold the message - msgsz - size of the buffer - -DEPENDENCIES - None - -RETURN VALUE - number of bytes received or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_msgrcv(int msgqid, void *msgp, size_t msgbufsz) -{ - int result; - struct ctrl_msgbuf *pmsg = (struct ctrl_msgbuf *) msgp; - - result = loc_eng_dmn_conn_glue_piperead(msgqid, &(pmsg->msgsz), sizeof(pmsg->msgsz)); - if (result != sizeof(pmsg->msgsz)) { - LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); - return -1; - } - - if (msgbufsz < pmsg->msgsz) { - LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgbufsz, (int) pmsg->msgsz); - return -1; - } - - result = loc_eng_dmn_conn_glue_piperead(msgqid, (uint8_t *) msgp + sizeof(pmsg->msgsz), pmsg->msgsz - sizeof(pmsg->msgsz)); - if (result != (int) (pmsg->msgsz - sizeof(pmsg->msgsz))) { - LOC_LOGE("%s:%d] pipe broken %d, msgsz = %d\n", __func__, __LINE__, result, (int) pmsg->msgsz); - return -1; - } - - return pmsg->msgsz; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_msgunblock - -DESCRIPTION - unblock a message queue - - msgqid - message queue id - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_msgunblock(int msgqid) -{ - return loc_eng_dmn_conn_glue_pipeunblock(msgqid); -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_msgflush - -DESCRIPTION - flush out the message in a queue - - msgqid - message queue id - -DEPENDENCIES - None - -RETURN VALUE - number of bytes that are flushed out. - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_msgflush(int msgqid) -{ - int length; - char buf[128]; - - do { - length = loc_eng_dmn_conn_glue_piperead(msgqid, buf, 128); - LOC_LOGD("%s:%d] %s\n", __func__, __LINE__, buf); - } while(length); - return length; -} - diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h deleted file mode 100644 index d685c87..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_ENG_DMN_CONN_GLUE_MSG_H -#define LOC_ENG_DMN_CONN_GLUE_MSG_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -#include -#include "loc_eng_dmn_conn_glue_pipe.h" - -int loc_eng_dmn_conn_glue_msgget(const char * q_path, int mode); -int loc_eng_dmn_conn_glue_msgremove(const char * q_path, int msgqid); -int loc_eng_dmn_conn_glue_msgsnd(int msgqid, const void * msgp, size_t msgsz); -int loc_eng_dmn_conn_glue_msgrcv(int msgqid, void *msgp, size_t msgsz); -int loc_eng_dmn_conn_glue_msgflush(int msgqid); -int loc_eng_dmn_conn_glue_msgunblock(int msgqid); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* LOC_ENG_DMN_CONN_GLUE_MSG_H */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c deleted file mode 100644 index cbc4ea6..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c +++ /dev/null @@ -1,215 +0,0 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include -#include -#include - -// #include -#include -// #include -#include -#include - -#include "loc_eng_dmn_conn_glue_pipe.h" -#include -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_pipeget - -DESCRIPTION - create a named pipe. - - pipe_name - pipe name path - mode - mode - -DEPENDENCIES - None - -RETURN VALUE - 0: success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode) -{ - int fd; - int result; - - LOC_LOGD("%s, mode = %d\n", pipe_name, mode); - result = mkfifo(pipe_name, 0660); - - if ((result == -1) && (errno != EEXIST)) { - LOC_LOGE("failed: %s\n", strerror(errno)); - return result; - } - - // The mode in mkfifo is not honoured and does not provide the - // group permissions. Doing chmod to add group permissions. - result = chmod (pipe_name, 0660); - if (result != 0){ - LOC_LOGE ("%s failed to change mode for %s, error = %s\n", __func__, - pipe_name, strerror(errno)); - } - - fd = open(pipe_name, mode); - if (fd <= 0) - { - LOC_LOGE("failed: %s\n", strerror(errno)); - } - LOC_LOGD("fd = %d, %s\n", fd, pipe_name); - return fd; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_piperemove - -DESCRIPTION - remove a pipe - - pipe_name - pipe name path - fd - fd for the pipe - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd) -{ - close(fd); - if (pipe_name != NULL) { - unlink(pipe_name); - LOC_LOGD("fd = %d, %s\n", fd, pipe_name); - } - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_pipewrite - -DESCRIPTION - write to a pipe - - fd - fd of a pipe - buf - buffer for the data to write - sz - size of the data in buffer - -DEPENDENCIES - None - -RETURN VALUE - number of bytes written or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_pipewrite(int fd, const void * buf, size_t sz) -{ - int result; - - result = write(fd, buf, sz); - - /* @todo check for non EINTR & EAGAIN, shall not do select again, select_tut Law 7) */ - - /* LOC_LOGD("fd = %d, buf = 0x%lx, size = %d, result = %d\n", fd, (long) buf, (int) sz, (int) result); */ - return result; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_piperead - -DESCRIPTION - read from a pipe - - fd - fd for the pipe - buf - buffer to hold the data read from pipe - sz - size of the buffer - -DEPENDENCIES - None - -RETURN VALUE - number of bytes read from pipe or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_piperead(int fd, void * buf, size_t sz) -{ - int len; - - len = read(fd, buf, sz); - - /* @todo check for non EINTR & EAGAIN, shall not do select again, select_tut Law 7) */ - - /* LOC_LOGD("fd = %d, buf = 0x%lx, size = %d, len = %d\n", fd, (long) buf, (int) sz, len); */ - return len; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_glue_pipeunblock - -DESCRIPTION - unblock a pipe - - fd - fd for the pipe - -DEPENDENCIES - None - -RETURN VALUE - 0 for success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_glue_pipeunblock(int fd) -{ - int result; - struct flock flock_v; - LOC_LOGD("\n"); -// result = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NDELAY); - flock_v.l_type = F_UNLCK; - flock_v.l_len = 32; - result = fcntl(fd, F_SETLK, &flock_v); - if (result < 0) { - LOC_LOGE("fcntl failure, %s\n", strerror(errno)); - } - - return result; -} diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h deleted file mode 100644 index b2fa3a0..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_ENG_DMN_CONN_GLUE_PIPE_H -#define LOC_ENG_DMN_CONN_GLUE_PIPE_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode); -int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd); -int loc_eng_dmn_conn_glue_pipewrite(int fd, const void * buf, size_t sz); -int loc_eng_dmn_conn_glue_piperead(int fd, void * buf, size_t sz); - -int loc_eng_dmn_conn_glue_pipeflush(int fd); -int loc_eng_dmn_conn_glue_pipeunblock(int fd); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* LOC_ENG_DMN_CONN_GLUE_PIPE_H */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp deleted file mode 100644 index 137f686..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include -#include -#include -#include - -#include -#include "loc_eng_msg.h" -#include "loc_eng_dmn_conn.h" -#include "loc_eng_dmn_conn_handler.h" - -void* loc_api_handle = NULL; - -int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, int len) -{ - LOC_LOGD("%s:%d]\n", __func__, __LINE__); -#ifndef DEBUG_DMN_LOC_API - if (NULL == loc_api_handle) { - LOC_LOGE("%s:%d] NO agps data handle\n", __func__, __LINE__); - return 1; - } - - if (NULL != loc_api_handle) { - AGpsExtType type; - switch (pmsg->cmsg.cmsg_if_request.type) { - case IF_REQUEST_TYPE_SUPL: - { - LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = AGPS_TYPE_SUPL; - break; - } - case IF_REQUEST_TYPE_WIFI: - { - LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = AGPS_TYPE_WIFI; - break; - } - case IF_REQUEST_TYPE_ANY: - { - LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = AGPS_TYPE_ANY; - break; - } - default: - { - LOC_LOGD("invalid IF_REQUEST_TYPE!"); - return -1; - } - } - switch (pmsg->cmsg.cmsg_if_request.sender_id) { - case IF_REQUEST_SENDER_ID_QUIPC: - { - LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC"); - LocEngReqRelWifi* msg = - new LocEngReqRelWifi(loc_api_handle, - type, - LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC, - (char*)pmsg->cmsg.cmsg_if_request.ssid, - (char*)pmsg->cmsg.cmsg_if_request.password, - true); - msg->send(); - break; - } - case IF_REQUEST_SENDER_ID_MSAPM: - { - LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM"); - LocEngReqRelWifi* msg = - new LocEngReqRelWifi(loc_api_handle, - type, - LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM, - (char*)pmsg->cmsg.cmsg_if_request.ssid, - (char*)pmsg->cmsg.cmsg_if_request.password, - true); - msg->send(); - break; - } - case IF_REQUEST_SENDER_ID_MSAPU: - { - LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU"); - LocEngReqRelWifi* msg = - new LocEngReqRelWifi(loc_api_handle, - type, - LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU, - (char*)pmsg->cmsg.cmsg_if_request.ssid, - (char*)pmsg->cmsg.cmsg_if_request.password, - true); - msg->send(); - break; - } - case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: - { - LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); - LocEngReqRelBIT* msg = - new LocEngReqRelBIT(loc_api_handle, - type, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr, - true); - msg->send(); - break; - } - default: - { - LOC_LOGD("invalid IF_REQUEST_SENDER_ID!"); - return -1; - } - } - } - -#else - loc_eng_dmn_conn_loc_api_server_data_conn(LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, GPSONE_LOC_API_IF_REQUEST_SUCCESS); -#endif - return 0; -} - -int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, int len) -{ - LOC_LOGD("%s:%d]\n", __func__, __LINE__); -#ifndef DEBUG_DMN_LOC_API - AGpsExtType type; - switch (pmsg->cmsg.cmsg_if_request.type) { - case IF_REQUEST_TYPE_SUPL: - { - LOC_LOGD("IF_REQUEST_TYPE_SUPL"); - type = AGPS_TYPE_SUPL; - break; - } - case IF_REQUEST_TYPE_WIFI: - { - LOC_LOGD("IF_REQUEST_TYPE_WIFI"); - type = AGPS_TYPE_WIFI; - break; - } - case IF_REQUEST_TYPE_ANY: - { - LOC_LOGD("IF_REQUEST_TYPE_ANY"); - type = AGPS_TYPE_ANY; - break; - } - default: - { - LOC_LOGD("invalid IF_REQUEST_TYPE!"); - return -1; - } - } - switch (pmsg->cmsg.cmsg_if_request.sender_id) { - case IF_REQUEST_SENDER_ID_QUIPC: - { - LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC"); - LocEngReqRelWifi* msg = - new LocEngReqRelWifi(loc_api_handle, - type, - LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC, - (char*)pmsg->cmsg.cmsg_if_request.ssid, - (char*)pmsg->cmsg.cmsg_if_request.password, - false); - msg->send(); - break; - } - case IF_REQUEST_SENDER_ID_MSAPM: - { - LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM"); - LocEngReqRelWifi* msg = - new LocEngReqRelWifi(loc_api_handle, - type, - LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM, - (char*)pmsg->cmsg.cmsg_if_request.ssid, - (char*)pmsg->cmsg.cmsg_if_request.password, - false); - msg->send(); - break; - } - case IF_REQUEST_SENDER_ID_MSAPU: - { - LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU"); - LocEngReqRelWifi* msg = - new LocEngReqRelWifi(loc_api_handle, - type, - LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU, - (char*)pmsg->cmsg.cmsg_if_request.ssid, - (char*)pmsg->cmsg.cmsg_if_request.password, - false); - msg->send(); - break; - } - case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: - { - LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); - LocEngReqRelBIT* msg = - new LocEngReqRelBIT(loc_api_handle, - type, - pmsg->cmsg.cmsg_if_request.ipv4_addr, - (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr, - false); - msg->send(); - break; - } - default: - { - LOC_LOGD("invalid IF_REQUEST_SENDER_ID!"); - return -1; - } - } -#else - loc_eng_dmn_conn_loc_api_server_data_conn(LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, GPSONE_LOC_API_IF_RELEASE_SUCCESS); -#endif - return 0; -} - diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h deleted file mode 100644 index 1c0edd5..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h +++ /dev/null @@ -1,106 +0,0 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_ENG_DATA_SERVER_HANDLER -#define LOC_ENG_DATA_SERVER_HANDLER - -#include -#include - -//for SSID_BUF_SIZE -#include - -#ifndef SSID_BUF_SIZE - #define SSID_BUF_SIZE (32+1) -#endif - -enum { - /* 0x0 - 0xEF is reserved for daemon internal */ - GPSONE_LOC_API_IF_REQUEST = 0xF0, - GPSONE_LOC_API_IF_RELEASE, - GPSONE_LOC_API_RESPONSE, - GPSONE_UNBLOCK, -}; - -enum { - GPSONE_LOC_API_IF_REQUEST_SUCCESS = 0xF0, - GPSONE_LOC_API_IF_RELEASE_SUCCESS, - GPSONE_LOC_API_IF_FAILURE, -}; - - -struct ctrl_msg_response { - int result; -}; - -struct ctrl_msg_unblock { - int reserved; -}; - -typedef enum { - IF_REQUEST_TYPE_SUPL = 0, - IF_REQUEST_TYPE_WIFI, - IF_REQUEST_TYPE_ANY -} ctrl_if_req_type_e_type; - -typedef enum { - IF_REQUEST_SENDER_ID_QUIPC = 0, - IF_REQUEST_SENDER_ID_MSAPM, - IF_REQUEST_SENDER_ID_MSAPU, - IF_REQUEST_SENDER_ID_GPSONE_DAEMON, - IF_REQUEST_SENDER_ID_MODEM -} ctrl_if_req_sender_id_e_type; - -struct ctrl_msg_if_request { - ctrl_if_req_type_e_type type; - ctrl_if_req_sender_id_e_type sender_id; - unsigned long ipv4_addr; - unsigned char ipv6_addr[16]; - char ssid[SSID_BUF_SIZE]; - char password[SSID_BUF_SIZE]; -}; - -/* do not change this structure */ -struct ctrl_msgbuf { - size_t msgsz; - uint16_t reserved1; - uint32_t reserved2; - uint8_t ctrl_type; - union { - struct ctrl_msg_response cmsg_response; - struct ctrl_msg_unblock cmsg_unblock; - struct ctrl_msg_if_request cmsg_if_request; - } cmsg; -}; - -extern void* loc_api_handle; - -int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, int len); -int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, int len); - -#endif /* LOC_ENG_DATA_SERVER_HANDLER */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c deleted file mode 100644 index b30f6d7..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c +++ /dev/null @@ -1,398 +0,0 @@ -/* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include - -#include -#include "loc_eng_dmn_conn_thread_helper.h" - -/*=========================================================================== -FUNCTION thelper_signal_init - -DESCRIPTION - This function will initialize the conditional variable resources. - - thelper - thelper instance - -DEPENDENCIES - None - -RETURN VALUE - 0: success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper) -{ - int result; - thelper->thread_exit = 0; - thelper->thread_ready = 0; - result = pthread_cond_init( &thelper->thread_cond, NULL); - if (result) { - return result; - } - - result = pthread_mutex_init(&thelper->thread_mutex, NULL); - if (result) { - pthread_cond_destroy(&thelper->thread_cond); - } - return result; -} - -/*=========================================================================== -FUNCTION - -DESCRIPTION - This function will destroy the conditional variable resources - - thelper - pointer to thelper instance - -DEPENDENCIES - None - -RETURN VALUE - 0: success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper) -{ - int result, ret_result = 0; - result = pthread_cond_destroy( &thelper->thread_cond); - if (result) { - ret_result = result; - } - - result = pthread_mutex_destroy(&thelper->thread_mutex); - if (result) { - ret_result = result; - } - - return ret_result; -} - -/*=========================================================================== -FUNCTION thelper_signal_wait - -DESCRIPTION - This function will be blocked on the conditional variable until thelper_signal_ready - is called - - thelper - pointer to thelper instance - -DEPENDENCIES - None - -RETURN VALUE - 0: success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper) -{ - int result = 0; - - pthread_mutex_lock(&thelper->thread_mutex); - if (!thelper->thread_ready && !thelper->thread_exit) { - result = pthread_cond_wait(&thelper->thread_cond, &thelper->thread_mutex); - } - - if (thelper->thread_exit) { - result = -1; - } - pthread_mutex_unlock(&thelper->thread_mutex); - - return result; -} - -/*=========================================================================== -FUNCTION thelper_signal_ready - -DESCRIPTION - This function will wake up the conditional variable - - thelper - pointer to thelper instance - -DEPENDENCIES - None - -RETURN VALUE - 0: success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper) -{ - int result; - - LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); - - pthread_mutex_lock(&thelper->thread_mutex); - thelper->thread_ready = 1; - result = pthread_cond_signal(&thelper->thread_cond); - pthread_mutex_unlock(&thelper->thread_mutex); - - return result; -} - -/*=========================================================================== -FUNCTION thelper_signal_block - -DESCRIPTION - This function will set the thread ready to 0 to block the thelper_signal_wait - - thelper - pointer to thelper instance - -DEPENDENCIES - None - -RETURN VALUE - if thread_ready is set - -SIDE EFFECTS - N/A - -===========================================================================*/ -int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper) -{ - int result = thelper->thread_ready; - - LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); - - pthread_mutex_lock(&thelper->thread_mutex); - thelper->thread_ready = 0; - pthread_mutex_unlock(&thelper->thread_mutex); - - return result; -} - -/*=========================================================================== -FUNCTION thelper_main - -DESCRIPTION - This function is the main thread. It will be launched as a child thread - - data - pointer to the instance - -DEPENDENCIES - None - -RETURN VALUE - NULL - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void * thelper_main(void *data) -{ - int result = 0; - struct loc_eng_dmn_conn_thelper * thelper = (struct loc_eng_dmn_conn_thelper *) data; - - if (thelper->thread_proc_init) { - result = thelper->thread_proc_init(thelper->thread_context); - if (result < 0) { - thelper->thread_exit = 1; - thelper_signal_ready(thelper); - LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper); - return NULL; - } - } - - thelper_signal_ready(thelper); - - if (thelper->thread_proc_pre) { - result = thelper->thread_proc_pre(thelper->thread_context); - if (result < 0) { - thelper->thread_exit = 1; - LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper); - return NULL; - } - } - - do { - if (thelper->thread_proc) { - result = thelper->thread_proc(thelper->thread_context); - if (result < 0) { - thelper->thread_exit = 1; - LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper); - } - } - } while (thelper->thread_exit == 0); - - if (thelper->thread_proc_post) { - result = thelper->thread_proc_post(thelper->thread_context); - } - - if (result != 0) { - LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper); - } - return NULL; -} - -static void thelper_main_2(void *data) -{ - thelper_main(data); - return; -} - - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_launch_thelper - -DESCRIPTION - This function will initialize the thread context and launch the thelper_main - - thelper - pointer to thelper instance - thread_proc_init - The initialization function pointer - thread_proc_pre - The function to call before task loop and after initialization - thread_proc - The task loop - thread_proc_post - The function to call after the task loop - context - the context for the above four functions - -DEPENDENCIES - None - -RETURN VALUE - 0: success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper, - int (*thread_proc_init) (void * context), - int (*thread_proc_pre) (void * context), - int (*thread_proc) (void * context), - int (*thread_proc_post) (void * context), - thelper_create_thread create_thread_cb, - void * context) -{ - int result; - - thelper_signal_init(thelper); - - if (context) { - thelper->thread_context = context; - } - - thelper->thread_proc_init = thread_proc_init; - thelper->thread_proc_pre = thread_proc_pre; - thelper->thread_proc = thread_proc; - thelper->thread_proc_post = thread_proc_post; - - LOC_LOGD("%s:%d] 0x%lx call pthread_create\n", __func__, __LINE__, (long) thelper); - if (create_thread_cb) { - result = 0; - thelper->thread_id = create_thread_cb("loc_eng_dmn_conn", - thelper_main_2, (void *)thelper); - } else { - result = pthread_create(&thelper->thread_id, NULL, - thelper_main, (void *)thelper); - } - - if (result != 0) { - LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); - return -1; - } - - LOC_LOGD("%s:%d] 0x%lx pthread_create done\n", __func__, __LINE__, (long) thelper); - - thelper_signal_wait(thelper); - - LOC_LOGD("%s:%d] 0x%lx pthread ready\n", __func__, __LINE__, (long) thelper); - return thelper->thread_exit; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_unblock_thelper - -DESCRIPTION - This function unblocks thelper_main to release the thread - - thelper - pointer to thelper instance - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper) -{ - LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); - thelper->thread_exit = 1; - return 0; -} - -/*=========================================================================== -FUNCTION loc_eng_dmn_conn_join_thelper - - thelper - pointer to thelper instance - -DESCRIPTION - This function will wait for the thread of thelper_main to finish - -DEPENDENCIES - None - -RETURN VALUE - 0: success or negative value for failure - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper) -{ - int result; - - LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); - result = pthread_join(thelper->thread_id, NULL); - if (result != 0) { - LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); - } - LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); - - thelper_signal_destroy(thelper); - - return result; -} - diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h deleted file mode 100644 index 89e598b..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ -#define __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -struct loc_eng_dmn_conn_thelper { - unsigned char thread_exit; - unsigned char thread_ready; - pthread_cond_t thread_cond; - pthread_mutex_t thread_mutex; - pthread_t thread_id; - void * thread_context; - int (*thread_proc_init) (void * context); - int (*thread_proc_pre) (void * context); - int (*thread_proc) (void * context); - int (*thread_proc_post) (void * context); -}; - -typedef pthread_t (* thelper_create_thread)(const char* name, void (*start)(void *), void* arg); -int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper, - int (*thread_proc_init) (void * context), - int (*thread_proc_pre) (void * context), - int (*thread_proc) (void * context), - int (*thread_proc_post) (void * context), - thelper_create_thread create_thread_cb, - void * context); - -int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper); -int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper); - -/* if only need to use signal */ -int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper); -int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper); -int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper); -int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper); -int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_log.cpp b/gps/loc_api/libloc_api_50001/loc_eng_log.cpp deleted file mode 100644 index 3a34167..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_log.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_eng" - -#include "loc_log.h" -#include "loc_eng_log.h" - diff --git a/gps/loc_api/libloc_api_50001/loc_eng_log.h b/gps/loc_api/libloc_api_50001/loc_eng_log.h deleted file mode 100644 index a68bd84..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_log.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_ENG_LOG_H -#define LOC_ENG_LOG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_ENG_LOG_H */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_msg.h b/gps/loc_api/libloc_api_50001/loc_eng_msg.h deleted file mode 100644 index 2fa9b42..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_msg.h +++ /dev/null @@ -1,306 +0,0 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_ENG_MSG_H -#define LOC_ENG_MSG_H - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef SSID_BUF_SIZE - #define SSID_BUF_SIZE (32+1) -#endif -#if defined(USE_GLIB) && !defined(OFF_TARGET) - -#include - -#endif /* USE_GLIB */ -#include "platform_lib_includes.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -using namespace loc_core; - -struct LocEngPositionMode : public LocMsg { - LocEngAdapter* mAdapter; - const LocPosMode mPosMode; - LocEngPositionMode(LocEngAdapter* adapter, LocPosMode &mode); - virtual void proc() const; - virtual void log() const; - void send() const; -}; - - -struct LocEngStartFix : public LocMsg { - LocEngAdapter* mAdapter; - LocEngStartFix(LocEngAdapter* adapter); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngStopFix : public LocMsg { - LocEngAdapter* mAdapter; - LocEngStopFix(LocEngAdapter* adapter); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngReportPosition : public LocMsg { - LocAdapterBase* mAdapter; - const UlpLocation mLocation; - const GpsLocationExtended mLocationExtended; - const void* mLocationExt; - const enum loc_sess_status mStatus; - const LocPosTechMask mTechMask; - LocEngReportPosition(LocAdapterBase* adapter, - UlpLocation &loc, - GpsLocationExtended &locExtended, - void* locExt, - enum loc_sess_status st, - LocPosTechMask technology); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngReportSv : public LocMsg { - LocAdapterBase* mAdapter; - const GnssSvStatus mSvStatus; - const GpsLocationExtended mLocationExtended; - const void* mSvExt; - LocEngReportSv(LocAdapterBase* adapter, - GnssSvStatus &sv, - GpsLocationExtended &locExtended, - void* svExtended); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngReportStatus : public LocMsg { - LocAdapterBase* mAdapter; - const GpsStatusValue mStatus; - LocEngReportStatus(LocAdapterBase* adapter, - GpsStatusValue engineStatus); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngReportNmea : public LocMsg { - void* mLocEng; - char* const mNmea; - const int mLen; - LocEngReportNmea(void* locEng, - const char* data, int len); - inline virtual ~LocEngReportNmea() - { - delete[] mNmea; - } - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngReportXtraServer : public LocMsg { - void* mLocEng; - int mMaxLen; - char *mServers; - LocEngReportXtraServer(void* locEng, - const char *url1, const char *url2, - const char *url3, const int maxlength); - inline virtual ~LocEngReportXtraServer() - { - delete[] mServers; - } - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngSuplEsOpened : public LocMsg { - void* mLocEng; - LocEngSuplEsOpened(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngSuplEsClosed : public LocMsg { - void* mLocEng; - LocEngSuplEsClosed(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngRequestSuplEs : public LocMsg { - void* mLocEng; - const int mID; - LocEngRequestSuplEs(void* locEng, int id); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngRequestATL : public LocMsg { - void* mLocEng; - const int mID; - const AGpsExtType mType; - LocEngRequestATL(void* locEng, int id, - AGpsExtType agps_type); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngReleaseATL : public LocMsg { - void* mLocEng; - const int mID; - LocEngReleaseATL(void* locEng, int id); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngReqRelBIT : public LocMsg { - void* mLocEng; - const AGpsExtType mType; - const int mIPv4Addr; - char* const mIPv6Addr; - const bool mIsReq; - LocEngReqRelBIT(void* instance, AGpsExtType type, - int ipv4, char* ipv6, bool isReq); - virtual ~LocEngReqRelBIT(); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngReqRelWifi : public LocMsg { - void* mLocEng; - const AGpsExtType mType; - const loc_if_req_sender_id_e_type mSenderId; - char* const mSSID; - char* const mPassword; - const bool mIsReq; - LocEngReqRelWifi(void* locEng, AGpsExtType type, - loc_if_req_sender_id_e_type sender_id, - char* s, char* p, bool isReq); - virtual ~LocEngReqRelWifi(); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngRequestXtra : public LocMsg { - void* mLocEng; - LocEngRequestXtra(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngRequestTime : public LocMsg { - void* mLocEng; - LocEngRequestTime(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngRequestNi : public LocMsg { - void* mLocEng; - const GpsNiNotification mNotify; - const void *mPayload; - LocEngRequestNi(void* locEng, - GpsNiNotification ¬if, - const void* data); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngDown : public LocMsg { - void* mLocEng; - LocEngDown(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngUp : public LocMsg { - void* mLocEng; - LocEngUp(void* locEng); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -struct LocEngGetZpp : public LocMsg { - LocEngAdapter* mAdapter; - LocEngGetZpp(LocEngAdapter* adapter); - virtual void proc() const; - void locallog() const; - virtual void log() const; - void send() const; -}; - -struct LocEngReportGnssMeasurement : public LocMsg { - void* mLocEng; - const GnssData mGnssData; - LocEngReportGnssMeasurement(void* locEng, - GnssData &gnssData); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* LOC_ENG_MSG_H */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_ni.cpp b/gps/loc_api/libloc_api_50001/loc_eng_ni.cpp deleted file mode 100644 index 9b454c6..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_ni.cpp +++ /dev/null @@ -1,413 +0,0 @@ -/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_eng" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -using namespace loc_core; - -/*============================================================================= - * - * DATA DECLARATION - * - *============================================================================*/ - -/*============================================================================= - * - * FUNCTION DECLARATIONS - * - *============================================================================*/ -static void* ni_thread_proc(void *args); - -struct LocEngInformNiResponse : public LocMsg { - LocEngAdapter* mAdapter; - const GpsUserResponseType mResponse; - const void *mPayload; - inline LocEngInformNiResponse(LocEngAdapter* adapter, - GpsUserResponseType resp, - const void* data) : - LocMsg(), mAdapter(adapter), - mResponse(resp), mPayload(data) - { - locallog(); - } - inline ~LocEngInformNiResponse() - { - // this is a bit weird since mPayload is not - // allocated by this class. But there is no better way. - // mPayload actually won't be NULL here. - free((void*)mPayload); - } - inline virtual void proc() const - { - mAdapter->informNiResponse(mResponse, mPayload); - } - inline void locallog() const - { - LOC_LOGV("LocEngInformNiResponse - " - "response: %s\n mPayload: %p", - loc_get_ni_response_name(mResponse), - mPayload); - } - inline virtual void log() const - { - locallog(); - } -}; - -/*=========================================================================== - -FUNCTION loc_eng_ni_request_handler - -DESCRIPTION - Displays the NI request and awaits user input. If a previous request is - in session, it is ignored. - -RETURN VALUE - none - -===========================================================================*/ -void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, - const GpsNiNotification *notif, - const void* passThrough) -{ - ENTRY_LOG(); - char lcs_addr[32]; // Decoded LCS address for UMTS CP NI - loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; - loc_eng_ni_session_s_type* pSession = NULL; - - if (NULL == loc_eng_data.ni_notify_cb) { - EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); - return; - } - - if (notif->ni_type == GPS_NI_TYPE_EMERGENCY_SUPL) { - if (NULL != loc_eng_ni_data_p->sessionEs.rawRequest) { - LOC_LOGW("loc_eng_ni_request_handler, supl es NI in progress, new supl es NI ignored, type: %d", - notif->ni_type); - if (NULL != passThrough) { - free((void*)passThrough); - } - } else { - pSession = &loc_eng_ni_data_p->sessionEs; - } - } else { - if (NULL != loc_eng_ni_data_p->session.rawRequest || - NULL != loc_eng_ni_data_p->sessionEs.rawRequest) { - LOC_LOGW("loc_eng_ni_request_handler, supl NI in progress, new supl NI ignored, type: %d", - notif->ni_type); - if (NULL != passThrough) { - free((void*)passThrough); - } - } else { - pSession = &loc_eng_ni_data_p->session; - } - } - - - if (pSession) { - /* Save request */ - pSession->rawRequest = (void*)passThrough; - pSession->reqID = ++loc_eng_ni_data_p->reqIDCounter; - pSession->adapter = loc_eng_data.adapter; - - /* Fill in notification */ - ((GpsNiNotification*)notif)->notification_id = pSession->reqID; - - if (notif->notify_flags == GPS_NI_PRIVACY_OVERRIDE) - { - loc_eng_mute_one_session(loc_eng_data); - } - - /* Log requestor ID and text for debugging */ - LOC_LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif->ni_type, notif->timeout, notif->default_response); - LOC_LOGI(" requestor_id: %s (encoding: %d)", notif->requestor_id, notif->requestor_id_encoding); - LOC_LOGI(" text: %s text (encoding: %d)", notif->text, notif->text_encoding); - if (notif->extras[0]) - { - LOC_LOGI(" extras: %s", notif->extras); - } - - /* For robustness, spawn a thread at this point to timeout to clear up the notification status, even though - * the OEM layer in java does not do so. - **/ - pSession->respTimeLeft = 5 + (notif->timeout != 0 ? notif->timeout : LOC_NI_NO_RESPONSE_TIME); - LOC_LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", pSession->respTimeLeft); - - int rc = 0; - rc = pthread_create(&pSession->thread, NULL, ni_thread_proc, pSession); - if (rc) - { - LOC_LOGE("Loc NI thread is not created.\n"); - } - rc = pthread_detach(pSession->thread); - if (rc) - { - LOC_LOGE("Loc NI thread is not detached.\n"); - } - - CALLBACK_LOG_CALLFLOW("ni_notify_cb - id", %d, notif->notification_id); - loc_eng_data.ni_notify_cb((GpsNiNotification*)notif, gps_conf.SUPL_ES != 0); - } - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== - -FUNCTION ni_thread_proc - -===========================================================================*/ -static void* ni_thread_proc(void *args) -{ - ENTRY_LOG(); - - loc_eng_ni_session_s_type* pSession = (loc_eng_ni_session_s_type*)args; - int rc = 0; /* return code from pthread calls */ - - struct timeval present_time; - struct timespec expire_time; - - LOC_LOGD("Starting Loc NI thread...\n"); - pthread_mutex_lock(&pSession->tLock); - /* Calculate absolute expire time */ - gettimeofday(&present_time, NULL); - expire_time.tv_sec = present_time.tv_sec + pSession->respTimeLeft; - expire_time.tv_nsec = present_time.tv_usec * 1000; - LOC_LOGD("ni_thread_proc-Time out set for abs time %ld with delay %d sec\n", - (long) expire_time.tv_sec, pSession->respTimeLeft ); - - while (!pSession->respRecvd) - { - rc = pthread_cond_timedwait(&pSession->tCond, - &pSession->tLock, - &expire_time); - if (rc == ETIMEDOUT) - { - pSession->resp = GPS_NI_RESPONSE_NORESP; - LOC_LOGD("ni_thread_proc-Thread time out after valting for specified time. Ret Val %d\n",rc ); - break; - } - } - LOC_LOGD("ni_thread_proc-Java layer has sent us a user response and return value from " - "pthread_cond_timedwait = %d\n",rc ); - pSession->respRecvd = FALSE; /* Reset the user response flag for the next session*/ - - LOC_LOGD("pSession->resp is %d\n",pSession->resp); - - // adding this check to support modem restart, in which case, we need the thread - // to exit without calling sending data. We made sure that rawRequest is NULL in - // loc_eng_ni_reset_on_engine_restart() - LocEngAdapter* adapter = pSession->adapter; - LocEngInformNiResponse *msg = NULL; - - if (NULL != pSession->rawRequest) { - if (pSession->resp != GPS_NI_RESPONSE_IGNORE) { - LOC_LOGD("pSession->resp != GPS_NI_RESPONSE_IGNORE \n"); - msg = new LocEngInformNiResponse(adapter, - pSession->resp, - pSession->rawRequest); - } else { - LOC_LOGD("this is the ignore reply for SUPL ES\n"); - free(pSession->rawRequest); - } - pSession->rawRequest = NULL; - } - pthread_mutex_unlock(&pSession->tLock); - - pSession->respTimeLeft = 0; - pSession->reqID = 0; - - if (NULL != msg) { - LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n"); - adapter->sendMsg(msg); - } - - EXIT_LOG(%s, VOID_RET); - return NULL; -} - -void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; - - if (NULL == loc_eng_data.ni_notify_cb) { - EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); - return; - } - - // only if modem has requested but then died. - if (NULL != loc_eng_ni_data_p->sessionEs.rawRequest) { - free(loc_eng_ni_data_p->sessionEs.rawRequest); - loc_eng_ni_data_p->sessionEs.rawRequest = NULL; - - pthread_mutex_lock(&loc_eng_ni_data_p->sessionEs.tLock); - // the goal is to wake up ni_thread_proc - // and let it exit. - loc_eng_ni_data_p->sessionEs.respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->sessionEs.tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->sessionEs.tLock); - } - - if (NULL != loc_eng_ni_data_p->session.rawRequest) { - free(loc_eng_ni_data_p->session.rawRequest); - loc_eng_ni_data_p->session.rawRequest = NULL; - - pthread_mutex_lock(&loc_eng_ni_data_p->session.tLock); - // the goal is to wake up ni_thread_proc - // and let it exit. - loc_eng_ni_data_p->session.respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->session.tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->session.tLock); - } - - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== -FUNCTION loc_eng_ni_init - -DESCRIPTION - This function initializes the NI interface - -DEPENDENCIES - NONE - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callbacks) -{ - ENTRY_LOG_CALLFLOW(); - - if(callbacks == NULL) - EXIT_LOG(%s, "loc_eng_ni_init: failed, cb is NULL"); - else if (NULL == callbacks->notify_cb) { - EXIT_LOG(%s, "loc_eng_ni_init: failed, no cb."); - } else if (NULL != loc_eng_data.ni_notify_cb) { - EXIT_LOG(%s, "loc_eng_ni_init: already inited."); - } else { - loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; - loc_eng_ni_data_p->sessionEs.respTimeLeft = 0; - loc_eng_ni_data_p->sessionEs.respRecvd = FALSE; - loc_eng_ni_data_p->sessionEs.rawRequest = NULL; - loc_eng_ni_data_p->sessionEs.reqID = 0; - pthread_cond_init(&loc_eng_ni_data_p->sessionEs.tCond, NULL); - pthread_mutex_init(&loc_eng_ni_data_p->sessionEs.tLock, NULL); - - loc_eng_ni_data_p->session.respTimeLeft = 0; - loc_eng_ni_data_p->session.respRecvd = FALSE; - loc_eng_ni_data_p->session.rawRequest = NULL; - loc_eng_ni_data_p->session.reqID = 0; - pthread_cond_init(&loc_eng_ni_data_p->session.tCond, NULL); - pthread_mutex_init(&loc_eng_ni_data_p->session.tLock, NULL); - - loc_eng_data.ni_notify_cb = callbacks->notify_cb; - EXIT_LOG(%s, VOID_RET); - } -} - -/*=========================================================================== -FUNCTION loc_eng_ni_respond - -DESCRIPTION - This function receives user response from upper layer framework - -DEPENDENCIES - NONE - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, - int notif_id, GpsUserResponseType user_response) -{ - ENTRY_LOG_CALLFLOW(); - loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; - loc_eng_ni_session_s_type* pSession = NULL; - - if (NULL == loc_eng_data.ni_notify_cb) { - EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); - return; - } - - if (notif_id == loc_eng_ni_data_p->sessionEs.reqID && - NULL != loc_eng_ni_data_p->sessionEs.rawRequest) { - pSession = &loc_eng_ni_data_p->sessionEs; - // ignore any SUPL NI non-Es session if a SUPL NI ES is accepted - if (user_response == GPS_NI_RESPONSE_ACCEPT && - NULL != loc_eng_ni_data_p->session.rawRequest) { - pthread_mutex_lock(&loc_eng_ni_data_p->session.tLock); - loc_eng_ni_data_p->session.resp = GPS_NI_RESPONSE_IGNORE; - loc_eng_ni_data_p->session.respRecvd = TRUE; - pthread_cond_signal(&loc_eng_ni_data_p->session.tCond); - pthread_mutex_unlock(&loc_eng_ni_data_p->session.tLock); - } - } else if (notif_id == loc_eng_ni_data_p->session.reqID && - NULL != loc_eng_ni_data_p->session.rawRequest) { - pSession = &loc_eng_ni_data_p->session; - } - - if (pSession) { - LOC_LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); - pthread_mutex_lock(&pSession->tLock); - pSession->resp = user_response; - pSession->respRecvd = TRUE; - pthread_cond_signal(&pSession->tCond); - pthread_mutex_unlock(&pSession->tLock); - } - else { - LOC_LOGE("loc_eng_ni_respond: notif_id %d not an active session", notif_id); - } - - EXIT_LOG(%s, VOID_RET); -} diff --git a/gps/loc_api/libloc_api_50001/loc_eng_ni.h b/gps/loc_api/libloc_api_50001/loc_eng_ni.h deleted file mode 100644 index 068f5cd..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_ni.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2009,2011,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_ENG_NI_H -#define LOC_ENG_NI_H - -#include -#include - -#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ -#define LOC_NI_NOTIF_KEY_ADDRESS "Address" -#define GPS_NI_RESPONSE_IGNORE 4 - -typedef struct { - pthread_t thread; /* NI thread */ - int respTimeLeft; /* examine time for NI response */ - bool respRecvd; /* NI User reponse received or not from Java layer*/ - void* rawRequest; - int reqID; /* ID to check against response */ - GpsUserResponseType resp; - pthread_cond_t tCond; - pthread_mutex_t tLock; - LocEngAdapter* adapter; -} loc_eng_ni_session_s_type; - -typedef struct { - loc_eng_ni_session_s_type session; /* SUPL NI Session */ - loc_eng_ni_session_s_type sessionEs; /* Emergency SUPL NI Session */ - int reqIDCounter; -} loc_eng_ni_data_s_type; - - -#endif /* LOC_ENG_NI_H */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp deleted file mode 100644 index 3d2336f..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ /dev/null @@ -1,924 +0,0 @@ -/* Copyright (c) 2012, 2016, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_eng_nmea" -#include -#include -#include -#include - -/*=========================================================================== -FUNCTION loc_eng_nmea_send - -DESCRIPTION - send out NMEA sentence - -DEPENDENCIES - NONE - -RETURN VALUE - Total length of the nmea sentence - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p) -{ - struct timeval tv; - gettimeofday(&tv, (struct timezone *) NULL); - int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; - if (loc_eng_data_p->nmea_cb != NULL) - loc_eng_data_p->nmea_cb(now, pNmea, length); - LOC_LOGD("NMEA <%s", pNmea); -} - -/*=========================================================================== -FUNCTION loc_eng_nmea_put_checksum - -DESCRIPTION - Generate NMEA sentences generated based on position report - -DEPENDENCIES - NONE - -RETURN VALUE - Total length of the nmea sentence - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_nmea_put_checksum(char *pNmea, int maxSize) -{ - uint8_t checksum = 0; - int length = 0; - - pNmea++; //skip the $ - while (*pNmea != '\0') - { - checksum ^= *pNmea++; - length++; - } - - // length now contains nmea sentence string length not including $ sign. - int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum); - - // total length of nmea sentence is length of nmea sentence inc $ sign plus - // length of checksum (+1 is to cover the $ character in the length). - return (length + checksumLength + 1); -} - -/*=========================================================================== -FUNCTION loc_eng_nmea_generate_pos - -DESCRIPTION - Generate NMEA sentences generated based on position report - Currently below sentences are generated within this function: - - $GPGSA : GPS DOP and active SVs - - $GNGSA : GLONASS DOP and active SVs - - $GPVTG : Track made good and ground speed - - $GPRMC : Recommended minimum navigation information - - $GPGGA : Time, position and fix related data - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, - const UlpLocation &location, - const GpsLocationExtended &locationExtended, - unsigned char generate_nmea) -{ - ENTRY_LOG(); - time_t utcTime(location.gpsLocation.timestamp/1000); - tm * pTm = gmtime(&utcTime); - if (NULL == pTm) { - LOC_LOGE("gmtime failed"); - return; - } - - char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; - char* pMarker = sentence; - int lengthRemaining = sizeof(sentence); - int length = 0; - int utcYear = pTm->tm_year % 100; // 2 digit year - int utcMonth = pTm->tm_mon + 1; // tm_mon starts at zero - int utcDay = pTm->tm_mday; - int utcHours = pTm->tm_hour; - int utcMinutes = pTm->tm_min; - int utcSeconds = pTm->tm_sec; - int utcMSeconds = (location.gpsLocation.timestamp)%1000; - - if (generate_nmea) { - // ------------------ - // ------$GPGSA------ - // ------------------ - - uint32_t svUsedCount = 0; - uint32_t svUsedList[32] = {0}; - uint32_t mask = loc_eng_data_p->gps_used_mask; - for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) - { - if (mask & 1) - svUsedList[svUsedCount++] = i; - mask = mask >> 1; - } - // clear the cache so they can't be used again - loc_eng_data_p->gps_used_mask = 0; - - char fixType; - if (svUsedCount == 0) - fixType = '1'; // no fix - else if (svUsedCount <= 3) - fixType = '2'; // 2D fix - else - fixType = '3'; // 3D fix - - length = snprintf(pMarker, lengthRemaining, "$GPGSA,A,%c,", fixType); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - for (uint8_t i = 0; i < 12; i++) // only the first 12 sv go in sentence - { - if (i < svUsedCount) - length = snprintf(pMarker, lengthRemaining, "%02d,", svUsedList[i]); - else - length = snprintf(pMarker, lengthRemaining, ","); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - } - - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) - { // dop is in locationExtended, (QMI) - length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", - locationExtended.pdop, - locationExtended.hdop, - locationExtended.vdop); - } - else if (loc_eng_data_p->pdop > 0 && loc_eng_data_p->hdop > 0 && loc_eng_data_p->vdop > 0) - { // dop was cached from sv report (RPC) - length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", - loc_eng_data_p->pdop, - loc_eng_data_p->hdop, - loc_eng_data_p->vdop); - } - else - { // no dop - length = snprintf(pMarker, lengthRemaining, ",,"); - } - - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - // ------------------ - // ------$GNGSA------ - // ------------------ - uint32_t gloUsedCount = 0; - uint32_t gloUsedList[32] = {0}; - - // Reset locals for GNGSA sentence generation - pMarker = sentence; - lengthRemaining = sizeof(sentence); - mask = loc_eng_data_p->glo_used_mask; - fixType = '\0'; - - // Parse the glonass sv mask, and fetch glo sv ids - // Mask corresponds to the offset. - // GLONASS SV ids are from 65-96 - const int GLONASS_SV_ID_OFFSET = 64; - for (uint8_t i = 1; mask > 0 && gloUsedCount < 32; i++) - { - if (mask & 1) - gloUsedList[gloUsedCount++] = i + GLONASS_SV_ID_OFFSET; - mask = mask >> 1; - } - // clear the cache so they can't be used again - loc_eng_data_p->glo_used_mask = 0; - - if (gloUsedCount == 0) - fixType = '1'; // no fix - else if (gloUsedCount <= 3) - fixType = '2'; // 2D fix - else - fixType = '3'; // 3D fix - - // Start printing the sentence - // Format: $--GSA,a,x,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,p.p,h.h,v.v*cc - // GNGSA : for glonass SVs - // a : Mode : A : Automatic, allowed to automatically switch 2D/3D - // x : Fixtype : 1 (no fix), 2 (2D fix), 3 (3D fix) - // xx : 12 SV ID - // p.p : Position DOP (Dilution of Precision) - // h.h : Horizontal DOP - // v.v : Vertical DOP - // cc : Checksum value - length = snprintf(pMarker, lengthRemaining, "$GNGSA,A,%c,", fixType); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - // Add first 12 GLONASS satellite IDs - for (uint8_t i = 0; i < 12; i++) - { - if (i < gloUsedCount) - length = snprintf(pMarker, lengthRemaining, "%02d,", gloUsedList[i]); - else - length = snprintf(pMarker, lengthRemaining, ","); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - } - - // Add the position/horizontal/vertical DOP values - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) - { // dop is in locationExtended, (QMI) - length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", - locationExtended.pdop, - locationExtended.hdop, - locationExtended.vdop); - } - else if (loc_eng_data_p->pdop > 0 && loc_eng_data_p->hdop > 0 && loc_eng_data_p->vdop > 0) - { // dop was cached from sv report (RPC) - length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", - loc_eng_data_p->pdop, - loc_eng_data_p->hdop, - loc_eng_data_p->vdop); - } - else - { // no dop - length = snprintf(pMarker, lengthRemaining, ",,"); - } - - /* Sentence is ready, add checksum and broadcast */ - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - // ------------------ - // ------$GPVTG------ - // ------------------ - - pMarker = sentence; - lengthRemaining = sizeof(sentence); - - if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING) - { - float magTrack = location.gpsLocation.bearing; - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) - { - float magTrack = location.gpsLocation.bearing - locationExtended.magneticDeviation; - if (magTrack < 0.0) - magTrack += 360.0; - else if (magTrack > 360.0) - magTrack -= 360.0; - } - - length = snprintf(pMarker, lengthRemaining, "$GPVTG,%.1lf,T,%.1lf,M,", location.gpsLocation.bearing, magTrack); - } - else - { - length = snprintf(pMarker, lengthRemaining, "$GPVTG,,T,,M,"); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED) - { - float speedKnots = location.gpsLocation.speed * (3600.0/1852.0); - float speedKmPerHour = location.gpsLocation.speed * 3.6; - - length = snprintf(pMarker, lengthRemaining, "%.1lf,N,%.1lf,K,", speedKnots, speedKmPerHour); - } - else - { - length = snprintf(pMarker, lengthRemaining, ",N,,K,"); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) - length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix - else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode) - length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous - else - length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential - - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - // ------------------ - // ------$GPRMC------ - // ------------------ - - pMarker = sentence; - lengthRemaining = sizeof(sentence); - - length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d.%02d,A," , - utcHours, utcMinutes, utcSeconds,utcMSeconds/10); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG) - { - double latitude = location.gpsLocation.latitude; - double longitude = location.gpsLocation.longitude; - char latHemisphere; - char lonHemisphere; - double latMinutes; - double lonMinutes; - - if (latitude > 0) - { - latHemisphere = 'N'; - } - else - { - latHemisphere = 'S'; - latitude *= -1.0; - } - - if (longitude < 0) - { - lonHemisphere = 'W'; - longitude *= -1.0; - } - else - { - lonHemisphere = 'E'; - } - - latMinutes = fmod(latitude * 60.0 , 60.0); - lonMinutes = fmod(longitude * 60.0 , 60.0); - - length = snprintf(pMarker, lengthRemaining, "%02d%09.6lf,%c,%03d%09.6lf,%c,", - (uint8_t)floor(latitude), latMinutes, latHemisphere, - (uint8_t)floor(longitude),lonMinutes, lonHemisphere); - } - else - { - length = snprintf(pMarker, lengthRemaining,",,,,"); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED) - { - float speedKnots = location.gpsLocation.speed * (3600.0/1852.0); - length = snprintf(pMarker, lengthRemaining, "%.1lf,", speedKnots); - } - else - { - length = snprintf(pMarker, lengthRemaining, ","); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING) - { - length = snprintf(pMarker, lengthRemaining, "%.1lf,", location.gpsLocation.bearing); - } - else - { - length = snprintf(pMarker, lengthRemaining, ","); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - length = snprintf(pMarker, lengthRemaining, "%2.2d%2.2d%2.2d,", - utcDay, utcMonth, utcYear); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) - { - float magneticVariation = locationExtended.magneticDeviation; - char direction; - if (magneticVariation < 0.0) - { - direction = 'W'; - magneticVariation *= -1.0; - } - else - { - direction = 'E'; - } - - length = snprintf(pMarker, lengthRemaining, "%.1lf,%c,", - magneticVariation, direction); - } - else - { - length = snprintf(pMarker, lengthRemaining, ",,"); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) - length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix - else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode) - length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous - else - length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential - - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - // ------------------ - // ------$GPGGA------ - // ------------------ - - pMarker = sentence; - lengthRemaining = sizeof(sentence); - - length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d.%02d," , - utcHours, utcMinutes, utcSeconds, utcMSeconds/10); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG) - { - double latitude = location.gpsLocation.latitude; - double longitude = location.gpsLocation.longitude; - char latHemisphere; - char lonHemisphere; - double latMinutes; - double lonMinutes; - - if (latitude > 0) - { - latHemisphere = 'N'; - } - else - { - latHemisphere = 'S'; - latitude *= -1.0; - } - - if (longitude < 0) - { - lonHemisphere = 'W'; - longitude *= -1.0; - } - else - { - lonHemisphere = 'E'; - } - - latMinutes = fmod(latitude * 60.0 , 60.0); - lonMinutes = fmod(longitude * 60.0 , 60.0); - - length = snprintf(pMarker, lengthRemaining, "%02d%09.6lf,%c,%03d%09.6lf,%c,", - (uint8_t)floor(latitude), latMinutes, latHemisphere, - (uint8_t)floor(longitude),lonMinutes, lonHemisphere); - } - else - { - length = snprintf(pMarker, lengthRemaining,",,,,"); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - char gpsQuality; - if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) - gpsQuality = '0'; // 0 means no fix - else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode) - gpsQuality = '1'; // 1 means GPS fix - else - gpsQuality = '2'; // 2 means DGPS fix - - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) - { // dop is in locationExtended, (QMI) - length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", - gpsQuality, svUsedCount, locationExtended.hdop); - } - else if (loc_eng_data_p->pdop > 0 && loc_eng_data_p->hdop > 0 && loc_eng_data_p->vdop > 0) - { // dop was cached from sv report (RPC) - length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", - gpsQuality, svUsedCount, loc_eng_data_p->hdop); - } - else - { // no hdop - length = snprintf(pMarker, lengthRemaining, "%c,%02d,,", - gpsQuality, svUsedCount); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL) - { - length = snprintf(pMarker, lengthRemaining, "%.1lf,M,", - locationExtended.altitudeMeanSeaLevel); - } - else - { - length = snprintf(pMarker, lengthRemaining,",,"); - } - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if ((location.gpsLocation.flags & GPS_LOCATION_HAS_ALTITUDE) && - (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)) - { - length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,", - location.gpsLocation.altitude - locationExtended.altitudeMeanSeaLevel); - } - else - { - length = snprintf(pMarker, lengthRemaining,",,,"); - } - - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - } - //Send blank NMEA reports for non-final fixes - else { - strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - - strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - } - // clear the dop cache so they can't be used again - loc_eng_data_p->pdop = 0; - loc_eng_data_p->hdop = 0; - loc_eng_data_p->vdop = 0; - - EXIT_LOG(%d, 0); -} - - - -/*=========================================================================== -FUNCTION loc_eng_nmea_generate_sv - -DESCRIPTION - Generate NMEA sentences generated based on sv report - -DEPENDENCIES - NONE - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) -{ - ENTRY_LOG(); - - char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; - char* pMarker = sentence; - int lengthRemaining = sizeof(sentence); - int length = 0; - int svCount = svStatus.num_svs; - int sentenceCount = 0; - int sentenceNumber = 1; - int svNumber = 1; - int gpsCount = 0; - int glnCount = 0; - - //Count GPS SVs for saparating GPS from GLONASS and throw others - - loc_eng_data_p->gps_used_mask = 0; - loc_eng_data_p->glo_used_mask = 0; - for(svNumber=1; svNumber <= svCount; svNumber++) { - if (GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation) - { - // cache the used in fix mask, as it will be needed to send $GPGSA - // during the position report - if (GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & GNSS_SV_FLAGS_USED_IN_FIX)) - { - loc_eng_data_p->gps_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); - } - gpsCount++; - } - else if (GNSS_CONSTELLATION_GLONASS == svStatus.gnss_sv_list[svNumber - 1].constellation) - { - // cache the used in fix mask, as it will be needed to send $GNGSA - // during the position report - if (GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & GNSS_SV_FLAGS_USED_IN_FIX)) - { - loc_eng_data_p->glo_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1)); - } - glnCount++; - } - } - - // ------------------ - // ------$GPGSV------ - // ------------------ - - if (gpsCount <= 0) - { - // no svs in view, so just send a blank $GPGSV sentence - strlcpy(sentence, "$GPGSV,1,1,0,", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - } - else - { - svNumber = 1; - sentenceNumber = 1; - sentenceCount = gpsCount/4 + (gpsCount % 4 != 0); - - while (sentenceNumber <= sentenceCount) - { - pMarker = sentence; - lengthRemaining = sizeof(sentence); - - length = snprintf(pMarker, lengthRemaining, "$GPGSV,%d,%d,%02d", - sentenceCount, sentenceNumber, gpsCount); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) - { - if (GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation) - { - length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", - svStatus.gnss_sv_list[svNumber-1].svid, - (int)(0.5 + svStatus.gnss_sv_list[svNumber-1].elevation), //float to int - (int)(0.5 + svStatus.gnss_sv_list[svNumber-1].azimuth)); //float to int - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (svStatus.gnss_sv_list[svNumber-1].c_n0_dbhz > 0) - { - length = snprintf(pMarker, lengthRemaining,"%02d", - (int)(0.5 + svStatus.gnss_sv_list[svNumber-1].c_n0_dbhz)); //float to int - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - } - - i++; - } - - } - - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - sentenceNumber++; - - } //while - - } //if - - // ------------------ - // ------$GLGSV------ - // ------------------ - - if (glnCount <= 0) - { - // no svs in view, so just send a blank $GLGSV sentence - strlcpy(sentence, "$GLGSV,1,1,0,", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - } - else - { - svNumber = 1; - sentenceNumber = 1; - sentenceCount = glnCount/4 + (glnCount % 4 != 0); - - while (sentenceNumber <= sentenceCount) - { - pMarker = sentence; - lengthRemaining = sizeof(sentence); - - length = snprintf(pMarker, lengthRemaining, "$GLGSV,%d,%d,%02d", - sentenceCount, sentenceNumber, glnCount); - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) - { - if (GNSS_CONSTELLATION_GLONASS == svStatus.gnss_sv_list[svNumber - 1].constellation) - { - - length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", - svStatus.gnss_sv_list[svNumber - 1].svid, - (int)(0.5 + svStatus.gnss_sv_list[svNumber - 1].elevation), //float to int - (int)(0.5 + svStatus.gnss_sv_list[svNumber - 1].azimuth)); //float to int - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - - if (svStatus.gnss_sv_list[svNumber - 1].c_n0_dbhz > 0) - { - length = snprintf(pMarker, lengthRemaining,"%02d", - (int)(0.5 + svStatus.gnss_sv_list[svNumber - 1].c_n0_dbhz)); //float to int - - if (length < 0 || length >= lengthRemaining) - { - LOC_LOGE("NMEA Error in string formatting"); - return; - } - pMarker += length; - lengthRemaining -= length; - } - - i++; - } - - } - - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); - sentenceNumber++; - - } //while - - }//if - - // For RPC, the DOP are sent during sv report, so cache them - // now to be sent during position report. - // For QMI, the DOP will be in position report. - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) - { - loc_eng_data_p->pdop = locationExtended.pdop; - loc_eng_data_p->hdop = locationExtended.hdop; - loc_eng_data_p->vdop = locationExtended.vdop; - } - else - { - loc_eng_data_p->pdop = 0; - loc_eng_data_p->hdop = 0; - loc_eng_data_p->vdop = 0; - } - - EXIT_LOG(%d, 0); -} diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.h b/gps/loc_api/libloc_api_50001/loc_eng_nmea.h deleted file mode 100644 index 066943a..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_ENG_NMEA_H -#define LOC_ENG_NMEA_H - -#include -#include - -#define NMEA_SENTENCE_MAX_LENGTH 200 - -void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p); -int loc_eng_nmea_put_checksum(char *pNmea, int maxSize); -void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended); -void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended, unsigned char generate_nmea); - -#endif // LOC_ENG_NMEA_H diff --git a/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp deleted file mode 100644 index b5bf4e7..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_eng" - -#include -#include -#include - -using namespace loc_core; - -struct LocEngRequestXtraServer : public LocMsg { - LocEngAdapter* mAdapter; - inline LocEngRequestXtraServer(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) - { - locallog(); - } - inline virtual void proc() const { - mAdapter->requestXtraServer(); - } - inline void locallog() const { - LOC_LOGV("LocEngRequestXtraServer"); - } - inline virtual void log() const { - locallog(); - } -}; - -struct LocEngInjectXtraData : public LocMsg { - LocEngAdapter* mAdapter; - char* mData; - const int mLen; - inline LocEngInjectXtraData(LocEngAdapter* adapter, - char* data, int len): - LocMsg(), mAdapter(adapter), - mData(new char[len]), mLen(len) - { - memcpy((void*)mData, (void*)data, len); - locallog(); - } - inline ~LocEngInjectXtraData() - { - delete[] mData; - } - inline virtual void proc() const { - mAdapter->setXtraData(mData, mLen); - } - inline void locallog() const { - LOC_LOGV("length: %d\n data: %p", mLen, mData); - } - inline virtual void log() const { - locallog(); - } -}; - -struct LocEngSetXtraVersionCheck : public LocMsg { - LocEngAdapter *mAdapter; - int mCheck; - inline LocEngSetXtraVersionCheck(LocEngAdapter* adapter, - int check): - mAdapter(adapter), mCheck(check) {} - inline virtual void proc() const { - locallog(); - mAdapter->setXtraVersionCheck(mCheck); - } - inline void locallog() const { - LOC_LOGD("%s:%d]: mCheck: %d", - __func__, __LINE__, mCheck); - } - inline virtual void log() const { - locallog(); - } -}; - -/*=========================================================================== -FUNCTION loc_eng_xtra_init - -DESCRIPTION - Initialize XTRA module. - -DEPENDENCIES - N/A - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, - GpsXtraExtCallbacks* callbacks) -{ - int ret_val = -1; - loc_eng_xtra_data_s_type *xtra_module_data_ptr; - ENTRY_LOG(); - - if(!loc_eng_data.adapter->mSupportsTimeInjection - || loc_eng_data.adapter->hasNativeXtraClient()) { - LOC_LOGD("XTRA is already supported. disable it here.\n"); - EXIT_LOG(%d, 1); // return 1 denote failure - return 1; - } - - if(callbacks == NULL) { - LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL"); - } else { - xtra_module_data_ptr = &loc_eng_data.xtra_module_data; - xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; - xtra_module_data_ptr->report_xtra_server_cb = callbacks->report_xtra_server_cb; - - ret_val = 0; - } - EXIT_LOG(%d, ret_val); - return ret_val; -} - -/*=========================================================================== -FUNCTION loc_eng_xtra_inject_data - -DESCRIPTION - Injects XTRA file into the engine but buffers the data if engine is busy. - -DEPENDENCIES - N/A - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, - char* data, int length) -{ - ENTRY_LOG(); - LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); - EXIT_LOG(%d, 0); - return 0; -} -/*=========================================================================== -FUNCTION loc_eng_xtra_request_server - -DESCRIPTION - Request the Xtra server url from the modem - -DEPENDENCIES - N/A - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data) -{ - ENTRY_LOG(); - LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngRequestXtraServer(adapter)); - EXIT_LOG(%d, 0); - return 0; -} -/*=========================================================================== -FUNCTION loc_eng_xtra_version_check - -DESCRIPTION - Injects the enable/disable value for checking XTRA version - that is specified in gps.conf - -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_xtra_version_check(loc_eng_data_s_type &loc_eng_data, - int check) -{ - ENTRY_LOG(); - LocEngAdapter *adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngSetXtraVersionCheck(adapter, check)); - EXIT_LOG(%d, 0); -} diff --git a/gps/loc_api/libloc_api_50001/loc_eng_xtra.h b/gps/loc_api/libloc_api_50001/loc_eng_xtra.h deleted file mode 100644 index 175f497..0000000 --- a/gps/loc_api/libloc_api_50001/loc_eng_xtra.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) 2009,2011 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_ENG_XTRA_H -#define LOC_ENG_XTRA_H - -#include - -// Module data -typedef struct -{ - // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; - gps_xtra_download_request download_request_cb; - report_xtra_server report_xtra_server_cb; - - // XTRA data buffer - char *xtra_data_for_injection; // NULL if no pending data - int xtra_data_len; -} loc_eng_xtra_data_s_type; - -#endif // LOC_ENG_XTRA_H diff --git a/gps/utils/Android.mk b/gps/utils/Android.mk deleted file mode 100644 index ef1b7a2..0000000 --- a/gps/utils/Android.mk +++ /dev/null @@ -1,69 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - - -## Libs -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - liblog \ - libloc_pla - -LOCAL_SRC_FILES += \ - loc_log.cpp \ - loc_cfg.cpp \ - msg_q.c \ - linked_list.c \ - loc_target.cpp \ - platform_lib_abstractions/elapsed_millis_since_boot.cpp \ - LocHeap.cpp \ - LocTimer.cpp \ - LocThread.cpp \ - MsgTask.cpp \ - loc_misc_utils.cpp - -# Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ - -ifeq ($(TARGET_BUILD_VARIANT),user) - LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER -endif - -LOCAL_LDFLAGS += -Wl,--export-dynamic - -## Includes -LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/libloc_pla - -LOCAL_COPY_HEADERS_TO:= gps.utils/ -LOCAL_COPY_HEADERS:= \ - loc_log.h \ - loc_cfg.h \ - log_util.h \ - linked_list.h \ - msg_q.h \ - MsgTask.h \ - LocHeap.h \ - LocThread.h \ - LocTimer.h \ - loc_target.h \ - loc_timer.h \ - LocSharedLock.h \ - loc_misc_utils.h - -LOCAL_MODULE := libgps.utils - -LOCAL_MODULE_TAGS := optional - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -include $(addsuffix /Android.mk, $(addprefix $(LOCAL_PATH)/, platform_lib_abstractions)) -endif # not BUILD_TINY_ANDROID diff --git a/gps/utils/LocHeap.cpp b/gps/utils/LocHeap.cpp deleted file mode 100644 index d667f14..0000000 --- a/gps/utils/LocHeap.cpp +++ /dev/null @@ -1,354 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include - -class LocHeapNode { - friend class LocHeap; - - // size of of the subtree, excluding self, 1 if no subtree - int mSize; - LocHeapNode* mLeft; - LocHeapNode* mRight; - LocRankable* mData; -public: - inline LocHeapNode(LocRankable& data) : - mSize(1), mLeft(NULL), mRight(NULL), mData(&data) {} - ~LocHeapNode(); - - // this only swaps the data of the two nodes, so no - // detach / re-attached is necessary - void swap(LocHeapNode& node); - - LocRankable* detachData(); - - // push a node into the tree stucture, keeping sorted by rank - void push(LocHeapNode& node); - - // pop the head node out of the tree stucture. keeping sorted by rank - static LocHeapNode* pop(LocHeapNode*& top); - - // remove a specific node from the tree - // returns the pointer to the node removed, which would be either the - // same as input (if successfully removed); or NULL (if failed). - static LocHeapNode* remove(LocHeapNode*& top, LocRankable& data); - - // convenience method to compare data ranking - inline bool outRanks(LocHeapNode& node) { return mData->outRanks(*node.mData); } - inline bool outRanks(LocRankable& data) { return mData->outRanks(data); } - - // checks if mSize is correct, AND this node is the highest ranking - // of the entire subtree - bool checkNodes(); - - inline int getSize() { return mSize; } -}; - -inline -LocHeapNode::~LocHeapNode() { - if (mLeft) { - delete mLeft; - mLeft = NULL; - } - if (mRight) { - delete mRight; - mRight = NULL; - } - if (mData) { - mData = NULL; - } -} - -inline -void LocHeapNode::swap(LocHeapNode& node) { - LocRankable* tmpData = node.mData; - node.mData = mData; - mData = tmpData; -} - -inline -LocRankable* LocHeapNode::detachData() { - LocRankable* data = mData; - mData = NULL; - return data; -} - -// push keeps the tree sorted by rank, it also tries to balance the -// tree by adding the new node to the smaller of the subtrees. -// The pointer to the tree and internal links never change. If the -// mData of tree top ranks lower than that of the incoming node, -// mData will be swapped with that of the incoming node to ensure -// ranking, no restructuring the container nodes. -void LocHeapNode::push(LocHeapNode& node) { - // ensure the current node ranks higher than in the incoming one - if (node.outRanks(*this)) { - swap(node); - } - - // now drop the new node (ensured lower than *this) into a subtree - if (NULL == mLeft) { - mLeft = &node; - } else if (NULL == mRight) { - mRight = &node; - } else if (mLeft->mSize <= mRight->mSize) { - mLeft->push(node); - } else { - mRight->push(node); - } - mSize++; -} - -// pop keeps the tree sorted by rank, but it does not try to balance -// the tree. It recursively swaps with the higher ranked top of the -// subtrees. -// The return is a popped out node from leaf level, that has the data -// swapped all the way down from the top. The pinter to the tree and -// internal links will not be changed or restructured, except for the -// node that is popped out. -// If the return pointer == this, this the last node in the tree. -LocHeapNode* LocHeapNode::pop(LocHeapNode*& top) { - // we know the top has the highest ranking at this point, else - // the tree is broken. This top will be popped out. But we need - // a node from the left or right child, whichever ranks higher, - // to replace the current top. This then will need to be done - // recursively to the leaf level. So we swap the mData of the - // current top node all the way down to the leaf level. - LocHeapNode* poppedNode = top; - // top is losing a node in its subtree - top->mSize--; - if (top->mLeft || top->mRight) { - // if mLeft is NULL, mRight for sure is NOT NULL, take that; - // else if mRight is NULL, mLeft for sure is NOT, take that; - // else we take the address of whatever has higher ranking mData - LocHeapNode*& subTop = (NULL == top->mLeft) ? top->mRight : - ((NULL == top->mRight) ? top->mLeft : - (top->mLeft->outRanks(*(top->mRight)) ? top->mLeft : top->mRight)); - // swap mData, the tree top gets updated with the new data. - top->swap(*subTop); - // pop out from the subtree - poppedNode = pop(subTop); - } else { - // if the top has only single node - // detach the poppedNode from the tree - // subTop is the reference of ether mLeft or mRight - // NOT a local stack pointer. so it MUST be NULL'ed here. - top = NULL; - } - - return poppedNode; -} - -// navigating through the tree and find the node that hass the input -// data. Since this is a heap, we do recursive linear search. -// returns the pointer to the node removed, which would be either the -// same as input (if successfully removed); or NULL (if failed). -LocHeapNode* LocHeapNode::remove(LocHeapNode*& top, LocRankable& data) { - LocHeapNode* removedNode = NULL; - // this is the node, by address - if (&data == (LocRankable*)(top->mData)) { - // pop this node out - removedNode = pop(top); - } else if (!data.outRanks(*top->mData)) { - // subtrees might have this node - if (top->mLeft) { - removedNode = remove(top->mLeft, data); - } - // if we did not find in mLeft, and mRight is not empty - if (!removedNode && top->mRight) { - removedNode = remove(top->mRight, data); - } - - // top lost a node in its subtree - if (removedNode) { - top->mSize--; - } - } - - return removedNode; -} - -// checks if mSize is correct, AND this node is the highest ranking -// of the entire subtree -bool LocHeapNode::checkNodes() { - // size of the current subtree - int totalSize = mSize; - if (mLeft) { - // check the consistency of left subtree - if (mLeft->outRanks(*this) || !mLeft->checkNodes()) { - return false; - } - // subtract the size of left subtree (with subtree head) - totalSize -= mLeft->mSize; - } - - if (mRight) { - // check the consistency of right subtree - if (mRight->outRanks(*this) || !mRight->checkNodes()) { - return false; - } - // subtract the size of right subtree (with subtree head) - totalSize -= mRight->mSize; - } - - // for the tree nodes to consistent, totalSize must be 1 now - return totalSize == 1; -} - -LocHeap::~LocHeap() { - if (mTree) { - delete mTree; - } -} - -void LocHeap::push(LocRankable& node) { - LocHeapNode* heapNode = new LocHeapNode(node); - if (!mTree) { - mTree = heapNode; - } else { - mTree->push(*heapNode); - } -} - -LocRankable* LocHeap::peek() { - LocRankable* top = NULL; - if (mTree) { - top = mTree->mData; - } - return top; -} - -LocRankable* LocHeap::pop() { - LocRankable* locNode = NULL; - if (mTree) { - // mTree may become NULL after this call - LocHeapNode* heapNode = LocHeapNode::pop(mTree); - locNode = heapNode->detachData(); - delete heapNode; - } - return locNode; -} - -LocRankable* LocHeap::remove(LocRankable& rankable) { - LocRankable* locNode = NULL; - if (mTree) { - // mTree may become NULL after this call - LocHeapNode* heapNode = LocHeapNode::remove(mTree, rankable); - if (heapNode) { - locNode = heapNode->detachData(); - delete heapNode; - } - } - return locNode; -} - -#ifdef __LOC_UNIT_TEST__ -bool LocHeap::checkTree() { - return ((NULL == mTree) || mTree->checkNodes()); -} -uint32_t LocHeap::getTreeSize() { - return (NULL == mTree) ? 0 : mTree->getSize(); -} -#endif - -#ifdef __LOC_DEBUG__ - -#include -#include -#include - -class LocHeapDebug : public LocHeap { -public: - bool checkTree() { - return ((NULL == mTree) || mTree->checkNodes()); - } - - uint32_t getTreeSize() { - return (NULL == mTree) ? 0 : (mTree->getSize()); - } -}; - -class LocHeapDebugData : public LocRankable { - const int mID; -public: - LocHeapDebugData(int id) : mID(id) {} - inline virtual int ranks(LocRankable& rankable) { - LocHeapDebugData* testData = dynamic_cast(&rankable); - return testData->mID - mID; - } -}; - -// For Linux command line testing: -// compilation: g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -I. -I../../../../vendor/qcom/proprietary/gps-internal/unit-tests/fakes_for_host -I../../../../system/core/include LocHeap.cpp -// test: valgrind --leak-check=full ./a.out 100 -int main(int argc, char** argv) { - srand(time(NULL)); - int tries = atoi(argv[1]); - int checks = tries >> 3; - LocHeapDebug heap; - int treeSize = 0; - - for (int i = 0; i < tries; i++) { - if (i % checks == 0 && !heap.checkTree()) { - printf("tree check failed before %dth op\n", i); - } - int r = rand(); - - if (r & 1) { - LocHeapDebugData* data = new LocHeapDebugData(r >> 1); - heap.push(dynamic_cast(*data)); - treeSize++; - } else { - LocRankable* rankable = heap.pop(); - if (rankable) { - delete rankable; - } - treeSize ? treeSize-- : 0; - } - - printf("%s: %d == %d\n", (r&1)?"push":"pop", treeSize, heap.getTreeSize()); - if (treeSize != heap.getTreeSize()) { - printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); - tries = i+1; - break; - } - } - - if (!heap.checkTree()) { - printf("!!!!!!!!!!tree check failed at the end after %d ops!!!!!!!\n", tries); - } else { - printf("success!\n"); - } - - for (LocRankable* data = heap.pop(); NULL != data; data = heap.pop()) { - delete data; - } - - return 0; -} - -#endif diff --git a/gps/utils/LocHeap.h b/gps/utils/LocHeap.h deleted file mode 100644 index b491948..0000000 --- a/gps/utils/LocHeap.h +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef __LOC_HEAP__ -#define __LOC_HEAP__ - -#include -#include - -// abstract class to be implemented by client to provide a rankable class -class LocRankable { -public: - virtual inline ~LocRankable() {} - - // method to rank objects of such type for sorting purposes. - // The pointer of the input node would be stored in the heap. - // >0 if ranks higher than the input; - // ==0 if equally ranks with the input; - // <0 if ranks lower than the input - virtual int ranks(LocRankable& rankable) = 0; - - // convenient method to rank objects of such type for sorting purposes. - inline bool outRanks(LocRankable& rankable) { return ranks(rankable) > 0; } -}; - -// opaque class to provide service implementation. -class LocHeapNode; - -// a heap whose left and right children are not sorted. It is sorted only vertically, -// i.e. parent always ranks higher than children, if they exist. Ranking algorithm is -// implemented in Rankable. The reason that there is no sort between children is to -// help beter balance the tree with lower cost. When a node is pushed to the tree, -// it is guaranteed that the subtree that is smaller gets to have the new node. -class LocHeap { -protected: - LocHeapNode* mTree; -public: - inline LocHeap() : mTree(NULL) {} - ~LocHeap(); - - // push keeps the tree sorted by rank, it also tries to balance the - // tree by adding the new node to the smaller of the subtrees. - // node is reference to an obj that is managed by client, that client - // creates and destroyes. The destroy should happen after the - // node is popped out from the heap. - void push(LocRankable& node); - - // Peeks the node data on tree top, which has currently the highest ranking - // There is no change the tree structure with this operation - // Returns NULL if the tree is empty, otherwise pointer to the node data of - // the tree top. - LocRankable* peek(); - - // pop keeps the tree sorted by rank, but it does not try to balance - // the tree. - // Return - pointer to the node popped out, or NULL if heap is already empty - LocRankable* pop(); - - // navigating through the tree and find the node that ranks the same - // as the input data, then remove it from the tree. Rank is implemented - // by rankable obj. - // returns the pointer to the node removed; or NULL (if failed). - LocRankable* remove(LocRankable& rankable); - -#ifdef __LOC_UNIT_TEST__ - bool checkTree(); - uint32_t getTreeSize(); -#endif -}; - -#endif //__LOC_HEAP__ diff --git a/gps/utils/LocSharedLock.h b/gps/utils/LocSharedLock.h deleted file mode 100644 index 7fe6237..0000000 --- a/gps/utils/LocSharedLock.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef __LOC_SHARED_LOCK__ -#define __LOC_SHARED_LOCK__ - -#include -#include -#include - -// This is a utility created for use cases such that there are more than -// one client who need to share the same lock, but it is not predictable -// which of these clients is to last to go away. This shared lock deletes -// itself when the last client calls its drop() method. To add a cient, -// this share lock's share() method has to be called, so that the obj -// can maintain an accurate client count. -class LocSharedLock { - volatile int32_t mRef; - pthread_mutex_t mMutex; - inline ~LocSharedLock() { pthread_mutex_destroy(&mMutex); } -public: - // first client to create this LockSharedLock - inline LocSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); } - // following client(s) are to *share()* this lock created by the first client - inline LocSharedLock* share() { android_atomic_inc(&mRef); return this; } - // whe a client no longer needs this shared lock, drop() shall be called. - inline void drop() { if (1 == android_atomic_dec(&mRef)) delete this; } - // locking the lock to enter critical section - inline void lock() { pthread_mutex_lock(&mMutex); } - // unlocking the lock to leave the critical section - inline void unlock() { pthread_mutex_unlock(&mMutex); } -}; - -#endif //__LOC_SHARED_LOCK__ diff --git a/gps/utils/LocThread.cpp b/gps/utils/LocThread.cpp deleted file mode 100644 index 685841e..0000000 --- a/gps/utils/LocThread.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include -#include -#include -#include - -class LocThreadDelegate { - LocRunnable* mRunnable; - bool mJoinable; - pthread_t mThandle; - pthread_mutex_t mMutex; - int mRefCount; - ~LocThreadDelegate(); - LocThreadDelegate(LocThread::tCreate creator, const char* threadName, - LocRunnable* runnable, bool joinable); - void destroy(); -public: - static LocThreadDelegate* create(LocThread::tCreate creator, - const char* threadName, LocRunnable* runnable, bool joinable); - void stop(); - // bye() is for the parent thread to go away. if joinable, - // parent must stop the spawned thread, join, and then - // destroy(); if detached, the parent can go straight - // ahead to destroy() - inline void bye() { mJoinable ? stop() : destroy(); } - inline bool isRunning() { return (NULL != mRunnable); } - static void* threadMain(void* arg); -}; - -// it is important to note that internal members must be -// initialized to values as if pthread_create succeeds. -// This is to avoid the race condition between the threads, -// once the thread is created, some of these values will -// be check in the spawned thread, and must set correctly -// then and there. -// However, upon pthread_create failure, the data members -// must be set to indicate failure, e.g. mRunnable, and -// threashold approprietly for destroy(), e.g. mRefCount. -LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator, - const char* threadName, LocRunnable* runnable, bool joinable) : - mRunnable(runnable), mJoinable(joinable), mThandle(NULL), - mMutex(PTHREAD_MUTEX_INITIALIZER), mRefCount(2) { - - // set up thread name, if nothing is passed in - if (!threadName) { - threadName = "LocThread"; - } - - // create the thread here, then if successful - // and a name is given, we set the thread name - if (creator) { - mThandle = creator(threadName, threadMain, this); - } else if (pthread_create(&mThandle, NULL, threadMain, this)) { - // pthread_create() failed - mThandle = NULL; - } - - if (mThandle) { - // set thread name - char lname[16]; - int len = (sizeof(lname)>sizeof(threadName)) ? - (sizeof(threadName) -1):(sizeof(lname) - 1); - memcpy(lname, threadName, len); - lname[len] = 0; - // set the thread name here - pthread_setname_np(mThandle, lname); - - // detach, if not joinable - if (!joinable) { - pthread_detach(mThandle); - } - } else { - // must set these values upon failure - mRunnable = NULL; - mJoinable = false; - mRefCount = 1; - } -} - -inline -LocThreadDelegate::~LocThreadDelegate() { - // at this point nothing should need done any more -} - -// factory method so that we could return NULL upon failure -LocThreadDelegate* LocThreadDelegate::create(LocThread::tCreate creator, - const char* threadName, LocRunnable* runnable, bool joinable) { - LocThreadDelegate* thread = NULL; - if (runnable) { - thread = new LocThreadDelegate(creator, threadName, runnable, joinable); - if (thread && !thread->isRunning()) { - thread->destroy(); - thread = NULL; - } - } - - return thread; -} - -// The order is importang -// NULLing mRunnalbe stops the while loop in threadMain() -// join() if mJoinble must come before destroy() call, as -// the obj must remain alive at this time so that mThandle -// remains valud. -void LocThreadDelegate::stop() { - // mRunnable and mJoinable are reset on different triggers. - // mRunnable may get nulled on the spawned thread's way out; - // or here. - // mJouinable (if ever been true) gets falsed when client - // thread triggers stop, with either a stop() - // call or the client releases thread obj handle. - if (mRunnable) { - mRunnable = NULL; - } - if (mJoinable) { - mJoinable = false; - pthread_join(mThandle, NULL); - } - // call destroy() to possibly delete the obj - destroy(); -} - -// method for clients to call to release the obj -// when it is a detached thread, the client thread -// and the spawned thread can both try to destroy() -// asynchronously. And we delete this obj when -// mRefCount becomes 0. -void LocThreadDelegate::destroy() { - // else case shouldn't happen, unless there is a - // leaking obj. But only our code here has such - // obj, so if we test our code well, else case - // will never happen - if (mRefCount > 0) { - // we need a flag on the stack - bool callDelete = false; - - // critical section between threads - pthread_mutex_lock(&mMutex); - // last destroy() call - callDelete = (1 == mRefCount--); - pthread_mutex_unlock(&mMutex); - - // upon last destroy() call we delete this obj - if (callDelete) { - delete this; - } - } -} - -void* LocThreadDelegate::threadMain(void* arg) { - LocThreadDelegate* locThread = (LocThreadDelegate*)(arg); - - if (locThread) { - LocRunnable* runnable = locThread->mRunnable; - - if (runnable) { - if (locThread->isRunning()) { - runnable->prerun(); - } - - while (locThread->isRunning() && runnable->run()); - - if (locThread->isRunning()) { - runnable->postrun(); - } - - // at this time, locThread->mRunnable may or may not be NULL - // NULL it just to be safe and clean, as we want the field - // in the released memory slot to be NULL. - locThread->mRunnable = NULL; - delete runnable; - } - locThread->destroy(); - } - - return NULL; -} - -LocThread::~LocThread() { - if (mThread) { - mThread->bye(); - mThread = NULL; - } -} - -bool LocThread::start(tCreate creator, const char* threadName, LocRunnable* runnable, bool joinable) { - bool success = false; - if (!mThread) { - mThread = LocThreadDelegate::create(creator, threadName, runnable, joinable); - // true only if thread is created successfully - success = (NULL != mThread); - } - return success; -} - -void LocThread::stop() { - if (mThread) { - mThread->stop(); - mThread = NULL; - } -} - -#ifdef __LOC_DEBUG__ - -#include -#include -#include - -class LocRunnableTest1 : public LocRunnable { - int mID; -public: - LocRunnableTest1(int id) : LocRunnable(), mID(id) {} - virtual bool run() { - printf("LocRunnableTest1: %d\n", mID++); - sleep(1); - return true; - } -}; - -// on linux command line: -// compile: g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -std=c++0x -I. -I../../../../vendor/qcom/proprietary/gps-internal/unit-tests/fakes_for_host -I../../../../system/core/include -lpthread LocThread.cpp -// test detached thread: valgrind ./a.out 0 -// test joinable thread: valgrind ./a.out 1 -int main(int argc, char** argv) { - LocRunnableTest1 test(10); - - LocThread thread; - thread.start("LocThreadTest", test, atoi(argv[1])); - - sleep(10); - - thread.stop(); - - sleep(5); - - return 0; -} - -#endif diff --git a/gps/utils/LocThread.h b/gps/utils/LocThread.h deleted file mode 100644 index 2a65d8f..0000000 --- a/gps/utils/LocThread.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef __LOC_THREAD__ -#define __LOC_THREAD__ - -#include -#include - -// abstract class to be implemented by client to provide a runnable class -// which gets scheduled by LocThread -class LocRunnable { -public: - inline LocRunnable() {} - inline virtual ~LocRunnable() {} - - // The method to be implemented by thread clients - // and be scheduled by LocThread - // This method will be repeated called until it returns false; or - // until thread is stopped. - virtual bool run() = 0; - - // The method to be run before thread loop (conditionally repeatedly) - // calls run() - inline virtual void prerun() {} - - // The method to be run after thread loop (conditionally repeatedly) - // calls run() - inline virtual void postrun() {} -}; - -// opaque class to provide service implementation. -class LocThreadDelegate; - -// A utility class to create a thread and run LocRunnable -// caller passes in. -class LocThread { - LocThreadDelegate* mThread; -public: - inline LocThread() : mThread(NULL) {} - virtual ~LocThread(); - - typedef pthread_t (*tCreate)(const char* name, void* (*start)(void*), void* arg); - // client starts thread with a runnable, which implements - // the logics to fun in the created thread context. - // The thread could be either joinable or detached. - // runnable is an obj managed by client. Client creates and - // frees it (but must be after stop() is called, or - // this LocThread obj is deleted). - // The obj will be deleted by LocThread if start() - // returns true. Else it is client's responsibility - // to delete the object - // Returns 0 if success; false if failure. - bool start(tCreate creator, const char* threadName, LocRunnable* runnable, bool joinable = true); - inline bool start(const char* threadName, LocRunnable* runnable, bool joinable = true) { - return start(NULL, threadName, runnable, joinable); - } - - // NOTE: if this is a joinable thread, this stop may block - // for a while until the thread is joined. - void stop(); - - // thread status check - inline bool isRunning() { return NULL != mThread; } -}; - -#endif //__LOC_THREAD__ diff --git a/gps/utils/LocTimer.cpp b/gps/utils/LocTimer.cpp deleted file mode 100644 index 4de6b40..0000000 --- a/gps/utils/LocTimer.cpp +++ /dev/null @@ -1,742 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __HOST_UNIT_TEST__ -#define EPOLLWAKEUP 0 -#define CLOCK_BOOTTIME CLOCK_MONOTONIC -#define CLOCK_BOOTTIME_ALARM CLOCK_MONOTONIC -#endif - -/* -There are implementations of 5 classes in this file: -LocTimer, LocTimerDelegate, LocTimerContainer, LocTimerPollTask, LocTimerWrapper - -LocTimer - client front end, interface for client to start / stop timers, also - to provide a callback. -LocTimerDelegate - an internal timer entity, which also is a LocRankable obj. - Its life cycle is different than that of LocTimer. It gets - created when LocTimer::start() is called, and gets deleted - when it expires or clients calls the hosting LocTimer obj's - stop() method. When a LocTimerDelegate obj is ticking, it - stays in the corresponding LocTimerContainer. When expired - or stopped, the obj is removed from the container. Since it - is also a LocRankable obj, and LocTimerContainer also is a - heap, its ranks() implementation decides where it is placed - in the heap. -LocTimerContainer - core of the timer service. It is a container (derived from - LocHeap) for LocTimerDelegate (implements LocRankable) objs. - There are 2 of such containers, one for sw timers (or Linux - timers) one for hw timers (or Linux alarms). It adds one of - each (those that expire the soonest) to kernel via services - provided by LocTimerPollTask. All the heap management on the - LocTimerDelegate objs are done in the MsgTask context, such - that synchronization is ensured. -LocTimerPollTask - is a class that wraps timerfd and epoll POXIS APIs. It also - both implements LocRunnalbe with epoll_wait() in the run() - method. It is also a LocThread client, so as to loop the run - method. -LocTimerWrapper - a LocTimer client itself, to implement the existing C API with - APIs, loc_timer_start() and loc_timer_stop(). - -*/ - -class LocTimerPollTask; - -// This is a multi-functaional class that: -// * extends the LocHeap class for the detection of head update upon add / remove -// events. When that happens, soonest time out changes, so timerfd needs update. -// * contains the timers, and add / remove them into the heap -// * provides and maps 2 of such containers, one for timers (or mSwTimers), one -// for alarms (or mHwTimers); -// * provides a polling thread; -// * provides a MsgTask thread for synchronized add / remove / timer client callback. -class LocTimerContainer : public LocHeap { - // mutex to synchronize getters of static members - static pthread_mutex_t mMutex; - // Container of timers - static LocTimerContainer* mSwTimers; - // Container of alarms - static LocTimerContainer* mHwTimers; - // Msg task to provider msg Q, sender and reader. - static MsgTask* mMsgTask; - // Poll task to provide epoll call and threading to poll. - static LocTimerPollTask* mPollTask; - // timer / alarm fd - int mDevFd; - // ctor - LocTimerContainer(bool wakeOnExpire); - // dtor - ~LocTimerContainer(); - static MsgTask* getMsgTaskLocked(); - static LocTimerPollTask* getPollTaskLocked(); - // extend LocHeap and pop if the top outRanks input - LocTimerDelegate* popIfOutRanks(LocTimerDelegate& timer); - // update the timer POSIX calls with updated soonest timer spec - void updateSoonestTime(LocTimerDelegate* priorTop); - -public: - // factory method to control the creation of mSwTimers / mHwTimers - static LocTimerContainer* get(bool wakeOnExpire); - - LocTimerDelegate* getSoonestTimer(); - int getTimerFd(); - // add a timer / alarm obj into the container - void add(LocTimerDelegate& timer); - // remove a timer / alarm obj from the container - void remove(LocTimerDelegate& timer); - // handling of timer / alarm expiration - void expire(); -}; - -// This class implements the polling thread that epolls imer / alarm fds. -// The LocRunnable::run() contains the actual polling. The other methods -// will be run in the caller's thread context to add / remove timer / alarm -// fds the kernel, while the polling is blocked on epoll_wait() call. -// Since the design is that we have maximally 2 polls, one for all the -// timers; one for all the alarms, we will poll at most on 2 fds. But it -// is possile that all we have are only timers or alarms at one time, so we -// allow dynamically add / remove fds we poll on. The design decision of -// having 1 fd per container of timer / alarm is such that, we may not need -// to make a system call each time a timer / alarm is added / removed, unless -// that changes the "soonest" time out of that of all the timers / alarms. -class LocTimerPollTask : public LocRunnable { - // the epoll fd - const int mFd; - // the thread that calls run() method - LocThread* mThread; - friend class LocThreadDelegate; - // dtor - ~LocTimerPollTask(); -public: - // ctor - LocTimerPollTask(); - // this obj will be deleted once thread is deleted - void destroy(); - // add a container of timers. Each contain has a unique device fd, i.e. - // either timer or alarm fd, and a heap of timers / alarms. It is expected - // that container would have written to the device fd with the soonest - // time out value in the heap at the time of calling this method. So all - // this method does is to add the fd of the input container to the poll - // and also add the pointer of the container to the event data ptr, such - // when poll_wait wakes up on events, we know who is the owner of the fd. - void addPoll(LocTimerContainer& timerContainer); - // remove a fd that is assciated with a container. The expectation is that - // the atual timer would have been removed from the container. - void removePoll(LocTimerContainer& timerContainer); - // The polling thread context will call this method. This is where - // epoll_wait() is blocking and waiting for events.. - virtual bool run(); -}; - -// Internal class of timer obj. It gets born when client calls LocTimer::start(); -// and gets deleted when client calls LocTimer::stop() or when the it expire()'s. -// This class implements LocRankable::ranks() so that when an obj is added into -// the container (of LocHeap), it gets placed in sorted order. -class LocTimerDelegate : public LocRankable { - friend class LocTimerContainer; - friend class LocTimer; - LocTimer* mClient; - LocSharedLock* mLock; - struct timespec mFutureTime; - LocTimerContainer* mContainer; - // not a complete obj, just ctor for LocRankable comparisons - inline LocTimerDelegate(struct timespec& delay) - : mClient(NULL), mLock(NULL), mFutureTime(delay), mContainer(NULL) {} - inline ~LocTimerDelegate() { if (mLock) { mLock->drop(); mLock = NULL; } } -public: - LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire); - void destroyLocked(); - // LocRankable virtual method - virtual int ranks(LocRankable& rankable); - void expire(); - inline struct timespec getFutureTime() { return mFutureTime; } -}; - -/***************************LocTimerContainer methods***************************/ - -// Most of these static recources are created on demand. They however are never -// destoyed. The theory is that there are processes that link to this util lib -// but never use timer, then these resources would never need to be created. -// For those processes that do use timer, it will likely also need to every -// once in a while. It might be cheaper keeping them around. -pthread_mutex_t LocTimerContainer::mMutex = PTHREAD_MUTEX_INITIALIZER; -LocTimerContainer* LocTimerContainer::mSwTimers = NULL; -LocTimerContainer* LocTimerContainer::mHwTimers = NULL; -MsgTask* LocTimerContainer::mMsgTask = NULL; -LocTimerPollTask* LocTimerContainer::mPollTask = NULL; - -// ctor - initialize timer heaps -// A container for swTimer (timer) is created, when wakeOnExpire is true; or -// HwTimer (alarm), when wakeOnExpire is false. -LocTimerContainer::LocTimerContainer(bool wakeOnExpire) : - mDevFd(timerfd_create(wakeOnExpire ? CLOCK_BOOTTIME_ALARM : CLOCK_BOOTTIME, 0)) { - - if ((-1 == mDevFd) && (errno == EINVAL)) { - LOC_LOGW("%s: timerfd_create failure, fallback to CLOCK_MONOTONIC - %s", - __FUNCTION__, strerror(errno)); - mDevFd = timerfd_create(CLOCK_MONOTONIC, 0); - } - - if (-1 != mDevFd) { - // ensure we have the necessary resources created - LocTimerContainer::getPollTaskLocked(); - LocTimerContainer::getMsgTaskLocked(); - } else { - LOC_LOGE("%s: timerfd_create failure - %s", __FUNCTION__, strerror(errno)); - } -} - -// dtor -// we do not ever destroy the static resources. -inline -LocTimerContainer::~LocTimerContainer() { - close(mDevFd); -} - -LocTimerContainer* LocTimerContainer::get(bool wakeOnExpire) { - // get the reference of either mHwTimer or mSwTimers per wakeOnExpire - LocTimerContainer*& container = wakeOnExpire ? mHwTimers : mSwTimers; - // it is cheap to check pointer first than locking mutext unconditionally - if (!container) { - pthread_mutex_lock(&mMutex); - // let's check one more time to be safe - if (!container) { - container = new LocTimerContainer(wakeOnExpire); - // timerfd_create failure - if (-1 == container->getTimerFd()) { - delete container; - container = NULL; - } - } - pthread_mutex_unlock(&mMutex); - } - return container; -} - -MsgTask* LocTimerContainer::getMsgTaskLocked() { - // it is cheap to check pointer first than locking mutext unconditionally - if (!mMsgTask) { - mMsgTask = new MsgTask("LocTimerMsgTask", false); - } - return mMsgTask; -} - -LocTimerPollTask* LocTimerContainer::getPollTaskLocked() { - // it is cheap to check pointer first than locking mutext unconditionally - if (!mPollTask) { - mPollTask = new LocTimerPollTask(); - } - return mPollTask; -} - -inline -LocTimerDelegate* LocTimerContainer::getSoonestTimer() { - return (LocTimerDelegate*)(peek()); -} - -inline -int LocTimerContainer::getTimerFd() { - return mDevFd; -} - -void LocTimerContainer::updateSoonestTime(LocTimerDelegate* priorTop) { - LocTimerDelegate* curTop = getSoonestTimer(); - - // check if top has changed - if (curTop != priorTop) { - struct itimerspec delay = {0}; - bool toSetTime = false; - // if tree is empty now, we remove poll and disarm timer - if (!curTop) { - mPollTask->removePoll(*this); - // setting the values to disarm timer - delay.it_value.tv_sec = 0; - delay.it_value.tv_nsec = 0; - toSetTime = true; - } else if (!priorTop || curTop->outRanks(*priorTop)) { - // do this first to avoid race condition, in case settime is called - // with too small an interval - mPollTask->addPoll(*this); - delay.it_value = curTop->getFutureTime(); - toSetTime = true; - } - if (toSetTime) { - timerfd_settime(getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); - } - } -} - -// all the heap management is done in the MsgTask context. -inline -void LocTimerContainer::add(LocTimerDelegate& timer) { - struct MsgTimerPush : public LocMsg { - LocTimerContainer* mTimerContainer; - LocHeapNode* mTree; - LocTimerDelegate* mTimer; - inline MsgTimerPush(LocTimerContainer& container, LocTimerDelegate& timer) : - LocMsg(), mTimerContainer(&container), mTimer(&timer) {} - inline virtual void proc() const { - LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); - mTimerContainer->push((LocRankable&)(*mTimer)); - mTimerContainer->updateSoonestTime(priorTop); - } - }; - - mMsgTask->sendMsg(new MsgTimerPush(*this, timer)); -} - -// all the heap management is done in the MsgTask context. -void LocTimerContainer::remove(LocTimerDelegate& timer) { - struct MsgTimerRemove : public LocMsg { - LocTimerContainer* mTimerContainer; - LocTimerDelegate* mTimer; - inline MsgTimerRemove(LocTimerContainer& container, LocTimerDelegate& timer) : - LocMsg(), mTimerContainer(&container), mTimer(&timer) {} - inline virtual void proc() const { - LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); - - // update soonest timer only if mTimer is actually removed from - // mTimerContainer AND mTimer is not priorTop. - if (priorTop == ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer)) { - // if passing in NULL, we tell updateSoonestTime to update - // kernel with the current top timer interval. - mTimerContainer->updateSoonestTime(NULL); - } - // all timers are deleted here, and only here. - delete mTimer; - } - }; - - mMsgTask->sendMsg(new MsgTimerRemove(*this, timer)); -} - -// all the heap management is done in the MsgTask context. -// Upon expire, we check and continuously pop the heap until -// the top node's timeout is in the future. -void LocTimerContainer::expire() { - struct MsgTimerExpire : public LocMsg { - LocTimerContainer* mTimerContainer; - inline MsgTimerExpire(LocTimerContainer& container) : - LocMsg(), mTimerContainer(&container) {} - inline virtual void proc() const { - struct timespec now; - // get time spec of now - clock_gettime(CLOCK_BOOTTIME, &now); - LocTimerDelegate timerOfNow(now); - // pop everything in the heap that outRanks now, i.e. has time older than now - // and then call expire() on that timer. - for (LocTimerDelegate* timer = (LocTimerDelegate*)mTimerContainer->pop(); - NULL != timer; - timer = mTimerContainer->popIfOutRanks(timerOfNow)) { - // the timer delegate obj will be deleted before the return of this call - timer->expire(); - } - mTimerContainer->updateSoonestTime(NULL); - } - }; - - struct itimerspec delay = {0}; - timerfd_settime(getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); - mPollTask->removePoll(*this); - mMsgTask->sendMsg(new MsgTimerExpire(*this)); -} - -LocTimerDelegate* LocTimerContainer::popIfOutRanks(LocTimerDelegate& timer) { - LocTimerDelegate* poppedNode = NULL; - if (mTree && !timer.outRanks(*peek())) { - poppedNode = (LocTimerDelegate*)(pop()); - } - - return poppedNode; -} - - -/***************************LocTimerPollTask methods***************************/ - -inline -LocTimerPollTask::LocTimerPollTask() - : mFd(epoll_create(2)), mThread(new LocThread()) { - // before a next call returens, a thread will be created. The run() method - // could already be running in parallel. Also, since each of the objs - // creates a thread, the container will make sure that there will be only - // one of such obj for our timer implementation. - if (!mThread->start("LocTimerPollTask", this)) { - delete mThread; - mThread = NULL; - } -} - -inline -LocTimerPollTask::~LocTimerPollTask() { - // when fs is closed, epoll_wait() should fail run() should return false - // and the spawned thread should exit. - close(mFd); -} - -void LocTimerPollTask::destroy() { - if (mThread) { - LocThread* thread = mThread; - mThread = NULL; - delete thread; - } else { - delete this; - } -} - -void LocTimerPollTask::addPoll(LocTimerContainer& timerContainer) { - struct epoll_event ev; - memset(&ev, 0, sizeof(ev)); - - ev.events = EPOLLIN | EPOLLWAKEUP; - ev.data.fd = timerContainer.getTimerFd(); - // it is important that we set this context pointer with the input - // timer container this is how we know which container should handle - // which expiration. - ev.data.ptr = &timerContainer; - - epoll_ctl(mFd, EPOLL_CTL_ADD, timerContainer.getTimerFd(), &ev); -} - -inline -void LocTimerPollTask::removePoll(LocTimerContainer& timerContainer) { - epoll_ctl(mFd, EPOLL_CTL_DEL, timerContainer.getTimerFd(), NULL); -} - -// The polling thread context will call this method. If run() method needs to -// be repetitvely called, it must return true from the previous call. -bool LocTimerPollTask::run() { - struct epoll_event ev[2]; - - // we have max 2 descriptors to poll from - int fds = epoll_wait(mFd, ev, 2, -1); - - // we pretty much want to continually poll until the fd is closed - bool rerun = (fds > 0) || (errno == EINTR); - - if (fds > 0) { - // we may have 2 events - for (int i = 0; i < fds; i++) { - // each fd has a context pointer associated with the right timer container - LocTimerContainer* container = (LocTimerContainer*)(ev[i].data.ptr); - if (container) { - container->expire(); - } else { - epoll_ctl(mFd, EPOLL_CTL_DEL, ev[i].data.fd, NULL); - } - } - } - - // if rerun is true, we are requesting to be scheduled again - return rerun; -} - -/***************************LocTimerDelegate methods***************************/ - -inline -LocTimerDelegate::LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire) - : mClient(&client), - mLock(mClient->mLock->share()), - mFutureTime(futureTime), - mContainer(LocTimerContainer::get(wakeOnExpire)) { - // adding the timer into the container - mContainer->add(*this); -} - -inline -void LocTimerDelegate::destroyLocked() { - // client handle will likely be deleted soon after this - // method returns. Nulling this handle so that expire() - // won't call the callback on the dead handle any more. - mClient = NULL; - - if (mContainer) { - LocTimerContainer* container = mContainer; - mContainer = NULL; - if (container) { - container->remove(*this); - } - } // else we do not do anything. No such *this* can be - // created and reached here with mContainer ever been - // a non NULL. So *this* must have reached the if clause - // once, and we want it reach there only once. -} - -int LocTimerDelegate::ranks(LocRankable& rankable) { - int rank = -1; - LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable); - if (timer) { - // larger time ranks lower!!! - // IOW, if input obj has bigger tv_sec/tv_nsec, this obj outRanks higher - rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec; - if(0 == rank) - { - //rank against tv_nsec for msec accuracy - rank = (int)(timer->mFutureTime.tv_nsec - mFutureTime.tv_nsec); - } - } - return rank; -} - -inline -void LocTimerDelegate::expire() { - // keeping a copy of client pointer to be safe - // when timeOutCallback() is called at the end of this - // method, *this* obj may be already deleted. - LocTimer* client = mClient; - // force a stop, which will lead to delete of this obj - if (client && client->stop()) { - // calling client callback with a pointer save on the stack - // only if stop() returns true, i.e. it hasn't been stopped - // already. - client->timeOutCallback(); - } -} - - -/***************************LocTimer methods***************************/ -LocTimer::LocTimer() : mTimer(NULL), mLock(new LocSharedLock()) { -} - -LocTimer::~LocTimer() { - stop(); - if (mLock) { - mLock->drop(); - mLock = NULL; - } -} - -bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { - bool success = false; - mLock->lock(); - if (!mTimer) { - struct timespec futureTime; - clock_gettime(CLOCK_BOOTTIME, &futureTime); - futureTime.tv_sec += timeOutInMs / 1000; - futureTime.tv_nsec += (timeOutInMs % 1000) * 1000000; - if (futureTime.tv_nsec >= 1000000000) { - futureTime.tv_sec += futureTime.tv_nsec / 1000000000; - futureTime.tv_nsec %= 1000000000; - } - mTimer = new LocTimerDelegate(*this, futureTime, wakeOnExpire); - // if mTimer is non 0, success should be 0; or vice versa - success = (NULL != mTimer); - } - mLock->unlock(); - return success; -} - -bool LocTimer::stop() { - bool success = false; - mLock->lock(); - if (mTimer) { - LocTimerDelegate* timer = mTimer; - mTimer = NULL; - if (timer) { - timer->destroyLocked(); - success = true; - } - } - mLock->unlock(); - return success; -} - -/***************************LocTimerWrapper methods***************************/ -////////////////////////////////////////////////////////////////////////// -// This section below wraps for the C style APIs -////////////////////////////////////////////////////////////////////////// -class LocTimerWrapper : public LocTimer { - loc_timer_callback mCb; - void* mCallerData; - LocTimerWrapper* mMe; - static pthread_mutex_t mMutex; - inline ~LocTimerWrapper() { mCb = NULL; mMe = NULL; } -public: - inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : - mCb(cb), mCallerData(callerData), mMe(this) { - } - void destroy() { - pthread_mutex_lock(&mMutex); - if (NULL != mCb && this == mMe) { - delete this; - } - pthread_mutex_unlock(&mMutex); - } - virtual void timeOutCallback() { - loc_timer_callback cb = mCb; - void* callerData = mCallerData; - if (cb) { - cb(callerData, 0); - } - destroy(); - } -}; - -pthread_mutex_t LocTimerWrapper::mMutex = PTHREAD_MUTEX_INITIALIZER; - -void* loc_timer_start(uint64_t msec, loc_timer_callback cb_func, - void *caller_data, bool wake_on_expire) -{ - LocTimerWrapper* locTimerWrapper = NULL; - - if (cb_func) { - locTimerWrapper = new LocTimerWrapper(cb_func, caller_data); - - if (locTimerWrapper) { - locTimerWrapper->start(msec, wake_on_expire); - } - } - - return locTimerWrapper; -} - -void loc_timer_stop(void*& handle) -{ - if (handle) { - LocTimerWrapper* locTimerWrapper = (LocTimerWrapper*)(handle); - locTimerWrapper->destroy(); - handle = NULL; - } -} - -////////////////////////////////////////////////////////////////////////// -// This section above wraps for the C style APIs -////////////////////////////////////////////////////////////////////////// - -#ifdef __LOC_DEBUG__ - -double getDeltaSeconds(struct timespec from, struct timespec to) { - return (double)to.tv_sec + (double)to.tv_nsec / 1000000000 - - from.tv_sec - (double)from.tv_nsec / 1000000000; -} - -struct timespec getNow() { - struct timespec now; - clock_gettime(CLOCK_BOOTTIME, &now); - return now; -} - -class LocTimerTest : public LocTimer, public LocRankable { - int mTimeOut; - const struct timespec mTimeOfBirth; - inline struct timespec getTimerWrapper(int timeout) { - struct timespec now; - clock_gettime(CLOCK_BOOTTIME, &now); - now.tv_sec += timeout; - return now; - } -public: - inline LocTimerTest(int timeout) : LocTimer(), LocRankable(), - mTimeOut(timeout), mTimeOfBirth(getTimerWrapper(0)) {} - inline virtual int ranks(LocRankable& rankable) { - LocTimerTest* timer = dynamic_cast(&rankable); - return timer->mTimeOut - mTimeOut; - } - inline virtual void timeOutCallback() { - printf("timeOutCallback() - "); - deviation(); - } - double deviation() { - struct timespec now = getTimerWrapper(0); - double delta = getDeltaSeconds(mTimeOfBirth, now); - printf("%lf: %lf\n", delta, delta * 100 / mTimeOut); - return delta / mTimeOut; - } -}; - -// For Linux command line testing: -// compilation: -// g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -I. -I../../../../system/core/include -o LocHeap.o LocHeap.cpp -// g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -std=c++0x -I. -I../../../../system/core/include -lpthread -o LocThread.o LocThread.cpp -// g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -I. -I../../../../system/core/include -o LocTimer.o LocTimer.cpp -int main(int argc, char** argv) { - struct timespec timeOfStart=getNow(); - srand(time(NULL)); - int tries = atoi(argv[1]); - int checks = tries >> 3; - LocTimerTest** timerArray = new LocTimerTest*[tries]; - memset(timerArray, NULL, tries); - - for (int i = 0; i < tries; i++) { - int r = rand() % tries; - LocTimerTest* timer = new LocTimerTest(r); - if (timerArray[r]) { - if (!timer->stop()) { - printf("%lf:\n", getDeltaSeconds(timeOfStart, getNow())); - printf("ERRER: %dth timer, id %d, not running when it should be\n", i, r); - exit(0); - } else { - printf("stop() - %d\n", r); - delete timer; - timerArray[r] = NULL; - } - } else { - if (!timer->start(r, false)) { - printf("%lf:\n", getDeltaSeconds(timeOfStart, getNow())); - printf("ERRER: %dth timer, id %d, running when it should not be\n", i, r); - exit(0); - } else { - printf("stop() - %d\n", r); - timerArray[r] = timer; - } - } - } - - for (int i = 0; i < tries; i++) { - if (timerArray[i]) { - if (!timerArray[i]->stop()) { - printf("%lf:\n", getDeltaSeconds(timeOfStart, getNow())); - printf("ERRER: %dth timer, not running when it should be\n", i); - exit(0); - } else { - printf("stop() - %d\n", i); - delete timerArray[i]; - timerArray[i] = NULL; - } - } - } - - delete[] timerArray; - - return 0; -} - -#endif diff --git a/gps/utils/LocTimer.h b/gps/utils/LocTimer.h deleted file mode 100644 index c6a6362..0000000 --- a/gps/utils/LocTimer.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef __LOC_TIMER_CPP_H__ -#define __LOC_TIMER_CPP_H__ - -#include -#include - -// opaque class to provide service implementation. -class LocTimerDelegate; -class LocSharedLock; - -// LocTimer client must extend this class and implementthe callback. -// start() / stop() methods are to arm / disarm timer. -class LocTimer -{ - LocTimerDelegate* mTimer; - LocSharedLock* mLock; - // don't really want mLock to be manipulated by clients, yet LocTimer - // has to have a reference to the lock so that the delete of LocTimer - // and LocTimerDelegate can work together on their share resources. - friend class LocTimerDelegate; - -public: - LocTimer(); - virtual ~LocTimer(); - - // timeOutInMs: timeout delay in ms - // wakeOnExpire: true if to wake up CPU (if sleeping) upon timer - // expiration and notify the client. - // false if to wait until next time CPU wakes up (if - // sleeping) and then notify the client. - // return: true on success; - // false on failure, e.g. timer is already running. - bool start(uint32_t timeOutInMs, bool wakeOnExpire); - - // return: true on success; - // false on failure, e.g. timer is not running. - bool stop(); - - // LocTimer client Should implement this method. - // This method is used for timeout calling back to client. This method - // should be short enough (eg: send a message to your own thread). - virtual void timeOutCallback() = 0; -}; - -#endif //__LOC_DELAY_H__ diff --git a/gps/utils/Makefile.am b/gps/utils/Makefile.am deleted file mode 100644 index 50f1007..0000000 --- a/gps/utils/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -AM_CFLAGS = -Wundef \ - -MD \ - -Wno-trigraphs \ - -g -O0 \ - -fno-inline \ - -fno-short-enums \ - -fpic \ - -I./ \ - $(LOCPLA_CFLAGS) - -libgps_utils_so_la_h_sources = \ - msg_q.h \ - linked_list.h \ - loc_cfg.h \ - loc_log.h \ - loc_target.h \ - loc_timer.h \ - MsgTask.h \ - LocHeap.h \ - LocThread.h \ - LocTimer.h \ - loc_misc_utils.h - -libgps_utils_so_la_c_sources = \ - linked_list.c \ - msg_q.c \ - loc_cfg.cpp \ - loc_log.cpp \ - loc_target.cpp \ - LocHeap.cpp \ - LocTimer.cpp \ - LocThread.cpp \ - MsgTask.cpp \ - loc_misc_utils.cpp - -library_includedir = $(pkgincludedir)/utils - -library_include_HEADERS = $(libgps_utils_so_la_h_sources) - -libgps_utils_so_la_SOURCES = $(libgps_utils_so_la_c_sources) - -if USE_GLIB -libgps_utils_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libgps_utils_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libgps_utils_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libgps_utils_so_la_CFLAGS = $(AM_CFLAGS) -libgps_utils_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libgps_utils_so_la_LIBADD = -lstdc++ -llog $(LOCPLA_LIBS) - -#Create and Install libraries -lib_LTLIBRARIES = libgps_utils_so.la diff --git a/gps/utils/MsgTask.cpp b/gps/utils/MsgTask.cpp deleted file mode 100644 index 42079d7..0000000 --- a/gps/utils/MsgTask.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright (c) 2011-2013,2015 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_MsgTask" - -#include -#include -#include -#include -#include - -static void LocMsgDestroy(void* msg) { - delete (LocMsg*)msg; -} - -MsgTask::MsgTask(LocThread::tCreate tCreator, - const char* threadName, bool joinable) : - mQ(msg_q_init2()), mThread(new LocThread()) { - if (!mThread->start(tCreator, threadName, this, joinable)) { - delete mThread; - mThread = NULL; - } -} - -MsgTask::MsgTask(const char* threadName, bool joinable) : - mQ(msg_q_init2()), mThread(new LocThread()) { - if (!mThread->start(threadName, this, joinable)) { - delete mThread; - mThread = NULL; - } -} - -MsgTask::~MsgTask() { - msg_q_flush((void*)mQ); - msg_q_destroy((void**)&mQ); -} - -void MsgTask::destroy() { - LocThread* thread = mThread; - msg_q_unblock((void*)mQ); - if (thread) { - mThread = NULL; - delete thread; - } else { - delete this; - } -} - -void MsgTask::sendMsg(const LocMsg* msg) const { - msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); -} - -void MsgTask::prerun() { - // make sure we do not run in background scheduling group - platform_lib_abstraction_set_sched_policy(platform_lib_abstraction_gettid(), PLA_SP_FOREGROUND); -} - -bool MsgTask::run() { - LOC_LOGV("MsgTask::loop() listening ...\n"); - LocMsg* msg; - msq_q_err_type result = msg_q_rcv((void*)mQ, (void **)&msg); - if (eMSG_Q_SUCCESS != result) { - LOC_LOGE("%s:%d] fail receiving msg: %s\n", __func__, __LINE__, - loc_get_msg_q_status(result)); - return false; - } - - msg->log(); - // there is where each individual msg handling is invoked - msg->proc(); - - delete msg; - - return true; -} diff --git a/gps/utils/MsgTask.h b/gps/utils/MsgTask.h deleted file mode 100644 index 9eb1f56..0000000 --- a/gps/utils/MsgTask.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) 2011-2013,2015 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef __MSG_TASK__ -#define __MSG_TASK__ - -#include - -struct LocMsg { - inline LocMsg() {} - inline virtual ~LocMsg() {} - virtual void proc() const = 0; - inline virtual void log() const {} -}; - -class MsgTask : public LocRunnable { - const void* mQ; - LocThread* mThread; - friend class LocThreadDelegate; -protected: - virtual ~MsgTask(); -public: - MsgTask(LocThread::tCreate tCreator, const char* threadName = NULL, bool joinable = true); - MsgTask(const char* threadName = NULL, bool joinable = true); - // this obj will be deleted once thread is deleted - void destroy(); - void sendMsg(const LocMsg* msg) const; - // Overrides of LocRunnable methods - // This method will be repeated called until it returns false; or - // until thread is stopped. - virtual bool run(); - - // The method to be run before thread loop (conditionally repeatedly) - // calls run() - virtual void prerun(); - - // The method to be run after thread loop (conditionally repeatedly) - // calls run() - inline virtual void postrun() {} -}; - -#endif //__MSG_TASK__ diff --git a/gps/utils/linked_list.c b/gps/utils/linked_list.c deleted file mode 100644 index acec5b1..0000000 --- a/gps/utils/linked_list.c +++ /dev/null @@ -1,327 +0,0 @@ -/* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "linked_list.h" -#include -#include - -#define LOG_TAG "LocSvc_utils_ll" -#include -#include -#include - -typedef struct list_element { - struct list_element* next; - struct list_element* prev; - void* data_ptr; - void (*dealloc_func)(void*); -}list_element; - -typedef struct list_state { - list_element* p_head; - list_element* p_tail; -} list_state; - -/* ----------------------- END INTERNAL FUNCTIONS ---------------------------------------- */ - -/*=========================================================================== - - FUNCTION: linked_list_init - - ===========================================================================*/ -linked_list_err_type linked_list_init(void** list_data) -{ - if( list_data == NULL ) - { - LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); - return eLINKED_LIST_INVALID_PARAMETER; - } - - list_state* tmp_list; - tmp_list = (list_state*)calloc(1, sizeof(list_state)); - if( tmp_list == NULL ) - { - LOC_LOGE("%s: Unable to allocate space for list!\n", __FUNCTION__); - return eLINKED_LIST_FAILURE_GENERAL; - } - - tmp_list->p_head = NULL; - tmp_list->p_tail = NULL; - - *list_data = tmp_list; - - return eLINKED_LIST_SUCCESS; -} - -/*=========================================================================== - - FUNCTION: linked_list_destroy - - ===========================================================================*/ -linked_list_err_type linked_list_destroy(void** list_data) -{ - if( list_data == NULL ) - { - LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); - return eLINKED_LIST_INVALID_HANDLE; - } - - list_state* p_list = (list_state*)*list_data; - - linked_list_flush(p_list); - - free(*list_data); - *list_data = NULL; - - return eLINKED_LIST_SUCCESS; -} - -/*=========================================================================== - - FUNCTION: linked_list_add - - ===========================================================================*/ -linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*)) -{ - LOC_LOGV("%s: Adding to list data_obj = 0x%08X\n", __FUNCTION__, data_obj); - if( list_data == NULL ) - { - LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); - return eLINKED_LIST_INVALID_HANDLE; - } - - if( data_obj == NULL ) - { - LOC_LOGE("%s: Invalid input parameter!\n", __FUNCTION__); - return eLINKED_LIST_INVALID_PARAMETER; - } - - list_state* p_list = (list_state*)list_data; - list_element* elem = (list_element*)malloc(sizeof(list_element)); - if( elem == NULL ) - { - LOC_LOGE("%s: Memory allocation failed\n", __FUNCTION__); - return eLINKED_LIST_FAILURE_GENERAL; - } - - /* Copy data to newly created element */ - elem->data_ptr = data_obj; - elem->next = NULL; - elem->prev = NULL; - elem->dealloc_func = dealloc; - - /* Replace head element */ - list_element* tmp = p_list->p_head; - p_list->p_head = elem; - /* Point next to the previous head element */ - p_list->p_head->next = tmp; - - if( tmp != NULL ) - { - tmp->prev = p_list->p_head; - } - else - { - p_list->p_tail = p_list->p_head; - } - - return eLINKED_LIST_SUCCESS; -} - -/*=========================================================================== - - FUNCTION: linked_list_remove - - ===========================================================================*/ -linked_list_err_type linked_list_remove(void* list_data, void **data_obj) -{ - LOC_LOGV("%s: Removing from list\n", __FUNCTION__); - if( list_data == NULL ) - { - LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); - return eLINKED_LIST_INVALID_HANDLE; - } - - if( data_obj == NULL ) - { - LOC_LOGE("%s: Invalid input parameter!\n", __FUNCTION__); - return eLINKED_LIST_INVALID_PARAMETER; - } - - list_state* p_list = (list_state*)list_data; - if( p_list->p_tail == NULL ) - { - return eLINKED_LIST_UNAVAILABLE_RESOURCE; - } - - list_element* tmp = p_list->p_tail; - - /* Replace tail element */ - p_list->p_tail = tmp->prev; - - if( p_list->p_tail != NULL ) - { - p_list->p_tail->next = NULL; - } - else - { - p_list->p_head = p_list->p_tail; - } - - /* Copy data to output param */ - *data_obj = tmp->data_ptr; - - /* Free allocated list element */ - free(tmp); - - return eLINKED_LIST_SUCCESS; -} - -/*=========================================================================== - - FUNCTION: linked_list_empty - - ===========================================================================*/ -int linked_list_empty(void* list_data) -{ - if( list_data == NULL ) - { - LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); - return (int)eLINKED_LIST_INVALID_HANDLE; - } - else - { - list_state* p_list = (list_state*)list_data; - return p_list->p_head == NULL ? 1 : 0; - } -} - -/*=========================================================================== - - FUNCTION: linked_list_flush - - ===========================================================================*/ -linked_list_err_type linked_list_flush(void* list_data) -{ - if( list_data == NULL ) - { - LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); - return eLINKED_LIST_INVALID_HANDLE; - } - - list_state* p_list = (list_state*)list_data; - - /* Remove all dynamically allocated elements */ - while( p_list->p_head != NULL ) - { - list_element* tmp = p_list->p_head->next; - - /* Free data pointer if told to do so. */ - if( p_list->p_head->dealloc_func != NULL ) - { - p_list->p_head->dealloc_func(p_list->p_head->data_ptr); - } - - /* Free list element */ - free(p_list->p_head); - - p_list->p_head = tmp; - } - - p_list->p_tail = NULL; - - return eLINKED_LIST_SUCCESS; -} - -/*=========================================================================== - - FUNCTION: linked_list_search - - ===========================================================================*/ -linked_list_err_type linked_list_search(void* list_data, void **data_p, - bool (*equal)(void* data_0, void* data), - void* data_0, bool rm_if_found) -{ - LOC_LOGV("%s: Search the list\n", __FUNCTION__); - if( list_data == NULL || NULL == equal ) - { - LOC_LOGE("%s: Invalid list parameter! list_data %p equal %p\n", - __FUNCTION__, list_data, equal); - return eLINKED_LIST_INVALID_HANDLE; - } - - list_state* p_list = (list_state*)list_data; - if( p_list->p_tail == NULL ) - { - return eLINKED_LIST_UNAVAILABLE_RESOURCE; - } - - list_element* tmp = p_list->p_head; - - if (NULL != data_p) { - *data_p = NULL; - } - - while (NULL != tmp) { - if ((*equal)(data_0, tmp->data_ptr)) { - if (NULL != data_p) { - *data_p = tmp->data_ptr; - } - - if (rm_if_found) { - if (NULL == tmp->prev) { - p_list->p_head = tmp->next; - } else { - tmp->prev->next = tmp->next; - } - - if (NULL == tmp->next) { - p_list->p_tail = tmp->prev; - } else { - tmp->next->prev = tmp->prev; - } - - tmp->prev = tmp->next = NULL; - - // dealloc data if it is not copied out && caller - // has given us a dealloc function pointer. - if (NULL == data_p && NULL != tmp->dealloc_func) { - tmp->dealloc_func(tmp->data_ptr); - } - free(tmp); - } - - tmp = NULL; - } else { - tmp = tmp->next; - } - } - - return eLINKED_LIST_SUCCESS; -} - diff --git a/gps/utils/linked_list.h b/gps/utils/linked_list.h deleted file mode 100644 index a85f09a..0000000 --- a/gps/utils/linked_list.h +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef __LINKED_LIST_H__ -#define __LINKED_LIST_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -/** Linked List Return Codes */ -typedef enum -{ - eLINKED_LIST_SUCCESS = 0, - /**< Request was successful. */ - eLINKED_LIST_FAILURE_GENERAL = -1, - /**< Failed because of a general failure. */ - eLINKED_LIST_INVALID_PARAMETER = -2, - /**< Failed because the request contained invalid parameters. */ - eLINKED_LIST_INVALID_HANDLE = -3, - /**< Failed because an invalid handle was specified. */ - eLINKED_LIST_UNAVAILABLE_RESOURCE = -4, - /**< Failed because an there were not enough resources. */ - eLINKED_LIST_INSUFFICIENT_BUFFER = -5, - /**< Failed because an the supplied buffer was too small. */ -}linked_list_err_type; - -/*=========================================================================== -FUNCTION linked_list_init - -DESCRIPTION - Initializes internal structures for linked list. - - list_data: State of list to be initialized. - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -linked_list_err_type linked_list_init(void** list_data); - -/*=========================================================================== -FUNCTION linked_list_destroy - -DESCRIPTION - Destroys internal structures for linked list. - - p_list_data: State of list to be destroyed. - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -linked_list_err_type linked_list_destroy(void** list_data); - -/*=========================================================================== -FUNCTION linked_list_add - -DESCRIPTION - Adds an element to the head of the linked list. The passed in data pointer - is not modified or freed. Passed in data_obj is expected to live throughout - the use of the linked_list (i.e. data is not allocated internally) - - p_list_data: List to add data to the head of. - data_obj: Pointer to data to add into list - dealloc: Function used to deallocate memory for this element. Pass NULL - if you do not want data deallocated during a flush operation - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*)); - -/*=========================================================================== -FUNCTION linked_list_remove - -DESCRIPTION - Retrieves data from the list tail. data_obj is the tail element from the list - passed in by linked_list_add. - - p_list_data: List to remove the tail from. - data_obj: Pointer to data removed from list - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -linked_list_err_type linked_list_remove(void* list_data, void **data_obj); - -/*=========================================================================== -FUNCTION linked_list_empty - -DESCRIPTION - Tells whether the list currently contains any elements - - p_list_data: List to check if empty. - -DEPENDENCIES - N/A - -RETURN VALUE - 0/FALSE : List contains elements - 1/TRUE : List is Empty - Otherwise look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -int linked_list_empty(void* list_data); - -/*=========================================================================== -FUNCTION linked_list_flush - -DESCRIPTION - Removes all elements from the list and deallocates them using the provided - dealloc function while adding elements. - - p_list_data: List to remove all elements from. - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -linked_list_err_type linked_list_flush(void* list_data); - -/*=========================================================================== -FUNCTION linked_list_search - -DESCRIPTION - Searches for an element in the linked list. - - p_list_data: List handle. - data_p: to be stored with the data found; NUll if no match. - if data_p passed in as NULL, then no write to it. - equal: Function ptr takes in a list element, and returns - indication if this the one looking for. - data_0: The data being compared against. - rm_if_found: Should data be removed if found? - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -linked_list_err_type linked_list_search(void* list_data, void **data_p, - bool (*equal)(void* data_0, void* data), - void* data_0, bool rm_if_found); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LINKED_LIST_H__ */ diff --git a/gps/utils/loc_cfg.cpp b/gps/utils/loc_cfg.cpp deleted file mode 100644 index 926781a..0000000 --- a/gps/utils/loc_cfg.cpp +++ /dev/null @@ -1,400 +0,0 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_utils_cfg" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef USE_GLIB -#include -#endif -#include "platform_lib_includes.h" - -/*============================================================================= - * - * GLOBAL DATA DECLARATION - * - *============================================================================*/ - -/* Parameter data */ -static uint32_t DEBUG_LEVEL = 0xff; -static uint32_t TIMESTAMP = 0; - -/* Parameter spec table */ -static const loc_param_s_type loc_param_table[] = -{ - {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, - {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, -}; -static const int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); - -typedef struct loc_param_v_type -{ - char* param_name; - char* param_str_value; - int param_int_value; - double param_double_value; -}loc_param_v_type; - -/*=========================================================================== -FUNCTION loc_set_config_entry - -DESCRIPTION - Potentially sets a given configuration table entry based on the passed in - configuration value. This is done by using a string comparison of the - parameter names and those found in the configuration file. - -PARAMETERS: - config_entry: configuration entry in the table to possibly set - config_value: value to store in the entry if the parameter names match - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ -int loc_set_config_entry(const loc_param_s_type* config_entry, loc_param_v_type* config_value) -{ - int ret=-1; - if(NULL == config_entry || NULL == config_value) - { - LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__); - return ret; - } - - if (strcmp(config_entry->param_name, config_value->param_name) == 0 && - config_entry->param_ptr) - { - switch (config_entry->param_type) - { - case 's': - if (strcmp(config_value->param_str_value, "NULL") == 0) - { - *((char*)config_entry->param_ptr) = '\0'; - } - else { - strlcpy((char*) config_entry->param_ptr, - config_value->param_str_value, - LOC_MAX_PARAM_STRING + 1); - } - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, - config_entry->param_name, (char*)config_entry->param_ptr); - - if(NULL != config_entry->param_set) - { - *(config_entry->param_set) = 1; - } - ret = 0; - break; - case 'n': - *((int *)config_entry->param_ptr) = config_value->param_int_value; - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, - config_entry->param_name, config_value->param_int_value); - - if(NULL != config_entry->param_set) - { - *(config_entry->param_set) = 1; - } - ret = 0; - break; - case 'f': - *((double *)config_entry->param_ptr) = config_value->param_double_value; - /* Log INI values */ - LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, - config_entry->param_name, config_value->param_double_value); - - if(NULL != config_entry->param_set) - { - *(config_entry->param_set) = 1; - } - ret = 0; - break; - default: - LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", - __FUNCTION__, config_entry->param_name); - } - } - return ret; -} - -/*=========================================================================== -FUNCTION loc_fill_conf_item - -DESCRIPTION - Takes a line of configuration item and sets defined values based on - the passed in configuration table. This table maps strings to values to - set along with the type of each of these values. - -PARAMETERS: - input_buf : buffer contanis config item - config_table: table definition of strings to places to store information - table_length: length of the configuration table - -DEPENDENCIES - N/A - -RETURN VALUE - 0: Number of records in the config_table filled with input_buf - -SIDE EFFECTS - N/A -===========================================================================*/ -int loc_fill_conf_item(char* input_buf, - const loc_param_s_type* config_table, uint32_t table_length) -{ - int ret = 0; - - if (input_buf && config_table) { - char *lasts; - loc_param_v_type config_value; - memset(&config_value, 0, sizeof(config_value)); - - /* Separate variable and value */ - config_value.param_name = strtok_r(input_buf, "=", &lasts); - /* skip lines that do not contain "=" */ - if (config_value.param_name) { - config_value.param_str_value = strtok_r(NULL, "=", &lasts); - - /* skip lines that do not contain two operands */ - if (config_value.param_str_value) { - /* Trim leading and trailing spaces */ - loc_util_trim_space(config_value.param_name); - loc_util_trim_space(config_value.param_str_value); - - /* Parse numerical value */ - if ((strlen(config_value.param_str_value) >=3) && - (config_value.param_str_value[0] == '0') && - (tolower(config_value.param_str_value[1]) == 'x')) - { - /* hex */ - config_value.param_int_value = (int) strtol(&config_value.param_str_value[2], - (char**) NULL, 16); - } - else { - config_value.param_double_value = (double) atof(config_value.param_str_value); /* float */ - config_value.param_int_value = atoi(config_value.param_str_value); /* dec */ - } - - for(uint32_t i = 0; NULL != config_table && i < table_length; i++) - { - if(!loc_set_config_entry(&config_table[i], &config_value)) { - ret += 1; - } - } - } - } - } - - return ret; -} - -/*=========================================================================== -FUNCTION loc_read_conf_r (repetitive) - -DESCRIPTION - Reads the specified configuration file and sets defined values based on - the passed in configuration table. This table maps strings to values to - set along with the type of each of these values. - The difference between this and loc_read_conf is that this function returns - the file pointer position at the end of filling a config table. Also, it - reads a fixed number of parameters at a time which is equal to the length - of the configuration table. This functionality enables the caller to - repeatedly call the function to read data from the same file. - -PARAMETERS: - conf_fp : file pointer - config_table: table definition of strings to places to store information - table_length: length of the configuration table - -DEPENDENCIES - N/A - -RETURN VALUE - 0: Table filled successfully - 1: No more parameters to read - -1: Error filling table - -SIDE EFFECTS - N/A -===========================================================================*/ -int loc_read_conf_r(FILE *conf_fp, const loc_param_s_type* config_table, uint32_t table_length) -{ - int ret=0; - - unsigned int num_params=table_length; - if(conf_fp == NULL) { - LOC_LOGE("%s:%d]: ERROR: File pointer is NULL\n", __func__, __LINE__); - ret = -1; - goto err; - } - - /* Clear all validity bits */ - for(uint32_t i = 0; NULL != config_table && i < table_length; i++) - { - if(NULL != config_table[i].param_set) - { - *(config_table[i].param_set) = 0; - } - } - - char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ - - LOC_LOGD("%s:%d]: num_params: %d\n", __func__, __LINE__, num_params); - while(num_params) - { - if(!fgets(input_buf, LOC_MAX_PARAM_LINE, conf_fp)) { - LOC_LOGD("%s:%d]: fgets returned NULL\n", __func__, __LINE__); - break; - } - - num_params -= loc_fill_conf_item(input_buf, config_table, table_length); - } - -err: - return ret; -} - -/*=========================================================================== -FUNCTION loc_udpate_conf - -DESCRIPTION - Parses the passed in buffer for configuration items, and update the table - that is also passed in. - -Reads the specified configuration file and sets defined values based on - the passed in configuration table. This table maps strings to values to - set along with the type of each of these values. - -PARAMETERS: - conf_data: configuration items in bufferas a string - length: strlen(conf_data) - config_table: table definition of strings to places to store information - table_length: length of the configuration table - -DEPENDENCIES - N/A - -RETURN VALUE - number of the records in the table that is updated at time of return. - -SIDE EFFECTS - N/A -===========================================================================*/ -int loc_update_conf(const char* conf_data, int32_t length, - const loc_param_s_type* config_table, uint32_t table_length) -{ - int ret = -1; - - if (conf_data && length && config_table && table_length) { - // make a copy, so we do not tokenize the original data - char* conf_copy = (char*)malloc(length+1); - - if (conf_copy != NULL) - { - memcpy(conf_copy, conf_data, length); - // we hard NULL the end of string to be safe - conf_copy[length] = 0; - - // start with one record off - uint32_t num_params = table_length - 1; - char* saveptr = NULL; - char* input_buf = strtok_r(conf_copy, "\n", &saveptr); - ret = 0; - - LOC_LOGD("%s:%d]: num_params: %d\n", __func__, __LINE__, num_params); - while(num_params && input_buf) { - ret++; - num_params -= loc_fill_conf_item(input_buf, config_table, table_length); - input_buf = strtok_r(NULL, "\n", &saveptr); - } - free(conf_copy); - } - } - - return ret; -} - -/*=========================================================================== -FUNCTION loc_read_conf - -DESCRIPTION - Reads the specified configuration file and sets defined values based on - the passed in configuration table. This table maps strings to values to - set along with the type of each of these values. - -PARAMETERS: - conf_file_name: configuration file to read - config_table: table definition of strings to places to store information - table_length: length of the configuration table - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ -void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_table, - uint32_t table_length) -{ - FILE *conf_fp = NULL; - char *lasts; - loc_param_v_type config_value; - uint32_t i; - - if((conf_fp = fopen(conf_file_name, "r")) != NULL) - { - LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name); - if(table_length && config_table) { - loc_read_conf_r(conf_fp, config_table, table_length); - rewind(conf_fp); - } - loc_read_conf_r(conf_fp, loc_param_table, loc_param_num); - fclose(conf_fp); - } - /* Initialize logging mechanism with parsed data */ - loc_logger_init(DEBUG_LEVEL, TIMESTAMP); -} diff --git a/gps/utils/loc_cfg.h b/gps/utils/loc_cfg.h deleted file mode 100644 index 9045e1d..0000000 --- a/gps/utils/loc_cfg.h +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_CFG_H -#define LOC_CFG_H - -#include -#include - -#define LOC_MAX_PARAM_NAME 80 -#define LOC_MAX_PARAM_STRING 80 -#define LOC_MAX_PARAM_LINE (LOC_MAX_PARAM_NAME + LOC_MAX_PARAM_STRING) - -#define UTIL_UPDATE_CONF(conf_data, len, config_table) \ - loc_update_conf((conf_data), (len), (config_table), \ - sizeof(config_table) / sizeof(config_table[0])) - -#define UTIL_READ_CONF_DEFAULT(filename) \ - loc_read_conf((filename), NULL, 0); - -#define UTIL_READ_CONF(filename, config_table) \ - loc_read_conf((filename), (config_table), sizeof(config_table) / sizeof(config_table[0])) - -/*============================================================================= - * - * MODULE TYPE DECLARATION - * - *============================================================================*/ -typedef struct -{ - const char *param_name; - void *param_ptr; - uint8_t *param_set; /* was this value set by config file? */ - char param_type; /* 'n' for number, - 's' for string, - 'f' for float */ -} loc_param_s_type; - -/*============================================================================= - * - * MODULE EXTERNAL DATA - * - *============================================================================*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*============================================================================= - * - * MODULE EXPORTED FUNCTIONS - * - *============================================================================*/ -void loc_read_conf(const char* conf_file_name, - const loc_param_s_type* config_table, - uint32_t table_length); -int loc_read_conf_r(FILE *conf_fp, const loc_param_s_type* config_table, - uint32_t table_length); -int loc_update_conf(const char* conf_data, int32_t length, - const loc_param_s_type* config_table, uint32_t table_length); -#ifdef __cplusplus -} -#endif - -#endif /* LOC_CFG_H */ diff --git a/gps/utils/loc_log.cpp b/gps/utils/loc_log.cpp deleted file mode 100644 index f6b54f9..0000000 --- a/gps/utils/loc_log.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/* Copyright (c) 2011-2012, 2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#define LOG_NDDEBUG 0 - -#include -#include -#include -#include "loc_log.h" -#include "msg_q.h" -#include - -#define BUFFER_SIZE 120 - -// Logging Improvements -const char *loc_logger_boolStr[]={"False","True"}; -const char VOID_RET[] = "None"; -const char FROM_AFW[] = "===>"; -const char TO_MODEM[] = "--->"; -const char FROM_MODEM[] = "<---"; -const char TO_AFW[] = "<==="; -const char EXIT_TAG[] = "Exiting"; -const char ENTRY_TAG[] = "Entering"; -const char EXIT_ERROR_TAG[] = "Exiting with error"; - -/* Logging Mechanism */ -loc_logger_s_type loc_logger; - -/* Get names from value */ -const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask) -{ - size_t i; - for (i = 0; i < table_size; i++) - { - if (table[i].val & (long) mask) - { - return table[i].name; - } - } - return UNKNOWN_STR; -} - -/* Get names from value */ -const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value) -{ - size_t i; - for (i = 0; i < table_size; i++) - { - if (table[i].val == (long) value) - { - return table[i].name; - } - } - return UNKNOWN_STR; -} - -static const loc_name_val_s_type loc_msg_q_status[] = -{ - NAME_VAL( eMSG_Q_SUCCESS ), - NAME_VAL( eMSG_Q_FAILURE_GENERAL ), - NAME_VAL( eMSG_Q_INVALID_PARAMETER ), - NAME_VAL( eMSG_Q_INVALID_HANDLE ), - NAME_VAL( eMSG_Q_UNAVAILABLE_RESOURCE ), - NAME_VAL( eMSG_Q_INSUFFICIENT_BUFFER ) -}; -static const size_t loc_msg_q_status_num = LOC_TABLE_SIZE(loc_msg_q_status); - -/* Find msg_q status name */ -const char* loc_get_msg_q_status(int status) -{ - return loc_get_name_from_val(loc_msg_q_status, loc_msg_q_status_num, (long) status); -} - -const char* log_succ_fail_string(int is_succ) -{ - return is_succ? "successful" : "failed"; -} - -//Target names -static const loc_name_val_s_type target_name[] = -{ - NAME_VAL(GNSS_NONE), - NAME_VAL(GNSS_MSM), - NAME_VAL(GNSS_GSS), - NAME_VAL(GNSS_MDM), - NAME_VAL(GNSS_QCA1530), - NAME_VAL(GNSS_AUTO), - NAME_VAL(GNSS_UNKNOWN) -}; - -static const size_t target_name_num = LOC_TABLE_SIZE(target_name); - -/*=========================================================================== - -FUNCTION loc_get_target_name - -DESCRIPTION - Returns pointer to a string that contains name of the target - - XX:XX:XX.000\0 - -RETURN VALUE - The target name string - -===========================================================================*/ -const char *loc_get_target_name(unsigned int target) -{ - int index = 0; - static char ret[BUFFER_SIZE]; - - index = getTargetGnssType(target); - if( index < 0 || (unsigned)index >= target_name_num ) - index = target_name_num - 1; - - if( (target & HAS_SSC) == HAS_SSC ) { - snprintf(ret, sizeof(ret), " %s with SSC", - loc_get_name_from_val(target_name, target_name_num, (long)index) ); - } - else { - snprintf(ret, sizeof(ret), " %s without SSC", - loc_get_name_from_val(target_name, target_name_num, (long)index) ); - } - return ret; -} - - -/*=========================================================================== - -FUNCTION loc_get_time - -DESCRIPTION - Logs a callback event header. - The pointer time_string should point to a buffer of at least 13 bytes: - - XX:XX:XX.000\0 - -RETURN VALUE - The time string - -===========================================================================*/ -char *loc_get_time(char *time_string, size_t buf_size) -{ - struct timeval now; /* sec and usec */ - struct tm now_tm; /* broken-down time */ - char hms_string[80]; /* HH:MM:SS */ - - gettimeofday(&now, NULL); - localtime_r(&now.tv_sec, &now_tm); - - strftime(hms_string, sizeof hms_string, "%H:%M:%S", &now_tm); - snprintf(time_string, buf_size, "%s.%03d", hms_string, (int) (now.tv_usec / 1000)); - - return time_string; -} - - -/*=========================================================================== -FUNCTION loc_logger_init - -DESCRIPTION - Initializes the state of DEBUG_LEVEL and TIMESTAMP - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ -void loc_logger_init(unsigned long debug, unsigned long timestamp) -{ - loc_logger.DEBUG_LEVEL = debug; -#ifdef TARGET_BUILD_VARIANT_USER - // force user builds to 2 or less - if (loc_logger.DEBUG_LEVEL > 2) { - loc_logger.DEBUG_LEVEL = 2; - } -#endif - loc_logger.TIMESTAMP = timestamp; -} - - -/*=========================================================================== -FUNCTION get_timestamp - -DESCRIPTION - Generates a timestamp using the current system time - -DEPENDENCIES - N/A - -RETURN VALUE - Char pointer to the parameter str - -SIDE EFFECTS - N/A -===========================================================================*/ -char * get_timestamp(char *str, unsigned long buf_size) -{ - struct timeval tv; - struct timezone tz; - int hh, mm, ss; - gettimeofday(&tv, &tz); - hh = tv.tv_sec/3600%24; - mm = (tv.tv_sec%3600)/60; - ss = tv.tv_sec%60; - snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec); - return str; -} - diff --git a/gps/utils/loc_log.h b/gps/utils/loc_log.h deleted file mode 100644 index be492b1..0000000 --- a/gps/utils/loc_log.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (c) 2011-2012, 2015 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef LOC_LOG_H -#define LOC_LOG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include -#include "loc_target.h" - -typedef struct -{ - const char *name; - long val; -} loc_name_val_s_type; - -#define NAME_VAL(x) {"" #x "", x } - -#define UNKNOWN_STR "UNKNOWN" - -#define CHECK_MASK(type, value, mask_var, mask) \ - (((mask_var) & (mask)) ? (type) (value) : (type) (-1)) - -#define LOC_TABLE_SIZE(table) (sizeof(table)/sizeof((table)[0])) - -/* Get names from value */ -const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask); -const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value); -const char* loc_get_msg_q_status(int status); -const char* loc_get_target_name(unsigned int target); - -extern const char* log_succ_fail_string(int is_succ); - -extern char *loc_get_time(char *time_string, size_t buf_size); - -#ifdef __cplusplus -} -#endif - -#endif /* LOC_LOG_H */ diff --git a/gps/utils/loc_misc_utils.cpp b/gps/utils/loc_misc_utils.cpp deleted file mode 100644 index dfe19a2..0000000 --- a/gps/utils/loc_misc_utils.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include -#include -#include -#include -#include - -#define LOG_NDDEBUG 0 -#define LOG_TAG "LocSvc_misc_utils" - -int loc_util_split_string(char *raw_string, char **split_strings_ptr, - int max_num_substrings, char delimiter) -{ - int raw_string_index=0; - int num_split_strings=0; - unsigned char end_string=0; - int raw_string_length=0; - - if(!raw_string || !split_strings_ptr) { - LOC_LOGE("%s:%d]: NULL parameters", __func__, __LINE__); - num_split_strings = -1; - goto err; - } - LOC_LOGD("%s:%d]: raw string: %s\n", __func__, __LINE__, raw_string); - raw_string_length = strlen(raw_string) + 1; - split_strings_ptr[num_split_strings] = &raw_string[raw_string_index]; - for(raw_string_index=0; raw_string_index < raw_string_length; raw_string_index++) { - if(raw_string[raw_string_index] == '\0') - end_string=1; - if((raw_string[raw_string_index] == delimiter) || end_string) { - raw_string[raw_string_index] = '\0'; - LOC_LOGD("%s:%d]: split string: %s\n", - __func__, __LINE__, split_strings_ptr[num_split_strings]); - num_split_strings++; - if(((raw_string_index + 1) < raw_string_length) && - (num_split_strings < max_num_substrings)) { - split_strings_ptr[num_split_strings] = &raw_string[raw_string_index+1]; - } - else { - break; - } - } - if(end_string) - break; - } -err: - LOC_LOGD("%s:%d]: num_split_strings: %d\n", __func__, __LINE__, num_split_strings); - return num_split_strings; -} - -void loc_util_trim_space(char *org_string) -{ - char *scan_ptr, *write_ptr; - char *first_nonspace = NULL, *last_nonspace = NULL; - - if(org_string == NULL) { - LOC_LOGE("%s:%d]: NULL parameter", __func__, __LINE__); - goto err; - } - - scan_ptr = write_ptr = org_string; - - while (*scan_ptr) { - //Find the first non-space character - if ( !isspace(*scan_ptr) && first_nonspace == NULL) { - first_nonspace = scan_ptr; - } - //Once the first non-space character is found in the - //above check, keep shifting the characters to the left - //to replace the spaces - if (first_nonspace != NULL) { - *(write_ptr++) = *scan_ptr; - //Keep track of which was the last non-space character - //encountered - //last_nonspace will not be updated in the case where - //the string ends with spaces - if ( !isspace(*scan_ptr)) { - last_nonspace = write_ptr; - } - } - scan_ptr++; - } - //Add NULL terminator after the last non-space character - if (last_nonspace) { *last_nonspace = '\0'; } -err: - return; -} diff --git a/gps/utils/loc_misc_utils.h b/gps/utils/loc_misc_utils.h deleted file mode 100644 index 7d66d84..0000000 --- a/gps/utils/loc_misc_utils.h +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef _LOC_MISC_UTILS_H_ -#define _LOC_MISC_UTILS_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/*=========================================================================== -FUNCTION loc_split_string - -DESCRIPTION: - This function is used to split a delimiter separated string into - sub-strings. This function does not allocate new memory to store the split - strings. Instead, it places '\0' in places of delimiters and assings the - starting address of the substring within the raw string as the string address - The input raw_string no longer remains to be a collection of sub-strings - after this function is executed. - Please make a copy of the input string before calling this function if - necessary - -PARAMETERS: - char *raw_string: is the original string with delimiter separated substrings - char **split_strings_ptr: is the arraw of pointers which will hold the addresses - of individual substrings - int max_num_substrings: is the maximum number of substrings that are expected - by the caller. The array of pointers in the above parameter - is usually this long - char delimiter: is the delimiter that separates the substrings. Examples: ' ', ';' - -DEPENDENCIES - N/A - -RETURN VALUE - int Number of split strings - -SIDE EFFECTS - The input raw_string no longer remains a delimiter separated single string. - -EXAMPLE - delimiter = ' ' //space - raw_string = "hello new user" //delimiter is space ' ' - addresses = 0123456789abcd - split_strings_ptr[0] = &raw_string[0]; //split_strings_ptr[0] contains "hello" - split_strings_ptr[1] = &raw_string[6]; //split_strings_ptr[1] contains "new" - split_strings_ptr[2] = &raw_string[a]; //split_strings_ptr[2] contains "user" - -===========================================================================*/ -int loc_util_split_string(char *raw_string, char **split_strings_ptr, int max_num_substrings, - char delimiter); - -/*=========================================================================== -FUNCTION trim_space - -DESCRIPTION - Removes leading and trailing spaces of the string - -DEPENDENCIES - N/A - -RETURN VALUE - None - -SIDE EFFECTS - N/A -===========================================================================*/ -void loc_util_trim_space(char *org_string); -#ifdef __cplusplus -} -#endif - -#endif //_LOC_MISC_UTILS_H_ diff --git a/gps/utils/loc_target.cpp b/gps/utils/loc_target.cpp deleted file mode 100644 index 2da2fea..0000000 --- a/gps/utils/loc_target.cpp +++ /dev/null @@ -1,287 +0,0 @@ -/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "loc_target.h" -#include "loc_log.h" -#include - -#define APQ8064_ID_1 "109" -#define APQ8064_ID_2 "153" -#define MPQ8064_ID_1 "130" -#define MSM8930_ID_1 "142" -#define MSM8930_ID_2 "116" -#define APQ8030_ID_1 "157" -#define APQ8074_ID_1 "184" - -#define LINE_LEN 100 -#define STR_LIQUID "Liquid" -#define STR_SURF "Surf" -#define STR_MTP "MTP" -#define STR_APQ "apq" -#define STR_APQ_NO_WGR "baseband_apq_nowgr" -#define STR_AUTO "auto" -#define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') -#define LENGTH(s) (sizeof(s) - 1) -#define GPS_CHECK_NO_ERROR 0 -#define GPS_CHECK_NO_GPS_HW 1 -/* When system server is started, it uses 20 seconds as ActivityManager - * timeout. After that it sends SIGSTOP signal to process. - */ -#define QCA1530_DETECT_TIMEOUT 15 -#define QCA1530_DETECT_PRESENT "yes" -#define QCA1530_DETECT_PROGRESS "detect" - -static unsigned int gTarget = (unsigned int)-1; - -static int read_a_line(const char * file_path, char * line, int line_size) -{ - FILE *fp; - int result = 0; - - * line = '\0'; - fp = fopen(file_path, "r" ); - if( fp == NULL ) { - LOC_LOGE("open failed: %s: %s\n", file_path, strerror(errno)); - result = -1; - } else { - int len; - fgets(line, line_size, fp); - len = strlen(line); - len = len < line_size - 1? len : line_size - 1; - line[len] = '\0'; - LOC_LOGD("cat %s: %s", file_path, line); - fclose(fp); - } - return result; -} - -/*! - * \brief Checks if QCA1530 is avalable. - * - * Function verifies if qca1530 SoC is configured on the device. The test is - * based on property value. For 1530 scenario, the value shall be one of the - * following: "yes", "no", "detect". All other values are treated equally to - * "no". When the value is "detect" the system waits for SoC detection to - * finish before returning result. - * - * \retval true - QCA1530 is available. - * \retval false - QCA1530 is not available. - */ -static bool is_qca1530(void) -{ - static const char qca1530_property_name[] = "sys.qca1530"; - bool res = false; - int ret, i; - char buf[PROPERTY_VALUE_MAX]; - - memset(buf, 0, sizeof(buf)); - - for (i = 0; i < QCA1530_DETECT_TIMEOUT; ++i) - { - ret = platform_lib_abstraction_property_get(qca1530_property_name, buf, NULL); - if (ret < 0) - { - LOC_LOGV( "qca1530: property %s is not accessible, ret=%d", - qca1530_property_name, - ret); - - break; - } - - LOC_LOGV( "qca1530: property %s is set to %s", - qca1530_property_name, - buf); - - if (!memcmp(buf, QCA1530_DETECT_PRESENT, - sizeof(QCA1530_DETECT_PRESENT))) - { - res = true; - break; - } - if (!memcmp(buf, QCA1530_DETECT_PROGRESS, - sizeof(QCA1530_DETECT_PROGRESS))) - { - LOC_LOGV("qca1530: SoC detection is in progress."); - sleep(1); - continue; - } - break; - } - - LOC_LOGD("qca1530: detected=%s", res ? "true" : "false"); - return res; -} - -/*The character array passed to this function should have length - of atleast PROPERTY_VALUE_MAX*/ -void loc_get_target_baseband(char *baseband, int array_length) -{ - if(baseband && (array_length >= PROPERTY_VALUE_MAX)) { - property_get("ro.baseband", baseband, ""); - LOC_LOGD("%s:%d]: Baseband: %s\n", __func__, __LINE__, baseband); - } - else { - LOC_LOGE("%s:%d]: NULL parameter or array length less than PROPERTY_VALUE_MAX\n", - __func__, __LINE__); - } -} - -/*The character array passed to this function should have length - of atleast PROPERTY_VALUE_MAX*/ -void loc_get_platform_name(char *platform_name, int array_length) -{ - if(platform_name && (array_length >= PROPERTY_VALUE_MAX)) { - property_get("ro.board.platform", platform_name, ""); - LOC_LOGD("%s:%d]: Target name: %s\n", __func__, __LINE__, platform_name); - } - else { - LOC_LOGE("%s:%d]: Null parameter or array length less than PROPERTY_VALUE_MAX\n", - __func__, __LINE__); - } -} - -/*The character array passed to this function should have length - of atleast PROPERTY_VALUE_MAX*/ -void loc_get_auto_platform_name(char *platform_name, int array_length) -{ - if(platform_name && (array_length >= PROPERTY_VALUE_MAX)) { - property_get("ro.hardware.type", platform_name, ""); - LOC_LOGD("%s:%d]: Autoplatform name: %s\n", __func__, __LINE__, platform_name); - } - else { - LOC_LOGE("%s:%d]: Null parameter or array length less than PROPERTY_VALUE_MAX\n", - __func__, __LINE__); - } -} - -unsigned int loc_get_target(void) -{ - if (gTarget != (unsigned int)-1) - return gTarget; - - static const char hw_platform[] = "/sys/devices/soc0/hw_platform"; - static const char id[] = "/sys/devices/soc0/soc_id"; - static const char hw_platform_dep[] = - "/sys/devices/system/soc/soc0/hw_platform"; - static const char id_dep[] = "/sys/devices/system/soc/soc0/id"; - static const char mdm[] = "/dev/mdm"; // No such file or directory - - char rd_hw_platform[LINE_LEN]; - char rd_id[LINE_LEN]; - char rd_mdm[LINE_LEN]; - char baseband[LINE_LEN]; - char rd_auto_platform[LINE_LEN]; - - if (is_qca1530()) { - gTarget = TARGET_QCA1530; - goto detected; - } - - loc_get_target_baseband(baseband, sizeof(baseband)); - - if (!access(hw_platform, F_OK)) { - read_a_line(hw_platform, rd_hw_platform, LINE_LEN); - } else { - read_a_line(hw_platform_dep, rd_hw_platform, LINE_LEN); - } - if (!access(id, F_OK)) { - read_a_line(id, rd_id, LINE_LEN); - } else { - read_a_line(id_dep, rd_id, LINE_LEN); - } - - /*check automotive platform*/ - loc_get_auto_platform_name(rd_auto_platform, sizeof(rd_auto_platform)); - if( !memcmp(rd_auto_platform, STR_AUTO, LENGTH(STR_AUTO)) ) - { - gTarget = TARGET_AUTO; - goto detected; - } - - if( !memcmp(baseband, STR_APQ_NO_WGR, LENGTH(STR_APQ_NO_WGR)) ){ - - gTarget = TARGET_NO_GNSS; - goto detected; - } - - if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ - - if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) - && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) - gTarget = TARGET_NO_GNSS; - else - gTarget = TARGET_APQ_SA; - } - else { - if( (!memcmp(rd_hw_platform, STR_LIQUID, LENGTH(STR_LIQUID)) - && IS_STR_END(rd_hw_platform[LENGTH(STR_LIQUID)])) || - (!memcmp(rd_hw_platform, STR_SURF, LENGTH(STR_SURF)) - && IS_STR_END(rd_hw_platform[LENGTH(STR_SURF)])) || - (!memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) - && IS_STR_END(rd_hw_platform[LENGTH(STR_MTP)]))) { - - if (!read_a_line( mdm, rd_mdm, LINE_LEN)) - gTarget = TARGET_MDM; - } - else if( (!memcmp(rd_id, MSM8930_ID_1, LENGTH(MSM8930_ID_1)) - && IS_STR_END(rd_id[LENGTH(MSM8930_ID_1)])) || - (!memcmp(rd_id, MSM8930_ID_2, LENGTH(MSM8930_ID_2)) - && IS_STR_END(rd_id[LENGTH(MSM8930_ID_2)])) ) - gTarget = TARGET_MSM_NO_SSC; - else - gTarget = TARGET_UNKNOWN; - } - -detected: - LOC_LOGD("HAL: %s returned %d", __FUNCTION__, gTarget); - return gTarget; -} - -/*Reads the property ro.lean to identify if this is a lean target - Returns: - 0 if not a lean and mean target - 1 if this is a lean and mean target -*/ -int loc_identify_lean_target() -{ - int ret = 0; - char lean_target[PROPERTY_VALUE_MAX]; - property_get("ro.lean", lean_target, ""); - LOC_LOGD("%s:%d]: lean target: %s\n", __func__, __LINE__, lean_target); - return !(strncmp(lean_target, "true", PROPERTY_VALUE_MAX)); -} diff --git a/gps/utils/loc_target.h b/gps/utils/loc_target.h deleted file mode 100644 index 69395db..0000000 --- a/gps/utils/loc_target.h +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef LOC_TARGET_H -#define LOC_TARGET_H -#define TARGET_SET(gnss,ssc) ( (gnss<<1)|ssc ) -#define TARGET_DEFAULT TARGET_SET(GNSS_MSM, HAS_SSC) -#define TARGET_MDM TARGET_SET(GNSS_MDM, HAS_SSC) -#define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC) -#define TARGET_NO_GNSS TARGET_SET(GNSS_NONE, NO_SSC) -#define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) -#define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC) -#define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC) -#define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) -#define getTargetGnssType(target) (target>>1) - -#ifdef __cplusplus -extern "C" -{ -#endif - -unsigned int loc_get_target(void); - -/*The character array passed to this function should have length - of atleast PROPERTY_VALUE_MAX*/ -void loc_get_target_baseband(char *baseband, int array_length); -/*The character array passed to this function should have length - of atleast PROPERTY_VALUE_MAX*/ -void loc_get_platform_name(char *platform_name, int array_length); -/*The character array passed to this function should have length - of atleast PROPERTY_VALUE_MAX*/ -void loc_get_auto_platform_name(char *platform_name, int array_length); - -/*Reads the property ro.lean to identify if this is a lean target - Returns: - 0 if not a lean and mean target - 1 if this is a lean and mean target*/ -int loc_identify_lean_target(); - -/* Please remember to update 'target_name' in loc_log.cpp, - if do any changes to this enum. */ -typedef enum { - GNSS_NONE = 0, - GNSS_MSM, - GNSS_GSS, - GNSS_MDM, - GNSS_QCA1530, - GNSS_AUTO, - GNSS_UNKNOWN -}GNSS_TARGET; - -typedef enum { - NO_SSC = 0, - HAS_SSC -}SSC_TYPE; - -#ifdef __cplusplus -} -#endif - -#endif /*LOC_TARGET_H*/ diff --git a/gps/utils/loc_timer.h b/gps/utils/loc_timer.h deleted file mode 100644 index 25fd179..0000000 --- a/gps/utils/loc_timer.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (c) 2013,2015 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef __LOC_DELAY_H__ -#define __LOC_DELAY_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -#include -#include -/* - user_data: client context pointer, passthrough. Originally received - from calling client when loc_timer_start() is called. - result: 0 if timer successfully timed out; else timer failed. -*/ -typedef void (*loc_timer_callback)(void *user_data, int32_t result); - - -/* - delay_msec: timeout value for the timer. - cb_func: callback function pointer, implemented by client. - Can not be NULL. - user_data: client context pointer, passthrough. Will be - returned when loc_timer_callback() is called. - wakeOnExpire: true if to wake up CPU (if sleeping) upon timer - expiration and notify the client. - false if to wait until next time CPU wakes up (if - sleeping) and then notify the client. - Returns the handle, which can be used to stop the timer - NULL, if timer start fails (e.g. if cb_func is NULL). -*/ -void* loc_timer_start(uint64_t delay_msec, - loc_timer_callback cb_func, - void *user_data, - bool wake_on_expire=false); - -/* - handle becomes invalid upon the return of the callback -*/ -void loc_timer_stop(void*& handle); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif //__LOC_DELAY_H__ diff --git a/gps/utils/log_util.h b/gps/utils/log_util.h deleted file mode 100644 index d27c800..0000000 --- a/gps/utils/log_util.h +++ /dev/null @@ -1,195 +0,0 @@ -/* Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef __LOG_UTIL_H__ -#define __LOG_UTIL_H__ - -#ifndef USE_GLIB -#include -#endif /* USE_GLIB */ - -#ifdef USE_GLIB - -#include -#include -#include - -#ifndef LOG_TAG -#define LOG_TAG "GPS_UTILS" - -#endif // LOG_TAG - -#endif /* USE_GLIB */ - -#ifdef __cplusplus -extern "C" -{ -#endif -/*============================================================================= - * - * LOC LOGGER TYPE DECLARATION - * - *============================================================================*/ -/* LOC LOGGER */ -typedef struct loc_logger_s -{ - unsigned long DEBUG_LEVEL; - unsigned long TIMESTAMP; -} loc_logger_s_type; - -/*============================================================================= - * - * EXTERNAL DATA - * - *============================================================================*/ -extern loc_logger_s_type loc_logger; - -// Logging Improvements -extern const char *loc_logger_boolStr[]; - -extern const char *boolStr[]; -extern const char VOID_RET[]; -extern const char FROM_AFW[]; -extern const char TO_MODEM[]; -extern const char FROM_MODEM[]; -extern const char TO_AFW[]; -extern const char EXIT_TAG[]; -extern const char ENTRY_TAG[]; -extern const char EXIT_ERROR_TAG[]; - -/*============================================================================= - * - * MODULE EXPORTED FUNCTIONS - * - *============================================================================*/ -extern void loc_logger_init(unsigned long debug, unsigned long timestamp); -extern char* get_timestamp(char* str, unsigned long buf_size); - -#ifndef DEBUG_DMN_LOC_API - -/* LOGGING MACROS */ -/*loc_logger.DEBUG_LEVEL is initialized to 0xff in loc_cfg.cpp - if that value remains unchanged, it means gps.conf did not - provide a value and we default to the initial value to use - Android's logging levels*/ -#define IF_LOC_LOGE if((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define IF_LOC_LOGW if((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define IF_LOC_LOGI if((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define IF_LOC_LOGD if((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define IF_LOC_LOGV if((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define LOC_LOGE(...) \ -IF_LOC_LOGE { ALOGE("E/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/" __VA_ARGS__); } - -#define LOC_LOGW(...) \ -IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); } - -#define LOC_LOGI(...) \ -IF_LOC_LOGI { ALOGE("I/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/" __VA_ARGS__); } - -#define LOC_LOGD(...) \ -IF_LOC_LOGD { ALOGE("D/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/" __VA_ARGS__); } - -#define LOC_LOGV(...) \ -IF_LOC_LOGV { ALOGE("V/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } - -#else /* DEBUG_DMN_LOC_API */ - -#define LOC_LOGE(...) ALOGE("E/" __VA_ARGS__) - -#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__) - -#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__) - -#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__) - -#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__) - -#endif /* DEBUG_DMN_LOC_API */ - -/*============================================================================= - * - * LOGGING IMPROVEMENT MACROS - * - *============================================================================*/ -#define LOG_(LOC_LOG, ID, WHAT, SPEC, VAL) \ - do { \ - if (loc_logger.TIMESTAMP) { \ - char ts[32]; \ - LOC_LOG("[%s] %s %s line %d " #SPEC, \ - get_timestamp(ts, sizeof(ts)), ID, WHAT, __LINE__, VAL); \ - } else { \ - LOC_LOG("%s %s line %d " #SPEC, \ - ID, WHAT, __LINE__, VAL); \ - } \ - } while(0) - -#define LOC_LOG_HEAD(tag,fmt) "%s:%d][" tag "] " fmt "\n" -#define LOC_LOGv(tag,fmt,...) LOC_LOGV(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGw(tag,fmt,...) LOC_LOGW(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGd(tag,fmt,...) LOC_LOGD(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGe(tag,fmt,...) LOC_LOGE(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__) - -#define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL) -#define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL) -#define LOG_E(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGE, ID, WHAT, SPEC, VAL) - -#define ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "") -#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL) -#define EXIT_LOG_WITH_ERROR(SPEC, VAL) \ - if (VAL != 0) { \ - LOG_E(EXIT_ERROR_TAG, __func__, SPEC, VAL); \ - } else { \ - LOG_V(EXIT_TAG, __func__, SPEC, VAL); \ - } - - -// Used for logging callflow from Android Framework -#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "") -// Used for logging callflow to Modem -#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __func__, SPEC, VAL) -// Used for logging callflow from Modem(TO_MODEM, __func__, %s, "") -#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __func__, SPEC, VAL) -// Used for logging callflow to Android Framework -#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL) - -#ifdef __cplusplus -} -#endif - -#endif // __LOG_UTIL_H__ diff --git a/gps/utils/msg_q.c b/gps/utils/msg_q.c deleted file mode 100644 index e412e78..0000000 --- a/gps/utils/msg_q.c +++ /dev/null @@ -1,335 +0,0 @@ -/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation, nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "msg_q.h" - -#define LOG_TAG "LocSvc_utils_q" -#include -#include "linked_list.h" -#include -#include -#include - -typedef struct msg_q { - void* msg_list; /* Linked list to store information */ - pthread_cond_t list_cond; /* Condition variable for waiting on msg queue */ - pthread_mutex_t list_mutex; /* Mutex for exclusive access to message queue */ - int unblocked; /* Has this message queue been unblocked? */ -} msg_q; - -/*=========================================================================== -FUNCTION convert_linked_list_err_type - -DESCRIPTION - Converts from one set of enum values to another. - - linked_list_val: Value to convert to msg_q_enum_type - -DEPENDENCIES - N/A - -RETURN VALUE - Corresponding linked_list_enum_type in msg_q_enum_type - -SIDE EFFECTS - N/A - -===========================================================================*/ -static msq_q_err_type convert_linked_list_err_type(linked_list_err_type linked_list_val) -{ - switch( linked_list_val ) - { - case eLINKED_LIST_SUCCESS: - return eMSG_Q_SUCCESS; - case eLINKED_LIST_INVALID_PARAMETER: - return eMSG_Q_INVALID_PARAMETER; - case eLINKED_LIST_INVALID_HANDLE: - return eMSG_Q_INVALID_HANDLE; - case eLINKED_LIST_UNAVAILABLE_RESOURCE: - return eMSG_Q_UNAVAILABLE_RESOURCE; - case eLINKED_LIST_INSUFFICIENT_BUFFER: - return eMSG_Q_INSUFFICIENT_BUFFER; - - case eLINKED_LIST_FAILURE_GENERAL: - default: - return eMSG_Q_FAILURE_GENERAL; - } -} - -/* ----------------------- END INTERNAL FUNCTIONS ---------------------------------------- */ - -/*=========================================================================== - - FUNCTION: msg_q_init - - ===========================================================================*/ -msq_q_err_type msg_q_init(void** msg_q_data) -{ - if( msg_q_data == NULL ) - { - LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); - return eMSG_Q_INVALID_PARAMETER; - } - - msg_q* tmp_msg_q; - tmp_msg_q = (msg_q*)calloc(1, sizeof(msg_q)); - if( tmp_msg_q == NULL ) - { - LOC_LOGE("%s: Unable to allocate space for message queue!\n", __FUNCTION__); - return eMSG_Q_FAILURE_GENERAL; - } - - if( linked_list_init(&tmp_msg_q->msg_list) != 0 ) - { - LOC_LOGE("%s: Unable to initialize storage list!\n", __FUNCTION__); - free(tmp_msg_q); - return eMSG_Q_FAILURE_GENERAL; - } - - if( pthread_mutex_init(&tmp_msg_q->list_mutex, NULL) != 0 ) - { - LOC_LOGE("%s: Unable to initialize list mutex!\n", __FUNCTION__); - linked_list_destroy(&tmp_msg_q->msg_list); - free(tmp_msg_q); - return eMSG_Q_FAILURE_GENERAL; - } - - if( pthread_cond_init(&tmp_msg_q->list_cond, NULL) != 0 ) - { - LOC_LOGE("%s: Unable to initialize msg q cond var!\n", __FUNCTION__); - linked_list_destroy(&tmp_msg_q->msg_list); - pthread_mutex_destroy(&tmp_msg_q->list_mutex); - free(tmp_msg_q); - return eMSG_Q_FAILURE_GENERAL; - } - - tmp_msg_q->unblocked = 0; - - *msg_q_data = tmp_msg_q; - - return eMSG_Q_SUCCESS; -} - -/*=========================================================================== - - FUNCTION: msg_q_init2 - - ===========================================================================*/ -const void* msg_q_init2() -{ - void* q = NULL; - if (eMSG_Q_SUCCESS != msg_q_init(&q)) { - q = NULL; - } - return q; -} - -/*=========================================================================== - - FUNCTION: msg_q_destroy - - ===========================================================================*/ -msq_q_err_type msg_q_destroy(void** msg_q_data) -{ - if( msg_q_data == NULL ) - { - LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); - return eMSG_Q_INVALID_HANDLE; - } - - msg_q* p_msg_q = (msg_q*)*msg_q_data; - - linked_list_destroy(&p_msg_q->msg_list); - pthread_mutex_destroy(&p_msg_q->list_mutex); - pthread_cond_destroy(&p_msg_q->list_cond); - - p_msg_q->unblocked = 0; - - free(*msg_q_data); - *msg_q_data = NULL; - - return eMSG_Q_SUCCESS; -} - -/*=========================================================================== - - FUNCTION: msg_q_snd - - ===========================================================================*/ -msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*)) -{ - msq_q_err_type rv; - if( msg_q_data == NULL ) - { - LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); - return eMSG_Q_INVALID_HANDLE; - } - if( msg_obj == NULL ) - { - LOC_LOGE("%s: Invalid msg_obj parameter!\n", __FUNCTION__); - return eMSG_Q_INVALID_PARAMETER; - } - - msg_q* p_msg_q = (msg_q*)msg_q_data; - - pthread_mutex_lock(&p_msg_q->list_mutex); - LOC_LOGV("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); - - if( p_msg_q->unblocked ) - { - LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__); - pthread_mutex_unlock(&p_msg_q->list_mutex); - return eMSG_Q_UNAVAILABLE_RESOURCE; - } - - rv = convert_linked_list_err_type(linked_list_add(p_msg_q->msg_list, msg_obj, dealloc)); - - /* Show data is in the message queue. */ - pthread_cond_signal(&p_msg_q->list_cond); - - pthread_mutex_unlock(&p_msg_q->list_mutex); - - LOC_LOGV("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); - - return rv; -} - -/*=========================================================================== - - FUNCTION: msg_q_rcv - - ===========================================================================*/ -msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) -{ - msq_q_err_type rv; - if( msg_q_data == NULL ) - { - LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); - return eMSG_Q_INVALID_HANDLE; - } - - if( msg_obj == NULL ) - { - LOC_LOGE("%s: Invalid msg_obj parameter!\n", __FUNCTION__); - return eMSG_Q_INVALID_PARAMETER; - } - - msg_q* p_msg_q = (msg_q*)msg_q_data; - - LOC_LOGV("%s: Waiting on message\n", __FUNCTION__); - - pthread_mutex_lock(&p_msg_q->list_mutex); - - if( p_msg_q->unblocked ) - { - LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__); - pthread_mutex_unlock(&p_msg_q->list_mutex); - return eMSG_Q_UNAVAILABLE_RESOURCE; - } - - /* Wait for data in the message queue */ - while( linked_list_empty(p_msg_q->msg_list) && !p_msg_q->unblocked ) - { - pthread_cond_wait(&p_msg_q->list_cond, &p_msg_q->list_mutex); - } - - rv = convert_linked_list_err_type(linked_list_remove(p_msg_q->msg_list, msg_obj)); - - pthread_mutex_unlock(&p_msg_q->list_mutex); - - LOC_LOGV("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); - - return rv; -} - -/*=========================================================================== - - FUNCTION: msg_q_flush - - ===========================================================================*/ -msq_q_err_type msg_q_flush(void* msg_q_data) -{ - msq_q_err_type rv; - if ( msg_q_data == NULL ) - { - LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); - return eMSG_Q_INVALID_HANDLE; - } - - msg_q* p_msg_q = (msg_q*)msg_q_data; - - LOC_LOGD("%s: Flushing Message Queue\n", __FUNCTION__); - - pthread_mutex_lock(&p_msg_q->list_mutex); - - /* Remove all elements from the list */ - rv = convert_linked_list_err_type(linked_list_flush(p_msg_q->msg_list)); - - pthread_mutex_unlock(&p_msg_q->list_mutex); - - LOC_LOGD("%s: Message Queue flushed\n", __FUNCTION__); - - return rv; -} - -/*=========================================================================== - - FUNCTION: msg_q_unblock - - ===========================================================================*/ -msq_q_err_type msg_q_unblock(void* msg_q_data) -{ - if ( msg_q_data == NULL ) - { - LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); - return eMSG_Q_INVALID_HANDLE; - } - - msg_q* p_msg_q = (msg_q*)msg_q_data; - pthread_mutex_lock(&p_msg_q->list_mutex); - - if( p_msg_q->unblocked ) - { - LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__); - pthread_mutex_unlock(&p_msg_q->list_mutex); - return eMSG_Q_UNAVAILABLE_RESOURCE; - } - - LOC_LOGD("%s: Unblocking Message Queue\n", __FUNCTION__); - /* Unblocking message queue */ - p_msg_q->unblocked = 1; - - /* Allow all the waiters to wake up */ - pthread_cond_broadcast(&p_msg_q->list_cond); - - pthread_mutex_unlock(&p_msg_q->list_mutex); - - LOC_LOGD("%s: Message Queue unblocked\n", __FUNCTION__); - - return eMSG_Q_SUCCESS; -} diff --git a/gps/utils/msg_q.h b/gps/utils/msg_q.h deleted file mode 100644 index 453b8ce..0000000 --- a/gps/utils/msg_q.h +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (c) 2011, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __MSG_Q_H__ -#define __MSG_Q_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -/** Linked List Return Codes */ -typedef enum -{ - eMSG_Q_SUCCESS = 0, - /**< Request was successful. */ - eMSG_Q_FAILURE_GENERAL = -1, - /**< Failed because of a general failure. */ - eMSG_Q_INVALID_PARAMETER = -2, - /**< Failed because the request contained invalid parameters. */ - eMSG_Q_INVALID_HANDLE = -3, - /**< Failed because an invalid handle was specified. */ - eMSG_Q_UNAVAILABLE_RESOURCE = -4, - /**< Failed because an there were not enough resources. */ - eMSG_Q_INSUFFICIENT_BUFFER = -5, - /**< Failed because an the supplied buffer was too small. */ -}msq_q_err_type; - -/*=========================================================================== -FUNCTION msg_q_init - -DESCRIPTION - Initializes internal structures for message queue. - - msg_q_data: pointer to an opaque Q handle to be returned; NULL if fails - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -msq_q_err_type msg_q_init(void** msg_q_data); - -/*=========================================================================== -FUNCTION msg_q_init2 - -DESCRIPTION - Initializes internal structures for message queue. - -DEPENDENCIES - N/A - -RETURN VALUE - opaque handle to the Q created; NULL if create fails - -SIDE EFFECTS - N/A - -===========================================================================*/ -const void* msg_q_init2(); - -/*=========================================================================== -FUNCTION msg_q_destroy - -DESCRIPTION - Releases internal structures for message queue. - - msg_q_data: State of message queue to be released. - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -msq_q_err_type msg_q_destroy(void** msg_q_data); - -/*=========================================================================== -FUNCTION msg_q_snd - -DESCRIPTION - Sends data to the message queue. The passed in data pointer - is not modified or freed. Passed in msg_obj is expected to live throughout - the use of the msg_q (i.e. data is not allocated internally) - - msg_q_data: Message Queue to add the element to. - msgp: Pointer to data to add into message queue. - dealloc: Function used to deallocate memory for this element. Pass NULL - if you do not want data deallocated during a flush operation - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*)); - -/*=========================================================================== -FUNCTION msg_q_rcv - -DESCRIPTION - Retrieves data from the message queue. msg_obj is the oldest message received - and pointer is simply removed from message queue. - - msg_q_data: Message Queue to copy data from into msgp. - msg_obj: Pointer to space to copy msg_q contents to. - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj); - -/*=========================================================================== -FUNCTION msg_q_flush - -DESCRIPTION - Function removes all elements from the message queue. - - msg_q_data: Message Queue to remove elements from. - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -msq_q_err_type msg_q_flush(void* msg_q_data); - -/*=========================================================================== -FUNCTION msg_q_unblock - -DESCRIPTION - This function will stop use of the message queue. All waiters will wake up - and likely receive nothing from the queue resulting in a negative return - value. The message queue can no longer be used until it is destroyed - and initialized again after calling this function. - - msg_q_data: Message queue to unblock. - -DEPENDENCIES - N/A - -RETURN VALUE - Look at error codes above. - -SIDE EFFECTS - N/A - -===========================================================================*/ -msq_q_err_type msg_q_unblock(void* msg_q_data); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __MSG_Q_H__ */ diff --git a/gps/utils/platform_lib_abstractions/Android.mk b/gps/utils/platform_lib_abstractions/Android.mk deleted file mode 100644 index b923a4c..0000000 --- a/gps/utils/platform_lib_abstractions/Android.mk +++ /dev/null @@ -1,5 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -include $(call all-subdir-makefiles) - -endif diff --git a/gps/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/gps/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp deleted file mode 100644 index e8cb93a..0000000 --- a/gps/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include "platform_lib_time.h" - -int64_t systemTime(int clock) -{ - struct timeval t; - t.tv_sec = t.tv_usec = 0; - gettimeofday(&t, NULL); - return t.tv_sec*1000000LL + t.tv_usec; -} - - -int64_t elapsedMillisSinceBoot() -{ - int64_t t_us = systemTime(0); - return (int64_t) t_us / 1000LL; -} diff --git a/gps/utils/platform_lib_abstractions/loc_pla/Android.mk b/gps/utils/platform_lib_abstractions/loc_pla/Android.mk deleted file mode 100644 index b923a4c..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/Android.mk +++ /dev/null @@ -1,5 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -include $(call all-subdir-makefiles) - -endif diff --git a/gps/utils/platform_lib_abstractions/loc_pla/Makefile.am b/gps/utils/platform_lib_abstractions/loc_pla/Makefile.am deleted file mode 100644 index 8996763..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile.am for gps loc-pla -# - -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = src - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = loc-pla.pc -EXTRA_DIST = $(pkgconfig_DATA) diff --git a/gps/utils/platform_lib_abstractions/loc_pla/configure.ac b/gps/utils/platform_lib_abstractions/loc_pla/configure.ac deleted file mode 100644 index a8b892b..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/configure.ac +++ /dev/null @@ -1,61 +0,0 @@ -# configure.ac -- Autoconf script for gps loc-pla -# -# Process this file with autoconf to produce a configure script - -# Requires autoconf tool later than 2.61 -AC_PREREQ(2.61) -# Initialize the gps loc-pla package version 1.0.0 -AC_INIT([loc-pla],1.0.0) -# Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) -# Disables auto rebuilding of configure, Makefile.ins -AM_MAINTAINER_MODE -# Verifies the --srcdir is correct by checking for the path -AC_CONFIG_SRCDIR([include/platform_lib_includes.h]) -# defines some macros variable to be included by source -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# Checks for programs. -AC_PROG_LIBTOOL -AC_PROG_CXX -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_AWK -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG - -# Checks for libraries. -PKG_CHECK_MODULES([LOCSTUB], [loc-stub]) -AC_SUBST([LOCSTUB_CFLAGS]) -AC_SUBST([LOCSTUB_LIBS]) - -AC_ARG_WITH([glib], - AC_HELP_STRING([--with-glib], - [enable glib, building HLOS systems which use glib])) - -if (test "x${with_glib}" = "xyes"); then - AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) - PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GThread >= 2.16 is required)) - PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GLib >= 2.16 is required)) - GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" - GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" - - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) -fi - -AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") - -AC_CONFIG_FILES([ \ - Makefile \ - src/Makefile \ - loc-pla.pc \ - ]) - -AC_OUTPUT diff --git a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h b/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h deleted file mode 100644 index 9a954f0..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_ANDROID_RUNTIME_H__ -#define __PLATFORM_LIB_ANDROID_RUNTIME_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg); -#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION platform_lib_abstraction_createJavaThread - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /*__PLATFORM_LIB_ANDROID_RUNTIME_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h b/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h deleted file mode 100644 index 9956937..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_gettid.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_GETTID_H__ -#define __PLATFORM_LIB_GETTID_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif -pid_t platform_lib_abstraction_gettid(); -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* __PLATFORM_LIB_GETTID_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h b/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h deleted file mode 100644 index 47c37df..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_INCLUDES_H__ -#define __PLATFORM_LIB_INCLUDES_H__ - -#include "platform_lib_android_runtime.h" -#include "platform_lib_gettid.h" -#include "platform_lib_log_util.h" -#include "platform_lib_macros.h" -#include "platform_lib_property_service.h" -#include "platform_lib_sched_policy.h" -#include "platform_lib_time.h" - -#endif /* __PLATFORM_LIB_INCLUDES_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h b/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h deleted file mode 100644 index 5989c64..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_log_util.h +++ /dev/null @@ -1,196 +0,0 @@ -/* Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_LOG_UTIL_H__ -#define __PLATFORM_LIB_LOG_UTIL_H__ - -#include "platform_lib_macros.h" - -#ifndef USE_GLIB -#include -#else - -#include -#include -#include -#include -#include -#include - -#ifndef LOG_TAG -#define LOG_TAG "GPS_UTILS" -#endif /* LOG_TAG */ - -#ifdef __cplusplus -extern "C" -{ -#endif -/*============================================================================= - * - * LOC LOGGER TYPE DECLARATION - * - *============================================================================*/ -/* LOC LOGGER */ -typedef struct loc_logger_s -{ - unsigned long DEBUG_LEVEL; - unsigned long TIMESTAMP; -} loc_logger_s_type; - -/*============================================================================= - * - * EXTERNAL DATA - * - *============================================================================*/ -extern loc_logger_s_type loc_logger; - -// Logging Improvements -extern const char *loc_logger_boolStr[]; - -extern const char *boolStr[]; -extern const char VOID_RET[]; -extern const char FROM_AFW[]; -extern const char TO_MODEM[]; -extern const char FROM_MODEM[]; -extern const char TO_AFW[]; -extern const char EXIT_TAG[]; -extern const char ENTRY_TAG[]; -extern const char EXIT_ERROR_TAG[]; - -/*============================================================================= - * - * MODULE EXPORTED FUNCTIONS - * - *============================================================================*/ -void loc_logger_init(unsigned long debug, unsigned long timestamp); -char* get_timestamp(char* str, unsigned long buf_size); - -#ifndef DEBUG_DMN_LOC_API - -/* LOGGING MACROS */ -/*loc_logger.DEBUG_LEVEL is initialized to 0xff in loc_cfg.cpp - if that value remains unchanged, it means gps.conf did not - provide a value and we default to the initial value to use - Android's logging levels*/ -#define IF_LOC_LOGE if((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define IF_LOC_LOGW if((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define IF_LOC_LOGI if((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define IF_LOC_LOGD if((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define IF_LOC_LOGV if((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5)) - -#define LOC_LOGE(...) \ -IF_LOC_LOGE { ALOGE("E/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/" __VA_ARGS__); } - -#define LOC_LOGW(...) \ -IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); } - -#define LOC_LOGI(...) \ -IF_LOC_LOGI { ALOGE("I/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/" __VA_ARGS__); } - -#define LOC_LOGD(...) \ -IF_LOC_LOGD { ALOGE("D/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/" __VA_ARGS__); } - -#define LOC_LOGV(...) \ -IF_LOC_LOGV { ALOGE("V/" __VA_ARGS__); } \ -else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } - -#else /* DEBUG_DMN_LOC_API */ - -#define LOC_LOGE(...) ALOGE("E/" __VA_ARGS__) - -#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__) - -#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__) - -#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__) - -#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__) - -#endif /* DEBUG_DMN_LOC_API */ - -/*============================================================================= - * - * LOGGING IMPROVEMENT MACROS - * - *============================================================================*/ -#define LOG_(LOC_LOG, ID, WHAT, SPEC, VAL) \ - do { \ - if (loc_logger.TIMESTAMP) { \ - char ts[32]; \ - LOC_LOG("[%s] %s %s line %d " #SPEC, \ - get_timestamp(ts, sizeof(ts)), ID, WHAT, __LINE__, VAL); \ - } else { \ - LOC_LOG("%s %s line %d " #SPEC, \ - ID, WHAT, __LINE__, VAL); \ - } \ - } while(0) - -#define LOC_LOG_HEAD(tag,fmt) "%s:%d][" tag "] " fmt "\n" -#define LOC_LOGv(tag,fmt,...) LOC_LOGV(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGw(tag,fmt,...) LOC_LOGW(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGd(tag,fmt,...) LOC_LOGD(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__) -#define LOC_LOGe(tag,fmt,...) LOC_LOGE(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__) - -#define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL) -#define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL) -#define LOG_E(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGE, ID, WHAT, SPEC, VAL) - -#define ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "") -#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL) -#define EXIT_LOG_WITH_ERROR(SPEC, VAL) \ - if (VAL != 0) { \ - LOG_E(EXIT_ERROR_TAG, __func__, SPEC, VAL); \ - } else { \ - LOG_V(EXIT_TAG, __func__, SPEC, VAL); \ - } - - -// Used for logging callflow from Android Framework -#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "") -// Used for logging callflow to Modem -#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __func__, SPEC, VAL) -// Used for logging callflow from Modem(TO_MODEM, __func__, %s, "") -#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __func__, SPEC, VAL) -// Used for logging callflow to Android Framework -#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL) - -#ifdef __cplusplus -} -#endif - -#endif /* USE_GLIB */ - -#endif /* __PLATFORM_LIB_LOG_UTIL_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h deleted file mode 100644 index c712122..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_MACROS_H__ -#define __PLATFORM_LIB_MACROS_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef USE_GLIB -#include -#include -#include -#ifndef OFF_TARGET -#include -#define strlcat g_strlcat -#define strlcpy g_strlcpy -#else -#define strlcat strncat -#define strlcpy strncpy -#endif - -#define TS_PRINTF(format, x...) \ -{ \ - struct timeval tv; \ - struct timezone tz; \ - int hh, mm, ss; \ - gettimeofday(&tv, &tz); \ - hh = tv.tv_sec/3600%24; \ - mm = (tv.tv_sec%3600)/60; \ - ss = tv.tv_sec%60; \ - fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_usec,##x); \ -} - -#define ALOGE(format, x...) TS_PRINTF("E/%s (%d): " format , LOG_TAG, getpid(), ##x) -#define ALOGW(format, x...) TS_PRINTF("W/%s (%d): " format , LOG_TAG, getpid(), ##x) -#define ALOGI(format, x...) TS_PRINTF("I/%s (%d): " format , LOG_TAG, getpid(), ##x) -#define ALOGD(format, x...) TS_PRINTF("D/%s (%d): " format , LOG_TAG, getpid(), ##x) -#define ALOGV(format, x...) TS_PRINTF("V/%s (%d): " format , LOG_TAG, getpid(), ##x) - -#endif /* USE_GLIB */ - -#ifdef __cplusplus -} -#endif /*__cplusplus */ - -#endif /* __PLATFORM_LIB_MACROS_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h b/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h deleted file mode 100644 index ed2041f..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_property_service.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_PROPERTY_SERVICE_H__ -#define __PLATFORM_LIB_PROPERTY_SERVICE_H__ - -#ifdef __cplusplus -extern "C" { -#endif -#ifndef PROPERTY_VALUE_MAX -#define PROPERTY_VALUE_MAX 92 -#endif -int platform_lib_abstraction_property_get(const char *key, char *value, const char *default_value); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __PLATFORM_LIB_PROPERTY_SERVICE_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h b/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h deleted file mode 100644 index d10f151..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_sched_policy.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_SCHED_POLICY_H__ -#define __PLATFORM_LIB_SCHED_POLICY_H__ - -#ifdef __cplusplus -extern "C" { -#endif -typedef enum { - PLA_SP_BACKGROUND = 0, - PLA_SP_FOREGROUND = 1, -} PLASchedPolicy; - -int platform_lib_abstraction_set_sched_policy(int tid, PLASchedPolicy policy); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __PLATFORM_LIB_SCHED_POLICY_H__ */ - diff --git a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h b/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h deleted file mode 100644 index 2905a74..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/include/platform_lib_time.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_TIME_H__ -#define __PLATFORM_LIB_TIME_H__ - -#include -int64_t platform_lib_abstraction_elapsed_millis_since_boot(); - -#endif /* __PLATFORM_LIB_TIME_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in b/gps/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in deleted file mode 100644 index 1aad2f4..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: loc-pla -Description: QTI GPS Location Platform Library Abstractions -Version: @VERSION@ -Libs: -L${libdir} -lloc_pla -Cflags: -I${includedir}/loc-pla diff --git a/gps/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/gps/utils/platform_lib_abstractions/loc_pla/src/Android.mk deleted file mode 100644 index 0363d59..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ /dev/null @@ -1,55 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -## Libs -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - liblog \ - libloc_stub - -LOCAL_SRC_FILES += \ - platform_lib_android_runtime.cpp \ - platform_lib_gettid.cpp \ - platform_lib_log_util.cpp \ - platform_lib_property_service.cpp \ - platform_lib_sched_policy.cpp \ - platform_lib_time.cpp - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ \ - -std=c++11 - - -LOCAL_LDFLAGS += -Wl,--export-dynamic - -## Includes -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/../include \ - $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_stub - -LOCAL_COPY_HEADERS_TO:= libloc_pla/ -LOCAL_COPY_HEADERS:= \ - ../include/platform_lib_android_runtime.h \ - ../include/platform_lib_gettid.h \ - ../include/platform_lib_includes.h \ - ../include/platform_lib_log_util.h \ - ../include/platform_lib_macros.h \ - ../include/platform_lib_property_service.h \ - ../include/platform_lib_sched_policy.h \ - ../include/platform_lib_time.h - -LOCAL_MODULE := libloc_pla - -LOCAL_MODULE_TAGS := optional - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) -endif # not BUILD_TINY_ANDROID diff --git a/gps/utils/platform_lib_abstractions/loc_pla/src/Makefile.am b/gps/utils/platform_lib_abstractions/loc_pla/src/Makefile.am deleted file mode 100644 index 6ee0be7..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/src/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -AM_CFLAGS = \ - $(LOCSTUB_CFLAGS) \ - -I../include \ - -D__func__=__PRETTY_FUNCTION__ \ - -fno-short-enums - -h_sources = \ - ../include/platform_lib_android_runtime.h \ - ../include/platform_lib_gettid.h \ - ../include/platform_lib_includes.h \ - ../include/platform_lib_log_util.h \ - ../include/platform_lib_macros.h \ - ../include/platform_lib_property_service.h \ - ../include/platform_lib_sched_policy.h \ - ../include/platform_lib_time.h - -library_includedir = $(pkgincludedir) -library_include_HEADERS = $(h_sources) - -libloc_pla_la_SOURCES = \ - platform_lib_android_runtime.cpp \ - platform_lib_gettid.cpp \ - platform_lib_log_util.cpp \ - platform_lib_property_service.cpp \ - platform_lib_sched_policy.cpp \ - platform_lib_time.cpp - -if USE_GLIB -libloc_pla_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_pla_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_pla_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_pla_la_CFLAGS = $(AM_CFLAGS) -libloc_pla_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libloc_pla_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_pla_la_LIBADD = -lstdc++ -ldl -llog $(LOCSTUB_LIBS) - -#Create and Install libraries -lib_LTLIBRARIES = libloc_pla.la diff --git a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp b/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp deleted file mode 100644 index 090af13..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "platform_lib_android_runtime.h" - -#ifdef USE_GLIB -#include -#else -#include -#endif /* USE_GLIB */ - -pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg) -{ - return (pthread_t)android::AndroidRuntime::createJavaThread(name, start, arg); -} diff --git a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp b/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp deleted file mode 100644 index 8686327..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_gettid.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "platform_lib_gettid.h" - -#ifdef USE_GLIB -#include -#else -#include -#endif /* USE_GLIB */ - -pid_t platform_lib_abstraction_gettid() -{ - return gettid(); -} diff --git a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp deleted file mode 100644 index ef23201..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include "platform_lib_log_util.h" - -char * get_timestamp(char *str, unsigned long buf_size) -{ - struct timeval tv; - struct timezone tz; - int hh, mm, ss; - gettimeofday(&tv, &tz); - hh = tv.tv_sec/3600%24; - mm = (tv.tv_sec%3600)/60; - ss = tv.tv_sec%60; - snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec); - return str; -} - diff --git a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp b/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp deleted file mode 100644 index 1cc63ab..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_property_service.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include "platform_lib_property_service.h" - -#ifdef USE_GLIB -#include -#else -#include -#endif /* USE_GLIB */ - -int platform_lib_abstraction_property_get(const char *key, char *value, const char *default_value) -{ - return property_get(key, value, default_value); -} diff --git a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp b/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp deleted file mode 100644 index ba6b350..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_sched_policy.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "platform_lib_sched_policy.h" - -#ifdef USE_GLIB -#include -#else -#include -#endif /* USE_GLIB */ - -int platform_lib_abstraction_set_sched_policy(int tid, PLASchedPolicy policy) -{ - return set_sched_policy(tid, (SchedPolicy)policy); -} - diff --git a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp b/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp deleted file mode 100644 index dc7dff1..0000000 --- a/gps/utils/platform_lib_abstractions/loc_pla/src/platform_lib_time.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include "platform_lib_time.h" - -#ifdef USE_GLIB -#include -#else -#include -#endif /* USE_GLIB */ - -int64_t platform_lib_abstraction_elapsed_millis_since_boot() -{ -#ifdef USE_GLIB - - return elapsedMillisSinceBoot(); - -#else - - return android::elapsedRealtime(); - -#endif -} diff --git a/gps/utils/platform_lib_abstractions/loc_stub/Android.mk b/gps/utils/platform_lib_abstractions/loc_stub/Android.mk deleted file mode 100644 index b923a4c..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/Android.mk +++ /dev/null @@ -1,5 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - -include $(call all-subdir-makefiles) - -endif diff --git a/gps/utils/platform_lib_abstractions/loc_stub/Makefile.am b/gps/utils/platform_lib_abstractions/loc_stub/Makefile.am deleted file mode 100644 index d81e363..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -# Makefile.am for gps loc-stub - -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = src - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = loc-stub.pc -EXTRA_DIST = $(pkgconfig_DATA) diff --git a/gps/utils/platform_lib_abstractions/loc_stub/configure.ac b/gps/utils/platform_lib_abstractions/loc_stub/configure.ac deleted file mode 100644 index 8900f04..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/configure.ac +++ /dev/null @@ -1,67 +0,0 @@ -# configure.ac -- Autoconf script for gps loc-stub -# -# Process this file with autoconf to produce a configure script - -# Requires autoconf tool later than 2.61 -AC_PREREQ(2.61) -# Initialize the gps loc-stub package version 1.0.0 -AC_INIT([loc-stub],1.0.0) -# Does not strictly follow GNU Coding standards -AM_INIT_AUTOMAKE([foreign]) -# Disables auto rebuilding of configure, Makefile.ins -AM_MAINTAINER_MODE -# Verifies the --srcdir is correct by checking for the path -AC_CONFIG_SRCDIR([Makefile.am]) -# defines some macros variable to be included by source -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# Checks for programs. -AC_PROG_LIBTOOL -AC_PROG_CXX -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_AWK -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG - -# Checks for libraries. -AC_ARG_WITH([hardware_include], - AC_HELP_STRING([--with-hardware-include=@<:@dir@:>@], - [Specify the location of the hardware headers]), - [hardware_incdir=$withval], - with_hardware_include=no) - -if test "x$with_hardware_include" != "xno"; then - CPPFLAGS="${CPPFLAGS} -I${hardware_incdir}" -fi - -AC_ARG_WITH([glib], - AC_HELP_STRING([--with-glib], - [enable glib, building HLOS systems which use glib])) - -if (test "x${with_glib}" = "xyes"); then - AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) - PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GThread >= 2.16 is required)) - PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GLib >= 2.16 is required)) - GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" - GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" - - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) -fi - -AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") - -AC_CONFIG_FILES([ \ - Makefile \ - src/Makefile \ - loc-stub.pc - ]) - -AC_OUTPUT diff --git a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h b/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h deleted file mode 100644 index c8764ee..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_android_runtime.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_ANDROID_RUNTIME_H__ -#define __LOC_STUB_ANDROID_RUNTIME_H__ - -#include - -namespace android { - -class AndroidRuntime -{ -public: - /** create a new thread that is visible from Java */ - static pthread_t createJavaThread(const char* name, void (*start)(void *), - void* arg); -}; - -} -#endif /* __LOC_STUB_ANDROID_RUNTIME_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h b/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h deleted file mode 100644 index 677bc81..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_gettid.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_GETTID_H__ -#define __LOC_STUB_GETTID_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -pid_t gettid(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __LOC_STUB_GETTID_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h b/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h deleted file mode 100644 index 3677cdf..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_property_service.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_PROPERTY_SERVICE_H__ -#define __LOC_STUB_PROPERTY_SERVICE_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -int property_get(const char *key, char *value, const char *default_value); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LOC_STUB_PROPERTY_SERVICE_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h b/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h deleted file mode 100644 index a42b117..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_sched_policy.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_SCHED_POLICY_H__ -#define __LOC_STUB_SCHED_POLICY_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - SP_BACKGROUND = 0, - SP_FOREGROUND = 1, -} SchedPolicy; - -/*=========================================================================== -FUNCTION set_sched_policy - -DESCRIPTION - Local copy of this function which bypasses android set_sched_policy - -DEPENDENCIES - None - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int set_sched_policy(int tid, SchedPolicy policy); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LOC_STUB_SCHED_POLICY_H__ */ - diff --git a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h b/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h deleted file mode 100644 index 271e2ff..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/include/loc_stub_time.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LOC_STUB_TIME_H__ -#define __LOC_STUB_TIME_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int64_t systemTime(int clock); -int64_t elapsedMillisSinceBoot(); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LOC_STUB_TIME_H__ */ diff --git a/gps/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in b/gps/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in deleted file mode 100644 index c2ae764..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: loc-stub -Description: QTI GPS Location Stub -Version: @VERSION -Libs: -L${libdir} -lloc_stub -Cflags: -I${includedir}/loc-stub diff --git a/gps/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/gps/utils/platform_lib_abstractions/loc_stub/src/Android.mk deleted file mode 100644 index 65fe021..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/src/Android.mk +++ /dev/null @@ -1,49 +0,0 @@ -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -## Libs -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - liblog - -LOCAL_SRC_FILES += \ - loc_stub_android_runtime.cpp \ - loc_stub_gettid.cpp \ - loc_stub_property_service.cpp \ - loc_stub_sched_policy.cpp \ - loc_stub_time.cpp - -LOCAL_CFLAGS += \ - -fno-short-enums \ - -D_ANDROID_ \ - -std=c++11 - - -LOCAL_LDFLAGS += -Wl,--export-dynamic - -## Includes -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/../include \ - - -LOCAL_COPY_HEADERS_TO:= libloc_stub/ -LOCAL_COPY_HEADERS:= \ - ../include/loc_stub_android_runtime.h \ - ../include/loc_stub_gettid.h \ - ../include/loc_stub_property_service.h \ - ../include/loc_stub_sched_policy.h \ - ../include/loc_stub_time.h - -LOCAL_MODULE := libloc_stub - -LOCAL_MODULE_TAGS := optional - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) -endif # not BUILD_TINY_ANDROID diff --git a/gps/utils/platform_lib_abstractions/loc_stub/src/Makefile.am b/gps/utils/platform_lib_abstractions/loc_stub/src/Makefile.am deleted file mode 100644 index 8bda711..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/src/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -AM_CFLAGS = \ - -I../include \ - -D__func__=__PRETTY_FUNCTION__ \ - -fno-short-enums - -libloc_stub_la_extra_h = \ - ../include/utils/Log.h - -libloc_stub_la_c_sources = \ - loc_stub_android_runtime.cpp \ - loc_stub_gettid.cpp \ - loc_stub_property_service.cpp \ - loc_stub_sched_policy.cpp \ - loc_stub_time.cpp - -libloc_stub_la_SOURCES = $(libloc_stub_la_c_sources) $(libloc_stub_la_extra_h) - -library_include_HEADERS = \ - ../include/loc_stub_android_runtime.h \ - ../include/loc_stub_gettid.h \ - ../include/loc_stub_property_service.h \ - ../include/loc_stub_sched_policy.h \ - ../include/loc_stub_time.h - -library_includedir = $(pkgincludedir) - -if USE_GLIB -libloc_stub_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ -libloc_stub_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 -libloc_stub_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ -else -libloc_stub_la_CFLAGS = $(AM_CFLAGS) -libloc_stub_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 -libloc_stub_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -endif - -libloc_stub_la_LIBADD = -lstdc++ -ldl -llog - -#Create and Install libraries -lib_LTLIBRARIES = libloc_stub.la diff --git a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp b/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp deleted file mode 100644 index 1db69b2..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_android_runtime.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_android_runtime.h" - -namespace android { - -pthread_t AndroidRuntime::createJavaThread(const char* name, - void (*start)(void *), void* arg) -{ - pthread_t threadId = 0; - pthread_create(&threadId, NULL, (void *(*)(void*))start, arg); - return threadId; -} - -} diff --git a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp b/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp deleted file mode 100644 index 55ef48a..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_gettid.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_gettid.h" -#include -#include - -// Required for off-target environment to compile properly -pid_t gettid(void) -{ - return syscall(SYS_gettid); -} diff --git a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp b/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp deleted file mode 100644 index f9d9e3e..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_property_service.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_property_service.h" -#include -#include - -int property_get(const char *key, char * value, const char *default_value) -{ - /* This will disable gps interface - value[0] = '1'; - */ - if (strcmp(key, "ro.baseband") == 0) { - memcpy(value, "msm", 4); - } - return 0; -} diff --git a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp b/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp deleted file mode 100644 index 781be29..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_sched_policy.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_sched_policy.h" - -/*=========================================================================== -FUNCTION set_sched_policy - -DESCRIPTION - Local copy of this function which bypasses android set_sched_policy - -DEPENDENCIES - None - -RETURN VALUE - 0 - -SIDE EFFECTS - N/A - -===========================================================================*/ -int set_sched_policy(int tid, SchedPolicy policy) -{ - return 0; -} diff --git a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp b/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp deleted file mode 100644 index 82dc593..0000000 --- a/gps/utils/platform_lib_abstractions/loc_stub/src/loc_stub_time.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "loc_stub_time.h" -#include -#include - -int64_t systemTime(int clock) -{ - struct timeval t; - t.tv_sec = t.tv_usec = 0; - gettimeofday(&t, NULL); - return t.tv_sec*1000000LL + t.tv_usec; -} - - -int64_t elapsedMillisSinceBoot() -{ - int64_t t_us = systemTime(0); - return (int64_t) t_us / 1000LL; -} diff --git a/idc/gf3208.idc b/idc/gf3208.idc deleted file mode 100644 index 1da4759..0000000 --- a/idc/gf3208.idc +++ /dev/null @@ -1,15 +0,0 @@ -# -# Goodix Fingerprint Touch sensor driver -# -# Copyright (c) 2013,2014 Fingerprint Cards AB -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License Version 2 -# as published by the Free Software Foundation. -# - -device.internal = 1 - -keyboard.layout = gf3208 -keyboard.builtIn = 1 -keyboard.orientationAware = 1 diff --git a/idc/uinput-fpc.idc b/idc/uinput-fpc.idc deleted file mode 100644 index 4cb1a4a..0000000 --- a/idc/uinput-fpc.idc +++ /dev/null @@ -1,15 +0,0 @@ -# -# FPC1020 Touch sensor driver -# -# Copyright (c) 2013,2014 Fingerprint Cards AB -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License Version 2 -# as published by the Free Software Foundation. -# - -device.internal = 1 - -keyboard.layout = uinput-fpc -keyboard.builtIn = 1 -keyboard.orientationAware = 1 diff --git a/init/Android.mk b/init/Android.mk deleted file mode 100644 index 1a617ca..0000000 --- a/init/Android.mk +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (C) 2016 The CyanogenMod Project -# -# 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. -# - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_C_INCLUDES := \ - system/core/base/include \ - system/core/init -LOCAL_MODULE := libinit_land -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := init_land.cpp - -include $(BUILD_STATIC_LIBRARY) diff --git a/init/init_land.cpp b/init/init_land.cpp deleted file mode 100644 index 10c4a1a..0000000 --- a/init/init_land.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - Copyright (c) 2016, The CyanogenMod Project - Copyright (c) 2017, The LineageOS Project - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of The Linux Foundation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include "vendor_init.h" -#include "property_service.h" -#include "log.h" -#include "util.h" - -using android::base::Trim; - -char const *heapstartsize; -char const *heapgrowthlimit; -char const *heapsize; -char const *heapminfree; -char const *heapmaxfree; -char const *large_cache_height; - -static void init_alarm_boot_properties() -{ - char const *boot_reason_file = "/proc/sys/kernel/boot_reason"; - char const *power_off_alarm_file = "/persist/alarm/powerOffAlarmSet"; - std::string boot_reason; - std::string power_off_alarm; - std::string reboot_reason = property_get("ro.boot.alarmboot"); - - if (read_file(boot_reason_file, &boot_reason) - && read_file(power_off_alarm_file, &power_off_alarm)) { - /* - * Setup ro.alarm_boot value to true when it is RTC triggered boot up - * For existing PMIC chips, the following mapping applies - * for the value of boot_reason: - * - * 0 -> unknown - * 1 -> hard reset - * 2 -> sudden momentary power loss (SMPL) - * 3 -> real time clock (RTC) - * 4 -> DC charger inserted - * 5 -> USB charger inserted - * 6 -> PON1 pin toggled (for secondary PMICs) - * 7 -> CBLPWR_N pin toggled (for external power supply) - * 8 -> KPDPWR_N pin toggled (power key pressed) - */ - if ((Trim(boot_reason) == "3" || reboot_reason == "true") - && Trim(power_off_alarm) == "1") { - property_set("ro.alarm_boot", "true"); - } else { - property_set("ro.alarm_boot", "false"); - } - } -} - -void check_device() -{ - struct sysinfo sys; - - sysinfo(&sys); - - if (sys.totalram > 2048ull * 1024 * 1024) { - // from - phone-xxhdpi-3072-dalvik-heap.mk - heapstartsize = "8m"; - heapgrowthlimit = "288m"; - heapsize = "768m"; - heapminfree = "512k"; - heapmaxfree = "8m"; - large_cache_height = "1024"; - } else { - // from - phone-xxhdpi-2048-dalvik-heap.mk - heapstartsize = "16m"; - heapgrowthlimit = "192m"; - heapsize = "512m"; - heapminfree = "2m"; - heapmaxfree = "8m"; - large_cache_height = "1024"; - } -} - -void vendor_load_properties() -{ - std::ifstream fin; - std::string buf; - - std::string product = property_get("ro.product.name"); - if (product.find("land") == std::string::npos) - return; - - fin.open("/proc/cmdline"); - while (std::getline(fin, buf, ' ')) - if (buf.find("board_id") != std::string::npos) - break; - fin.close(); - - init_alarm_boot_properties(); - check_device(); - - property_set("dalvik.vm.heapstartsize", heapstartsize); - property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit); - property_set("dalvik.vm.heapsize", heapsize); - property_set("dalvik.vm.heaptargetutilization", "0.75"); - property_set("dalvik.vm.heapminfree", heapminfree); - property_set("dalvik.vm.heapmaxfree", heapmaxfree); - - property_set("ro.hwui.texture_cache_size", "72"); - property_set("ro.hwui.layer_cache_size", "48"); - property_set("ro.hwui.r_buffer_cache_size", "8"); - property_set("ro.hwui.path_cache_size", "32"); - property_set("ro.hwui.gradient_cache_size", "1"); - property_set("ro.hwui.drop_shadow_cache_size", "6"); - property_set("ro.hwui.texture_cache_flushrate", "0.4"); - property_set("ro.hwui.text_small_cache_width", "1024"); - property_set("ro.hwui.text_small_cache_height", "1024"); - property_set("ro.hwui.text_large_cache_width", "2048"); - property_set("ro.hwui.text_large_cache_height", large_cache_height); - - if (buf.find("S88537AA1") != std::string::npos) { - property_set("ro.build.display.wtid", "SW_S88537AA1_V080_M20_MP_XM"); - } else if (buf.find("S88537AB1") != std::string::npos) { - property_set("ro.build.display.wtid", "SW_S88537AB1_V080_M20_MP_XM"); - } else if (buf.find("S88537AC1") != std::string::npos) { - property_set("ro.build.display.wtid", "SW_S88537AC1_V080_M20_MP_XM"); - } else if (buf.find("S88537BA1") != std::string::npos) { - property_set("ro.build.display.wtid", "SW_S88537BA1_V080_M20_MP_XM"); - } else if (buf.find("S88537CA1") != std::string::npos) { - property_set("ro.build.display.wtid", "SW_S88537CA1_V080_M20_MP_XM"); - } else if (buf.find("S88537EC1") != std::string::npos) { - property_set("ro.build.display.wtid", "SW_S88537EC1_V080_M20_MP_XM"); - } - - if (buf.find("S88537AB1") != std::string::npos) { - property_set("ro.product.model", "Redmi 3X"); - } else { - property_set("ro.product.model", "Redmi 3S"); - } -} diff --git a/keylayout/ft5x06_720p.kl b/keylayout/ft5x06_720p.kl deleted file mode 100644 index fa23e16..0000000 --- a/keylayout/ft5x06_720p.kl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2014, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of The Linux Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -key 158 BACK VIRTUAL -key 139 APP_SWITCH VIRTUAL -key 172 HOME VIRTUAL -key 217 SEARCH VIRTUAL diff --git a/keylayout/gf3208.kl b/keylayout/gf3208.kl deleted file mode 100644 index a0c1087..0000000 --- a/keylayout/gf3208.kl +++ /dev/null @@ -1,14 +0,0 @@ -# -# Goodix Fingerprint Touch sensor driver -# -# Copyright (c) 2013,2014 Fingerprint Cards AB -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License Version 2 -# as published by the Free Software Foundation. -# - -#key 96 CAMERA -#key 102 HOME -#key 105 DPAD_LEFT -#key 106 DPAD_RIGHT diff --git a/keylayout/gpio-keys.kl b/keylayout/gpio-keys.kl deleted file mode 100644 index 079fcd2..0000000 --- a/keylayout/gpio-keys.kl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2014, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of The Linux Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -key 115 VOLUME_UP -key 114 VOLUME_DOWN -key 102 HOME -key 528 FOCUS -key 766 CAMERA diff --git a/keylayout/uinput-fpc.kl b/keylayout/uinput-fpc.kl deleted file mode 100644 index e10c762..0000000 --- a/keylayout/uinput-fpc.kl +++ /dev/null @@ -1,14 +0,0 @@ -# -# FPC1020 Touch sensor driver -# -# Copyright (c) 2013,2014 Fingerprint Cards AB -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License Version 2 -# as published by the Free Software Foundation. -# - -#key 96 CAMERA -#key 102 HOME -#key 105 DPAD_LEFT -#key 106 DPAD_RIGHT diff --git a/libinit/init_land.cpp b/libinit/init_land.cpp new file mode 100644 index 0000000..a17b7e5 --- /dev/null +++ b/libinit/init_land.cpp @@ -0,0 +1,78 @@ +/* + Copyright (c) 2016, The CyanogenMod Project + Copyright (c) 2017, The LineageOS Project + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include "init_msm8937.h" + +#include "vendor_init.h" +#include "property_service.h" +#include "log.h" +#include "util.h" + +void init_target_properties() +{ + std::ifstream fin; + std::string buf; + + std::string product = property_get("ro.product.name"); + if (product.find("land") == std::string::npos) + return; + + fin.open("/proc/cmdline"); + while (std::getline(fin, buf, ' ')) + if (buf.find("board_id") != std::string::npos) + break; + fin.close(); + + if (buf.find("S88537AA1") != std::string::npos) { + property_set("ro.build.display.wtid", "SW_S88537AA1_V080_M20_MP_XM"); + } else if (buf.find("S88537AB1") != std::string::npos) { + property_set("ro.build.display.wtid", "SW_S88537AB1_V080_M20_MP_XM"); + } else if (buf.find("S88537AC1") != std::string::npos) { + property_set("ro.build.display.wtid", "SW_S88537AC1_V080_M20_MP_XM"); + } else if (buf.find("S88537BA1") != std::string::npos) { + property_set("ro.build.display.wtid", "SW_S88537BA1_V080_M20_MP_XM"); + } else if (buf.find("S88537CA1") != std::string::npos) { + property_set("ro.build.display.wtid", "SW_S88537CA1_V080_M20_MP_XM"); + } else if (buf.find("S88537EC1") != std::string::npos) { + property_set("ro.build.display.wtid", "SW_S88537EC1_V080_M20_MP_XM"); + } + + if (buf.find("S88537AB1") != std::string::npos) { + property_set("ro.product.model", "Redmi 3X"); + } else { + property_set("ro.product.model", "Redmi 3S"); + } +} diff --git a/lineage.dependencies b/lineage.dependencies index ca54c8a..21a5ba7 100644 --- a/lineage.dependencies +++ b/lineage.dependencies @@ -1,10 +1,6 @@ [ - { - "repository": "android_device_qcom_common", - "target_path": "device/qcom/common" - }, - { - "repository": "android_kernel_xiaomi_msm8937", - "target_path": "kernel/xiaomi/msm8937" - } + { + "repository": "android_device_xiaomi_msm8937-common", + "target_path": "device/xiaomi/msm8937-common" + } ] diff --git a/lineage.mk b/lineage.mk index 02fd0c2..219899f 100644 --- a/lineage.mk +++ b/lineage.mk @@ -23,7 +23,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) $(call inherit-product, vendor/cm/config/common_full_phone.mk) # Inherit from land device -$(call inherit-product, $(LOCAL_PATH)/device.mk) +$(call inherit-product, device/xiaomi/land/device.mk) PRODUCT_BRAND := Xiaomi PRODUCT_DEVICE := land diff --git a/overlay-lineage/frameworks/base/core/res/res/values/config.xml b/overlay-lineage/frameworks/base/core/res/res/values/config.xml deleted file mode 100644 index 99d600c..0000000 --- a/overlay-lineage/frameworks/base/core/res/res/values/config.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - 0 - - - true - - - true - - - 83 - - - 64 - - - 3 - - - 1 - - - true - - - true - diff --git a/overlay-lineage/packages/apps/CellBroadcastReceiver/res/values/config.xml b/overlay-lineage/packages/apps/CellBroadcastReceiver/res/values/config.xml deleted file mode 100644 index 2947af2..0000000 --- a/overlay-lineage/packages/apps/CellBroadcastReceiver/res/values/config.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - true - diff --git a/overlay-lineage/packages/apps/Dialer/res/values/config.xml b/overlay-lineage/packages/apps/Dialer/res/values/config.xml deleted file mode 100644 index bf0f160..0000000 --- a/overlay-lineage/packages/apps/Dialer/res/values/config.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - true - - 4 - diff --git a/overlay-lineage/vendor/cmsdk/cm/res/res/values/config.xml b/overlay-lineage/vendor/cmsdk/cm/res/res/values/config.xml deleted file mode 100644 index dbf1b47..0000000 --- a/overlay-lineage/vendor/cmsdk/cm/res/res/values/config.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - true - 100 - true - - - 11 - diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml deleted file mode 100644 index 9a55b52..0000000 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - - true - - - - 8 - 35 - 100 - 300 - 1500 - 3500 - 7000 - - - - - 10 - 20 - 40 - 70 - 110 - 160 - 200 - 255 - - - - 1 - - - 1 - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - - wifi,1,1,1,-1,true - mobile,0,0,0,-1,true - mobile_mms,2,0,4,300000,true - mobile_supl,3,0,2,300000,true - mobile_dun,4,0,2,300000,true - mobile_hipri,5,0,3,300000,true - mobile_fota,10,0,2,300000,true - mobile_ims,11,0,2,300000,true - mobile_cbs,12,0,2,300000,true - bluetooth,7,7,2,-1,true - ethernet,9,9,4,-1,true - - - - - - 1,1 - 0,1 - 7,1 - 9,1 - - - - - usb\\d - rndis\\d - - - - - wlan0 - - - - - bnep\\d - bt-pan - - - - - - 0 - 1 - 4 - 5 - 7 - - - - - true - - - Android-Mms/2.0 - - - http://www.google.com/oha/rdf/ua-profile-kila.xml - - - true - - - true - - - true - - - true - - - true - - - true - - - false - - - true - - - - 0 - 28 - 10 - - - - - 0 - 28 - 8 - - - - - 28 - - - - com.google.android.gms - - - com.android.systemui/com.android.systemui.doze.DozeService - - - true - - - 17 - - - true - - - - umts:4094,87380,110208,4096,16384,110208 - hspa:4094,87380,1220608,4096,16384,1220608 - hsupa:4094,87380,1220608,4096,16384,1220608 - hsdpa:4094,87380,1220608,4096,16384,1220608 - hspap:4094,87380,1220608,4096,16384,1220608 - edge:4093,26280,35040,4096,16384,350406 - gprs:4092,8760,11680,4096,8760,11680 - evdo:4094,87380,524288,4096,16384,262144 - lte:2097152,4194304,8388608,262144,524288,1048576 - - - - 524288,2097152,4194304,262144,524288,1048576 - - - true - - - 3700 - - - true - diff --git a/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/overlay/frameworks/base/core/res/res/xml/power_profile.xml deleted file mode 100644 index d9e01f9..0000000 --- a/overlay/frameworks/base/core/res/res/xml/power_profile.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - 63 - 261 - - 200000 - 499200 - 533333 - 800000 - 998400 - 1094400 - 1209600 - - - 151 - 169 - 177 - 195 - 259 - 307 - 353 - - 1.6 - 1.6 - 4000 - diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml deleted file mode 100644 index ac7a774..0000000 --- a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - true - diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml deleted file mode 100644 index a13684c..0000000 --- a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - true - diff --git a/overlay/frameworks/opt/telephony/resources/res/values/config.xml b/overlay/frameworks/opt/telephony/resources/res/values/config.xml deleted file mode 100644 index 0846f84..0000000 --- a/overlay/frameworks/opt/telephony/resources/res/values/config.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - qti-telephony-common.jar - - - com.qti.internal.telephony.QtiTelephonyPlugin - diff --git a/overlay/packages/apps/Bluetooth/res/values/config.xml b/overlay/packages/apps/Bluetooth/res/values/config.xml deleted file mode 100644 index 22bd9b2..0000000 --- a/overlay/packages/apps/Bluetooth/res/values/config.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - true - true - true - true - true - - - false - diff --git a/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml b/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml deleted file mode 100644 index 0d84223..0000000 --- a/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml +++ /dev/null @@ -1,501 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/overlay/packages/apps/CellBroadcastReceiver/res/values/config.xml b/overlay/packages/apps/CellBroadcastReceiver/res/values/config.xml deleted file mode 100644 index 95369dd..0000000 --- a/overlay/packages/apps/CellBroadcastReceiver/res/values/config.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - true - - - true - diff --git a/overlay/packages/apps/Settings/res/values-mcc001-mnc10/config.xml b/overlay/packages/apps/Settings/res/values-mcc001-mnc10/config.xml deleted file mode 100644 index 792c48a..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc001-mnc10/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - true - diff --git a/overlay/packages/apps/Settings/res/values-mcc311-mnc390/config.xml b/overlay/packages/apps/Settings/res/values-mcc311-mnc390/config.xml deleted file mode 100644 index 792c48a..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc311-mnc390/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - true - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc840/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc840/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc840/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc857/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc857/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc857/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc858/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc858/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc858/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc859/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc859/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc859/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc862/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc862/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc862/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc863/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc863/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc863/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc864/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc864/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc864/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc867/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc867/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc867/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc868/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc868/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc868/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Settings/res/values-mcc405-mnc871/config.xml b/overlay/packages/apps/Settings/res/values-mcc405-mnc871/config.xml deleted file mode 100644 index 530c79c..0000000 --- a/overlay/packages/apps/Settings/res/values-mcc405-mnc871/config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - false - diff --git a/overlay/packages/apps/Snap/res/values/config.xml b/overlay/packages/apps/Snap/res/values/config.xml deleted file mode 100644 index 4f2e10d..0000000 --- a/overlay/packages/apps/Snap/res/values/config.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - true - - - true - - diff --git a/overlay/packages/apps/Snap/res/values/qcomstrings.xml b/overlay/packages/apps/Snap/res/values/qcomstrings.xml deleted file mode 100644 index d477e42..0000000 --- a/overlay/packages/apps/Snap/res/values/qcomstrings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - false - diff --git a/overlay/packages/services/Telephony/res/values-mcc460-mnc7/config.xml b/overlay/packages/services/Telephony/res/values-mcc460-mnc7/config.xml deleted file mode 100644 index b88f01e..0000000 --- a/overlay/packages/services/Telephony/res/values-mcc460-mnc7/config.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - false - diff --git a/overlay/packages/services/Telephony/res/values/config.xml b/overlay/packages/services/Telephony/res/values/config.xml deleted file mode 100644 index ac91af0..0000000 --- a/overlay/packages/services/Telephony/res/values/config.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - true - - - - true - - - true - - - true - - - true - diff --git a/product/ant.mk b/product/ant.mk deleted file mode 100644 index d97c4a2..0000000 --- a/product/ant.mk +++ /dev/null @@ -1,9 +0,0 @@ -# ANT -PRODUCT_PACKAGES += \ - AntHalService \ - com.dsi.ant.antradio_library \ - libantradio - -# Permissions -PRODUCT_COPY_FILES += \ - external/ant-wireless/antradio-library/com.dsi.ant.antradio_library.xml:system/etc/permissions/com.dsi.ant.antradio_library.xml diff --git a/product/bluetooth.mk b/product/bluetooth.mk deleted file mode 100644 index 6ebd8c7..0000000 --- a/product/bluetooth.mk +++ /dev/null @@ -1,12 +0,0 @@ -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \ - frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml - -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - qcom.bluetooth.soc=smd \ - ro.bluetooth.dun=true \ - ro.bluetooth.hfp.ver=1.7 \ - ro.bluetooth.sap=true \ - ro.qualcomm.bt.hci_transport=smd diff --git a/product/camera.mk b/product/camera.mk deleted file mode 100644 index c72d1f1..0000000 --- a/product/camera.mk +++ /dev/null @@ -1,6 +0,0 @@ -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \ - frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \ - frameworks/native/data/etc/android.hardware.camera.full.xml:system/etc/permissions/android.hardware.camera.full.xml \ - frameworks/native/data/etc/android.hardware.camera.raw.xml:system/etc/permissions/android.hardware.camera.raw.xml diff --git a/product/cne.mk b/product/cne.mk deleted file mode 100644 index 2d1a0e6..0000000 --- a/product/cne.mk +++ /dev/null @@ -1,3 +0,0 @@ -# CNE -PRODUCT_PROPERTY_OVERRIDES += \ - persist.cne.feature=1 diff --git a/product/consumerir.mk b/product/consumerir.mk deleted file mode 100644 index e878bcf..0000000 --- a/product/consumerir.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.consumerir.xml:system/etc/permissions/android.hardware.consumerir.xml diff --git a/product/display.mk b/product/display.mk deleted file mode 100644 index b086c48..0000000 --- a/product/display.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Boot animation -TARGET_SCREEN_HEIGHT := 1280 -TARGET_SCREEN_WIDTH := 720 - -# This device is xhdpi. However the platform doesn't -# currently contain all of the bitmaps at xhdpi density so -# we do this little trick to fall back to the hdpi version -# if the xhdpi doesn't exist. -PRODUCT_AAPT_CONFIG := normal -PRODUCT_AAPT_PREF_CONFIG := xhdpi -# A list of dpis to select prebuilt apk, in precedence order. -PRODUCT_AAPT_PREBUILT_DPI := hdpi - -# Ambient display -PRODUCT_PACKAGES += \ - CMDoze - -# Display calibration -PRODUCT_PACKAGES += \ - libjni_livedisplay - -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.opengles.aep.xml:system/etc/permissions/android.hardware.opengles.aep.xml - -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - ro.opengles.version=196610 \ - ro.sf.lcd_density=320 diff --git a/product/filesystem.mk b/product/filesystem.mk deleted file mode 100644 index b131a3a..0000000 --- a/product/filesystem.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Fs_config -PRODUCT_PACKAGES += \ - fs_config_files diff --git a/product/fingerprint.mk b/product/fingerprint.mk deleted file mode 100644 index cc3aa99..0000000 --- a/product/fingerprint.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Fingerprint -PRODUCT_PACKAGES += \ - fingerprintd - -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc/permissions/android.hardware.fingerprint.xml diff --git a/product/init.mk b/product/init.mk index e8a1238..12b9f27 100644 --- a/product/init.mk +++ b/product/init.mk @@ -1,15 +1,3 @@ -# Init scripts +# Ramdisk PRODUCT_PACKAGES += \ - fstab.qcom \ - init.qcom.rc \ - init.target.rc \ - init.qcom.power.rc \ - init.qcom.usb.rc \ - init.recovery.qcom.rc \ - ueventd.qcom.rc - -PRODUCT_PACKAGES += \ - init.qcom.bt.sh - -PRODUCT_PACKAGES += \ - init.qcom.sh + init.device.rc diff --git a/product/irq.mk b/product/irq.mk deleted file mode 100644 index 66fadac..0000000 --- a/product/irq.mk +++ /dev/null @@ -1,3 +0,0 @@ -# IRQ -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/configs/msm_irqbalance.conf:system/vendor/etc/msm_irqbalance.conf diff --git a/product/keylayout.mk b/product/keylayout.mk index 879920f..6cecc3a 100644 --- a/product/keylayout.mk +++ b/product/keylayout.mk @@ -1,13 +1,4 @@ # Keylayouts PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/keylayout/ft5x06_720p.kl:system/usr/keylayout/ft5x06_720p.kl \ $(DEVICE_PATH)/keylayout/ist30xx_ts_input.kl:system/usr/keylayout/ist30xx_ts_input.kl \ - $(DEVICE_PATH)/keylayout/gf3208.kl:system/usr/keylayout/gf3208.kl \ - $(DEVICE_PATH)/keylayout/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \ - $(DEVICE_PATH)/keylayout/msm8952-sku1-snd-card_Button_Jack.kl:system/usr/keylayout/msm8952-sku1-snd-card_Button_Jack.kl \ - $(DEVICE_PATH)/keylayout/uinput-fpc.kl:system/usr/keylayout/uinput-fpc.kl - -# IDC -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/idc/gf3208.idc:system/usr/idc/gf3208.idc \ - $(DEVICE_PATH)/idc/uinput-fpc.idc:system/usr/idc/uinput-fpc.idc + $(DEVICE_PATH)/keylayout/msm8952-sku1-snd-card_Button_Jack.kl:system/usr/keylayout/msm8952-sku1-snd-card_Button_Jack.kl diff --git a/product/lights.mk b/product/lights.mk deleted file mode 100644 index b54aa8c..0000000 --- a/product/lights.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Lights -PRODUCT_PACKAGES += \ - lights.msm8937 diff --git a/product/media.mk b/product/media.mk deleted file mode 100644 index ace6a34..0000000 --- a/product/media.mk +++ /dev/null @@ -1,18 +0,0 @@ -# Media -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/configs/media_codecs.xml:system/etc/media_codecs.xml \ - $(DEVICE_PATH)/configs/media_codecs_performance.xml:system/etc/media_codecs_performance.xml \ - $(DEVICE_PATH)/configs/media_profiles.xml:system/etc/media_profiles.xml - -PRODUCT_COPY_FILES += \ - frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml - -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - mm.enable.smoothstreaming=true \ - media.aac_51_output_enabled=true \ - vidc.enc.narrow.searchrange=1 \ - vidc.disable.split.mode=1 \ - drm.service.enabled=true diff --git a/product/perf.mk b/product/perf.mk deleted file mode 100644 index 271af96..0000000 --- a/product/perf.mk +++ /dev/null @@ -1,4 +0,0 @@ -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - ro.am.reschedule_service=true \ - ro.sys.fw.use_trim_settings=true diff --git a/product/qcom-audio.mk b/product/qcom-audio.mk index d7c5e5e..f068617 100644 --- a/product/qcom-audio.mk +++ b/product/qcom-audio.mk @@ -1,72 +1,3 @@ -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \ - # Audio -PRODUCT_PACKAGES += \ - audiod \ - audio.a2dp.default \ - audio.primary.msm8937 \ - audio.r_submix.default \ - audio.usb.default \ - libaudio-resampler \ - libqcomvisualizer \ - libqcomvoiceprocessing \ - libqcompostprocbundle \ - tinymix - -# Audio configuration PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/audio/audio_policy.conf:system/etc/audio_policy.conf \ - $(DEVICE_PATH)/audio/audio_output_policy.conf:system/vendor/etc/audio_output_policy.conf \ - $(DEVICE_PATH)/audio/audio_effects.conf:system/vendor/etc/audio_effects.conf \ - $(DEVICE_PATH)/audio/mixer_paths_qrd_sku1.xml:system/etc/mixer_paths_qrd_sku1.xml \ - $(DEVICE_PATH)/audio/sound_trigger_mixer_paths.xml:system/etc/sound_trigger_mixer_paths.xml \ - $(DEVICE_PATH)/audio/sound_trigger_platform_info.xml:system/etc/sound_trigger_platform_info.xml \ - $(DEVICE_PATH)/audio/audio_platform_info.xml:system/etc/audio_platform_info.xml \ - $(DEVICE_PATH)/audio/aanc_tuning_mixer.txt:system/etc/aanc_tuning_mixer.txt - -# XML Audio configuration files -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/audio/audio_policy_configuration.xml:system/etc/audio_policy_configuration.xml \ - $(TOPDIR)frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:/system/etc/a2dp_audio_policy_configuration.xml \ - $(TOPDIR)frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:/system/etc/audio_policy_volumes.xml \ - $(TOPDIR)frameworks/av/services/audiopolicy/config/default_volume_tables.xml:/system/etc/default_volume_tables.xml \ - $(TOPDIR)frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:/system/etc/r_submix_audio_policy_configuration.xml \ - $(TOPDIR)frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:/system/etc/usb_audio_policy_configuration.xml - -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - voice.playback.conc.disabled=true \ - voice.record.conc.disabled=false \ - voice.voip.conc.disabled=true \ - voice.conc.fallbackpath=deep-buffer \ - audio.parser.ip.buffer.size=262144 \ - audio_hal.period_size=192 \ - ro.qc.sdk.audio.ssr=false \ - ro.qc.sdk.audio.fluencetype=fluence \ - persist.audio.fluence.voicecall=true \ - persist.audio.fluence.voicerec=false \ - persist.audio.fluence.speaker=true \ - tunnel.audio.encode=false \ - audio.offload.buffer.size.kb=64 \ - audio.offload.min.duration.secs=30 \ - audio.offload.video=true \ - audio.offload.pcm.16bit.enable=true \ - audio.offload.pcm.24bit.enable=true \ - audio.offload.track.enable=true \ - audio.deep_buffer.media=true \ - audio.playback.mch.downsample=true \ - use.voice.path.for.pcm.voip=true \ - use.qti.sw.alac.decoder=true \ - use.qti.sw.ape.decoder=true \ - audio.offload.gapless.enabled=true \ - audio.offload.multiple.enabled=false \ - audio.safx.pbe.enabled=true \ - audio.pp.asphere.enabled=false \ - audio.dolby.ds2.enabled=true \ - audio.dolby.ds2.hardbypass=true \ - af.fast_track_multiplier=1 \ - persist.speaker.prot.enable=false \ - audio.offload.multiaac.enable=true \ - flac.sw.decoder.24bit.support=true \ - audio.offload.passthrough=false + $(DEVICE_PATH)/audio/audio_platform_info.xml:system/etc/audio_platform_info.xml diff --git a/product/qcom-camera.mk b/product/qcom-camera.mk index df29d3a..65c267e 100644 --- a/product/qcom-camera.mk +++ b/product/qcom-camera.mk @@ -1,16 +1,8 @@ # Camera PRODUCT_PACKAGES += \ camera.msm8937 \ - libshims_camera \ - Snap + libshims_camera # Properties PRODUCT_PROPERTY_OVERRIDES += \ - camera.display.umax=1920x1080 \ - camera.display.lmax=1280x720 \ - camera.hal1.packagelist=com.skype.raider,com.google.android.talk \ - media.camera.ts.monotonic=0 \ - persist.camera.gyro.android=1 \ - persist.camera.HAL3.enabled=0 \ - persist.camera.is_type=1 \ - vidc.enc.narrow.searchrange=1 + media.camera.ts.monotonic=0 diff --git a/product/qcom-display.mk b/product/qcom-display.mk deleted file mode 100644 index 74e9313..0000000 --- a/product/qcom-display.mk +++ /dev/null @@ -1,22 +0,0 @@ -# Display -PRODUCT_PACKAGES += \ - copybit.msm8937 \ - gralloc.msm8937 \ - hwcomposer.msm8937 \ - libtinyxml \ - memtrack.msm8937 - -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - debug.gralloc.enable_fb_ubwc=1 \ - debug.enable.sglscale=1 \ - debug.mdpcomp.logs=0 \ - dev.pm.dyn_samplingrate=1 \ - persist.demo.hdmirotationlock=false \ - persist.hwc.enable_vds=1 \ - persist.hwc.mdpcomp.enable=true - -# Vulkan -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:system/etc/permissions/android.hardware.vulkan.level-0.xml \ - frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:system/etc/permissions/android.hardware.vulkan.version-1_0_3.xml diff --git a/product/qcom-fm.mk b/product/qcom-fm.mk deleted file mode 100644 index f99ff6b..0000000 --- a/product/qcom-fm.mk +++ /dev/null @@ -1,8 +0,0 @@ -# FM -PRODUCT_PACKAGES += \ - FMRadio \ - libfmjni - -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - ro.fm.transmitter=false diff --git a/product/qcom-gps.mk b/product/qcom-gps.mk deleted file mode 100644 index ed6f7cc..0000000 --- a/product/qcom-gps.mk +++ /dev/null @@ -1,20 +0,0 @@ -# GPS -PRODUCT_PACKAGES += \ - gps.msm8937 \ - libcurl \ - libgnsspps - -PRODUCT_BOOT_JARS += \ - com.qti.location.sdk - -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/gps/etc/flp.conf:system/etc/flp.conf \ - $(DEVICE_PATH)/gps/etc/gps.conf:system/etc/gps.conf \ - $(DEVICE_PATH)/gps/etc/izat.conf:system/etc/izat.conf \ - $(DEVICE_PATH)/gps/etc/lowi.conf:system/etc/lowi.conf \ - $(DEVICE_PATH)/gps/etc/sap.conf:system/etc/sap.conf \ - $(DEVICE_PATH)/gps/etc/xtwifi.conf:system/etc/xtwifi.conf - -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml diff --git a/product/qcom-media.mk b/product/qcom-media.mk deleted file mode 100644 index 6211acf..0000000 --- a/product/qcom-media.mk +++ /dev/null @@ -1,10 +0,0 @@ -# Media -PRODUCT_PACKAGES += \ - libOmxAacEnc \ - libOmxAmrEnc \ - libOmxCore \ - libOmxEvrcEnc \ - libOmxQcelp13Enc \ - libOmxVdec \ - libOmxVenc \ - libstagefrighthw diff --git a/product/qcom-perf.mk b/product/qcom-perf.mk deleted file mode 100644 index db43a7e..0000000 --- a/product/qcom-perf.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Power -PRODUCT_PACKAGES += \ - power.msm8937 - -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - ro.vendor.extension_library=libqti-perfd-client.so diff --git a/product/qcom-radio.mk b/product/qcom-radio.mk index 47ef46a..a4755ba 100644 --- a/product/qcom-radio.mk +++ b/product/qcom-radio.mk @@ -1,51 +1,3 @@ -# IRSC -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/configs/sec_config:system/etc/sec_config - -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \ - frameworks/native/data/etc/android.hardware.telephony.cdma.xml:system/etc/permissions/android.hardware.telephony.cdma.xml \ - frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml - -PRODUCT_PACKAGES += \ - libjson - # Properties PRODUCT_PROPERTY_OVERRIDES += \ - DEVICE_PROVISIONED=1 \ - persist.data.iwlan.enable=true \ - persist.data.mode=concurrent \ - persist.data.netmgrd.qos.enable=true \ - persist.dbg.volte_avail_ovr=1 \ - persist.dbg.ims_volte_enable=1 \ - persist.dbg.wfc_avail_ovr=1 \ - persist.radio.calls.on.ims=true \ - persist.radio.csvt.enabled=false \ - persist.radio.custom_ecc=0 \ - persist.radio.jbims=0 \ - persist.dbg.vt_avail_ovr=1 \ - persist.radio.DROPSETENABLE=1 \ - persist.radio.apm_sim_not_pwdn=1 \ - persist.radio.custom_ecc=1 \ - persist.radio.force_on_dc=true \ - persist.radio.ignore_dom_time=5 \ - persist.radio.mt_sms_ack=20 \ - persist.radio.multisim.config=dsds \ - persist.radio.rat_on=combine \ - persist.radio.sib16_support=1 \ - ril.ecclist=100,101,102,108,112 \ - ril.subscription.types=NV,RUIM \ - rild.libpath=/vendor/lib64/libril-qc-qmi-1.so \ - ro.ct.device.model=XMP-2016030 \ - ro.telephony.call_ring.multiple=false \ - ro.telephony.default_network=20 \ - ro.use_data_netmgrd=true \ - service.qti.ims.enabled=1 \ - telephony.lteOnCdmaDevice=1 - -# Radio -PRODUCT_PACKAGES += \ - libcnefeatureconfig \ - librmnetctl \ - libxml2 + ro.ct.device.model=XMP-2016030 diff --git a/product/qcom-thermal.mk b/product/qcom-thermal.mk deleted file mode 100644 index 0b32e1a..0000000 --- a/product/qcom-thermal.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Thermal -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/configs/thermal-engine.conf:system/etc/thermal-engine.conf diff --git a/product/sdcardfs.mk b/product/sdcardfs.mk deleted file mode 100644 index bf6acd6..0000000 --- a/product/sdcardfs.mk +++ /dev/null @@ -1,3 +0,0 @@ -# SdcardFs -PRODUCT_PROPERTY_OVERRIDES += \ - ro.sys.sdcardfs=true diff --git a/product/sensors.mk b/product/sensors.mk deleted file mode 100644 index d6cd2a2..0000000 --- a/product/sensors.mk +++ /dev/null @@ -1,18 +0,0 @@ -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \ - frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \ - frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ - frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \ - frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \ - frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:system/etc/permissions/android.hardware.sensor.stepcounter.xml \ - frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:system/etc/permissions/android.hardware.sensor.stepdetector.xml \ - frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml - -# Sensors -PRODUCT_PACKAGES += \ - sensors.msm8937 - -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/configs/sensors/hals.conf:system/etc/sensors/hals.conf \ - $(DEVICE_PATH)/configs/sensors/sensor_def_qcomdev.conf:system/etc/sensors/sensor_def_qcomdev.conf diff --git a/product/touchscreen.mk b/product/touchscreen.mk deleted file mode 100644 index 9a5b3e6..0000000 --- a/product/touchscreen.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml diff --git a/product/usb.mk b/product/usb.mk deleted file mode 100644 index 08fffbb..0000000 --- a/product/usb.mk +++ /dev/null @@ -1,9 +0,0 @@ -# Init scripts -PRODUCT_PACKAGES += \ - init.qcom.usb.sh - -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \ - frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \ - frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml diff --git a/product/wifi.mk b/product/wifi.mk deleted file mode 100644 index f7c9494..0000000 --- a/product/wifi.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Permissions -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml \ - frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml - -# Wi-Fi -PRODUCT_PACKAGES += \ - hostapd \ - wpa_supplicant \ - wpa_supplicant.conf - -PRODUCT_PACKAGES += \ - libQWiFiSoftApCfg - -# Properties -PRODUCT_PROPERTY_OVERRIDES += \ - wifi.interface=wlan0 - -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/wifi/hostapd.accept:system/etc/hostapd/hostapd.accept \ - $(DEVICE_PATH)/wifi/hostapd_default.conf:system/etc/hostapd/hostapd_default.conf \ - $(DEVICE_PATH)/wifi/hostapd.deny:system/etc/hostapd/hostapd.deny \ - $(DEVICE_PATH)/wifi/p2p_supplicant_overlay.conf:system/etc/wifi/p2p_supplicant_overlay.conf \ - $(DEVICE_PATH)/wifi/wpa_supplicant_overlay.conf:system/etc/wifi/wpa_supplicant_overlay.conf - -PRODUCT_COPY_FILES += \ - $(DEVICE_PATH)/wifi/fstman.ini:system/etc/wifi/fstman.ini \ - $(DEVICE_PATH)/wifi/firmware/WCNSS_cfg.dat:system/etc/firmware/wlan/prima/WCNSS_cfg.dat \ - $(DEVICE_PATH)/wifi/firmware/WCNSS_qcom_cfg.ini:system/etc/wifi/WCNSS_qcom_cfg.ini diff --git a/proprietary-files-qc.txt b/proprietary-files-qc.txt deleted file mode 100644 index 9c4b40f..0000000 --- a/proprietary-files-qc.txt +++ /dev/null @@ -1,516 +0,0 @@ -# ADSP - from santoni (Redmi 4X) -bin/adsprpcd -vendor/lib/libadsp_default_listener.so -vendor/lib/libadsprpc.so -vendor/lib/libfastcvadsp_stub.so -vendor/lib/libfastcvopt.so -vendor/lib64/libadsp_default_listener.so -vendor/lib64/libadsprpc.so -vendor/lib64/libfastcvadsp_stub.so -vendor/lib64/libfastcvopt.so - -# ADSP modules - from santoni (Redmi 4X) -vendor/lib/rfsa/adsp/libapps_mem_heap.so -vendor/lib/rfsa/adsp/libdspCV_skel.so -vendor/lib/rfsa/adsp/libfastcvadsp.so -vendor/lib/rfsa/adsp/libfastcvadsp_skel.so -vendor/lib/rfsa/adsp/libFastRPC_AUE_Forward_skel.so -vendor/lib/rfsa/adsp/libFastRPC_UTF_Forward_skel.so -vendor/lib/rfsa/adsp/libobjectMattingApp_skel.so -vendor/lib/rfsa/adsp/libscveBlobDescriptor_skel.so -vendor/lib/rfsa/adsp/libscveCleverCapture_skel.so -vendor/lib/rfsa/adsp/libscveObjectSegmentation_skel.so -vendor/lib/rfsa/adsp/libscveT2T_skel.so -vendor/lib/rfsa/adsp/libscveTextReco_skel.so - -# Audio - from santoni (Redmi 4X) -etc/drc/drc_cfg_5.1.txt -etc/drc/drc_cfg_AZ.txt -etc/surround_sound_3mic/surround_sound_rec_5.1.cfg -etc/surround_sound_3mic/surround_sound_rec_AZ.cfg -vendor/lib/libacdb-fts.so -vendor/lib/libacdbloader.so -vendor/lib/libacdbmapper.so -vendor/lib/libacdbrtac.so -vendor/lib/libadiertac.so -vendor/lib/libadm.so -vendor/lib/libaudcal.so -vendor/lib/libaudioalsa.so -vendor/lib/libaudiodevarb.so -vendor/lib/libdrc.so -vendor/lib/libqct_resampler.so -vendor/lib/libsurround_3mic_proc.so -vendor/lib/soundfx/libqcbassboost.so -vendor/lib/soundfx/libqcreverb.so -vendor/lib/soundfx/libqcvirt.so -vendor/lib64/libacdb-fts.so -vendor/lib64/libacdbloader.so -vendor/lib64/libacdbmapper.so -vendor/lib64/libacdbrtac.so -vendor/lib64/libadiertac.so -vendor/lib64/libaudcal.so -vendor/lib64/libaudioalsa.so -vendor/lib64/libaudiodevarb.so -vendor/lib64/soundfx/libqcbassboost.so -vendor/lib64/soundfx/libqcreverb.so -vendor/lib64/soundfx/libqcvirt.so - -# CNE - from santoni (Redmi 4X) --priv-app/CNEService/CNEService.apk -bin/cnd -etc/cne/SwimConfig.xml -etc/cne/andsfCne.xml -etc/cne/wqeclient/ATT/ATT_profile1.xml -etc/cne/wqeclient/ATT/ATT_profile2.xml -etc/cne/wqeclient/ATT/ATT_profile3.xml -etc/cne/wqeclient/ATT/ATT_profile4.xml -etc/cne/wqeclient/ROW/ROW_profile1.xml -etc/cne/wqeclient/ROW/ROW_profile2.xml -etc/cne/wqeclient/ROW/ROW_profile3.xml -etc/cne/wqeclient/ROW/ROW_profile4.xml -etc/cne/wqeclient/ROW/ROW_profile5.xml -etc/cne/wqeclient/VZW/VZW_profile1.xml -etc/cne/wqeclient/VZW/VZW_profile2.xml -etc/cne/wqeclient/VZW/VZW_profile3.xml -etc/cne/wqeclient/VZW/VZW_profile4.xml -etc/cne/wqeclient/VZW/VZW_profile5.xml -etc/cne/wqeclient/VZW/VZW_profile6.xml -etc/permissions/ConnectivityExt.xml -etc/permissions/cneapiclient.xml -etc/permissions/com.quicinc.cne.xml -framework/ConnectivityExt.jar -framework/cneapiclient.jar -framework/com.quicinc.cne.jar -vendor/lib/libcne.so -vendor/lib/libcneapiclient.so -vendor/lib/libcneqmiutils.so -vendor/lib/libvendorconn.so -vendor/lib/libwqe.so -vendor/lib/libxml.so -vendor/lib64/libcne.so -vendor/lib64/libcneapiclient.so -vendor/lib64/libcneqmiutils.so -vendor/lib64/libvendorconn.so -vendor/lib64/libwqe.so -vendor/lib64/libxml.so - -# Charger - from santoni (Redmi 4X) -bin/hvdcp_opti - -# Consumer IR - from santoni (Redmi 4X) -lib/hw/consumerir.default.so -lib64/hw/consumerir.default.so - -# DPM - from santoni (Redmi 4X) -bin/dpmd -etc/dpm/dpm.conf -etc/dpm/nsrm/NsrmConfiguration.xml -etc/permissions/com.qti.dpmframework.xml -etc/permissions/dpmapi.xml -framework/com.qti.dpmframework.jar -framework/dpmapi.jar -framework/tcmclient.jar -vendor/lib/libdpmctmgr.so -vendor/lib/libdpmfdmgr.so -vendor/lib/libdpmframework.so -vendor/lib/libdpmnsrm.so -vendor/lib/libdpmtcm.so -vendor/lib64/libdpmctmgr.so -vendor/lib64/libdpmfdmgr.so -vendor/lib64/libdpmframework.so -vendor/lib64/libdpmnsrm.so -vendor/lib64/libdpmtcm.so - -# DRM - from santoni (Redmi 4X) -bin/qseecomd -vendor/bin/qseeproxydaemon -vendor/lib/libQSEEComAPI.so -vendor/lib/libcppf.so -vendor/lib64/lib-sec-disp.so -vendor/lib64/libGPTEE.so -vendor/lib64/libGPreqcancel.so -vendor/lib64/libGPreqcancel_svc.so -vendor/lib64/libQSEEComAPI.so -vendor/lib64/libSecureUILib.so -vendor/lib64/libStDrvInt.so -vendor/lib64/libdrmfs.so -vendor/lib64/libdrmtime.so -vendor/lib64/libqisl.so -vendor/lib64/librpmb.so -vendor/lib64/libsecureui.so -vendor/lib64/libsecureui_svcsock.so -vendor/lib64/libsecureuisvc_jni.so -vendor/lib64/libssd.so -vendor/lib64/libtzdrmgenprov.so - -# Gatekeeper - from santoni (Redmi 4X) -vendor/lib/hw/gatekeeper.msm8937.so -vendor/lib64/hw/gatekeeper.msm8937.so - -# GPS - from garlic (YUREKA BLACK) --framework/com.qti.location.sdk.jar --framework/com.qualcomm.location.vzw_library.jar --framework/izat.xt.srv.jar --lib64/libloc_api_v02.so --lib64/libloc_ds_api.so --priv-app/com.qualcomm.location/com.qualcomm.location.apk -bin/loc_launcher -bin/lowi-server -bin/xtwifi-client -bin/xtwifi-inet-agent -etc/permissions/com.qti.location.sdk.xml -etc/permissions/com.qualcomm.location.vzw_library.xml -etc/permissions/com.qualcomm.location.xml -etc/permissions/izat.xt.srv.xml -etc/xtra_root_cert.pem -vendor/bin/slim_daemon -vendor/lib64/hw/flp.default.so -vendor/lib64/libalarmservice_jni.so -vendor/lib64/libasn1cper.so -vendor/lib64/libasn1crt.so -vendor/lib64/libasn1crtx.so -vendor/lib64/libdataitems.so -vendor/lib64/libDRPlugin.so -vendor/lib64/libdrplugin_client.so -vendor/lib64/libevent_observer.so -vendor/lib64/libflp.so -vendor/lib64/libgdtap.so -vendor/lib64/libgeofence.so -vendor/lib64/libizat_client_api.so -vendor/lib64/libizat_core.so -vendor/lib64/liblbs_core.so -vendor/lib64/libloc_ext.so -vendor/lib64/libloc_externalDr.so -vendor/lib64/liblocationservice.so -vendor/lib64/liblocationservice_glue.so -vendor/lib64/liblowi_client.so -vendor/lib64/liblowi_wifihal.so -vendor/lib64/liblowi_wifihal_nl.so -vendor/lib64/libslimclient.so -vendor/lib64/libulp2.so -vendor/lib64/libxt_native.so -vendor/lib64/libxtadapter.so -vendor/lib64/libxtwifi_ulp_adaptor.so - -# Graphics - from santoni (Redmi 4X) --vendor/lib/libsdm-disp-apis.so -vendor/lib/egl/eglsubAndroid.so -vendor/lib/egl/eglSubDriverAndroid.so -vendor/lib/egl/libEGL_adreno.so -vendor/lib/egl/libESXEGL_adreno.so -vendor/lib/egl/libESXGLESv1_CM_adreno.so -vendor/lib/egl/libESXGLESv2_adreno.so -vendor/lib/egl/libGLESv1_CM_adreno.so -vendor/lib/egl/libGLESv2_adreno.so -vendor/lib/egl/libQTapGLES.so -vendor/lib/egl/libRBEGL_adreno.so -vendor/lib/egl/libRBGLESv1_CM_adreno.so -vendor/lib/egl/libRBGLESv2_adreno.so -vendor/lib/egl/libq3dtools_adreno.so -vendor/lib/egl/libq3dtools_esx.so -vendor/lib/hw/vulkan.msm8937.so -vendor/lib/libC2D2.so -vendor/lib/libCB.so -vendor/lib/libOpenCL.so -vendor/lib/libRSDriver_adreno.so -vendor/lib/libadreno_utils.so -vendor/lib/libbccQTI.so -vendor/lib/libc2d30-a3xx.so -vendor/lib/libc2d30-a4xx.so -vendor/lib/libc2d30-a5xx.so -vendor/lib/libc2d30_bltlib.so -vendor/lib/libgsl.so -vendor/lib/libllvm-glnext.so -vendor/lib/libllvm-qcom.so -vendor/lib/libllvm-qgl.so -vendor/lib/libmm-disp-apis.so -vendor/lib/libmm-hdcpmgr.so -vendor/lib/libmm-qdcm.so -vendor/lib/libmmQSM.so -vendor/lib/librs_adreno.so -vendor/lib/librs_adreno_sha1.so -vendor/lib/libsc-a2xx.so -vendor/lib/libsc-a3xx.so -vendor/lib/libscalar.so -vendor/lib/libscale.so -vendor/lib/libsdm-color.so -vendor/lib/libsdm-diag.so -vendor/lib/libsdmextension.so -vendor/lib/libsd_sdk_display.so -vendor/lib64/egl/eglsubAndroid.so -vendor/lib64/egl/eglSubDriverAndroid.so -vendor/lib64/egl/libEGL_adreno.so -vendor/lib64/egl/libESXEGL_adreno.so -vendor/lib64/egl/libESXGLESv1_CM_adreno.so -vendor/lib64/egl/libESXGLESv2_adreno.so -vendor/lib64/egl/libGLESv1_CM_adreno.so -vendor/lib64/egl/libGLESv2_adreno.so -vendor/lib64/egl/libQTapGLES.so -vendor/lib64/egl/libq3dtools_adreno.so -vendor/lib64/egl/libq3dtools_esx.so -vendor/lib64/egl/libRBEGL_adreno.so -vendor/lib64/egl/libRBGLESv1_CM_adreno.so -vendor/lib64/egl/libRBGLESv2_adreno.so -vendor/lib64/hw/vulkan.msm8937.so --vendor/lib64/libsdm-disp-apis.so -vendor/lib64/libC2D2.so -vendor/lib64/libCB.so -vendor/lib64/libOpenCL.so -vendor/lib64/libRSDriver_adreno.so -vendor/lib64/libadreno_utils.so -vendor/lib64/libbccQTI.so -vendor/lib64/libc2d30-a3xx.so -vendor/lib64/libc2d30-a4xx.so -vendor/lib64/libc2d30-a5xx.so -vendor/lib64/libc2d30_bltlib.so -vendor/lib64/libgsl.so -vendor/lib64/libllvm-glnext.so -vendor/lib64/libllvm-qcom.so -vendor/lib64/libllvm-qgl.so -vendor/lib64/libmm-disp-apis.so -vendor/lib64/libmm-hdcpmgr.so -vendor/lib64/libmm-qdcm.so -vendor/lib64/libmmQSM.so -vendor/lib64/librs_adreno.so -vendor/lib64/librs_adreno_sha1.so -vendor/lib64/libsc-a2xx.so -vendor/lib64/libsc-a3xx.so -vendor/lib64/libscalar.so -vendor/lib64/libscale.so -vendor/lib64/libsd_sdk_display.so -vendor/lib64/libsdm-color.so -vendor/lib64/libsdm-diag.so -vendor/lib64/libsdmextension.so -vendor/lib64/libuiblur.so|4b3fabf5ded7c4af531abde681676fc5e9248494 - -# Graphics firmware - from santoni (Redmi 4X) -etc/firmware/a530_gpmu.fw2 -etc/firmware/a530_pfp.fw -etc/firmware/a530_pm4.fw -etc/firmware/a530v1_pfp.fw -etc/firmware/a530v1_pm4.fw -etc/firmware/a530v2_seq.fw2 -etc/firmware/a530v3_gpmu.fw2 -etc/firmware/a530v3_seq.fw2 -etc/firmware/a540_gpmu.fw2 - -# Keystore - from santoni (Redmi 4X) -vendor/lib/hw/keystore.msm8937.so -vendor/lib64/hw/keystore.msm8937.so - -# Listen - from santoni (Redmi 4X) -vendor/lib/hw/sound_trigger.primary.msm8937.so -vendor/lib/libadpcmdec.so -vendor/lib/libsmwrapper.so - -# Media - from santoni (Redmi 4X) -lib/libOmxVpp.so -lib/libstagefright_soft_flacdec.so -lib/libvpplibrary.so -lib64/libstagefright_soft_flacdec.so -lib64/libvpplibrary.so -vendor/lib/libAlacSwDec.so -vendor/lib/libApeSwDec.so -vendor/lib/libFlacSwDec.so -vendor/lib/libOmxAacDec.so -vendor/lib/libOmxAlacDec.so -vendor/lib/libOmxAlacDecSw.so -vendor/lib/libOmxAmrwbplusDec.so -vendor/lib/libOmxApeDec.so -vendor/lib/libOmxApeDecSw.so -vendor/lib/libOmxEvrcDec.so -vendor/lib/libOmxMux.so -vendor/lib/libOmxQcelp13Dec.so -vendor/lib/libOmxWmaDec.so -vendor/lib/libmmosal.so -vendor/lib/libmmsw_detail_enhancement.so -vendor/lib/libmmsw_math.so -vendor/lib/libmmsw_opencl.so -vendor/lib/libmmsw_platform.so -vendor/lib/libvqzip.so -vendor/lib64/libFlacSwDec.so -vendor/lib64/libOmxAacDec.so -vendor/lib64/libOmxEvrcDec.so -vendor/lib64/libOmxQcelp13Dec.so -vendor/lib64/libmmosal.so - -# Modem - from santoni (Redmi 4X) -vendor/lib/libwms.so -vendor/lib64/libwms.so - -# Network - from santoni (Redmi 4X) --priv-app/QtiTetherService/QtiTetherService.apk -vendor/lib/libconnctrl.so -vendor/lib/libQtiTether.so -vendor/lib64/libconnctrl.so -vendor/lib64/libQtiTether.so - -# Perf - from santoni (Redmi 4X) -bin/iop -bin/msm_irqbalance -vendor/bin/perfd -vendor/lib/libqti-iop-client.so -vendor/lib/libqti-perfd-client.so -vendor/lib64/libqti-iop-client.so -vendor/lib64/libqti-perfd-client.so - -# Peripheral manager - from santoni (Redmi 4X) -bin/pm-proxy -bin/pm-service -vendor/lib/libperipheral_client.so -vendor/lib64/libperipheral_client.so - -# Postprocessing - from santoni (Redmi 4X) -framework/com.qti.snapdragon.sdk.display.jar -vendor/bin/mm-pp-dpps -vendor/lib/libdisp-aba.so -vendor/lib64/libdisp-aba.so - -# QMI - from garlic (YUREKA BLACK) -bin/ATFWD-daemon -bin/irsc_util -etc/permissions/qti_permissions.xml -vendor/lib64/lib_rsu.so -vendor/lib64/libdiag.so -vendor/lib64/libdsi_netctrl.so -vendor/lib64/libdsutils.so -vendor/lib64/libidl.so -vendor/lib64/libqcci_legacy.so -vendor/lib64/libqcmaputils.so -vendor/lib64/libqdi.so -vendor/lib64/libqdp.so -vendor/lib64/libqmi.so -vendor/lib64/libqmi_cci.so -vendor/lib64/libqmi_client_helper.so -vendor/lib64/libqmi_client_qmux.so -vendor/lib64/libqmi_common_so.so -vendor/lib64/libqmi_csi.so -vendor/lib64/libqmi_encdec.so -vendor/lib64/libqmiservices.so -vendor/lib64/libqti-wl.so -vendor/lib64/libquipc_os_api.so -vendor/lib64/libsmemlog.so -vendor/lib/lib_rsu.so -vendor/lib/libdiag.so -vendor/lib/libdsi_netctrl.so -vendor/lib/libdsutils.so -vendor/lib/libidl.so -vendor/lib/libqcci_legacy.so -vendor/lib/libqcmaputils.so -vendor/lib/libqdi.so -vendor/lib/libqdp.so -vendor/lib/libqmi.so -vendor/lib/libqmi_cci.so -vendor/lib/libqmi_client_helper.so -vendor/lib/libqmi_client_qmux.so -vendor/lib/libqmi_common_so.so -vendor/lib/libqmi_csi.so -vendor/lib/libqmi_encdec.so -vendor/lib/libqmiservices.so -vendor/lib/libquipc_os_api.so -vendor/lib/libsmemlog.so - -# Radio - from garlic (YUREKA BLACK) --app/datastatusnotification/datastatusnotification.apk --app/fastdormancy/fastdormancy.apk --app/QtiTelephonyService/QtiTelephonyService.apk --app/shutdownlistener/shutdownlistener.apk --framework/embmslibrary.jar --framework/qcrilhook.jar --framework/qti-telephony-common.jar|37d692fb171d0ee3269676a9e9998d2e3bfd9488 --framework/QtiTelephonyServicelibrary.jar --priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk -bin/netmgrd -bin/radish -bin/rmt_storage -bin/tftp_server -etc/data/dsi_config.xml -etc/data/netmgr_config.xml -etc/permissions/embms.xml -etc/permissions/qcrilhook.xml -etc/permissions/telephonyservice.xml -vendor/bin/qti -vendor/lib64/libconfigdb.so -vendor/lib64/libdatactrl.so -vendor/lib64/liblqe.so -vendor/lib64/libmdmdetect.so -vendor/lib64/libnetmgr.so -vendor/lib64/libril-qc-ltedirectdisc.so -vendor/lib64/libril-qc-qmi-1.so -vendor/lib64/libril-qc-radioconfig.so -vendor/lib64/libril-qcril-hook-oem.so -vendor/lib64/librilqmiservices.so -vendor/lib64/libsettings.so -vendor/lib64/libsystem_health_mon.so -vendor/lib/libmdmdetect.so -vendor/qcril.db - -# Radio - IMS - from garlic (YUREKA BLACK) --framework/imscmlibrary.jar --priv-app/ims/ims.apk|66fa3ab695d7be55a334cbee6e9c94d60089ac2a --vendor/app/imssettings/imssettings.apk --vendor/framework/qti-vzw-ims-internal.jar -bin/ims_rtp_daemon -bin/imscmservice -bin/imsdatadaemon -bin/imsqmidaemon -etc/permissions/imscm.xml -etc/permissions/qti-vzw-ims-internal.xml -vendor/lib64/lib-dplmedia.so -vendor/lib64/lib-ims-rcscmjni.so -vendor/lib64/lib-imscamera.so -vendor/lib64/lib-imsdpl.so -vendor/lib64/lib-imsqimf.so -vendor/lib64/lib-imsrcs.so -vendor/lib64/lib-imsrcscm.so -vendor/lib64/lib-imsrcscmclient.so -vendor/lib64/lib-imsrcscmservice.so -vendor/lib64/lib-imss.so -vendor/lib64/lib-imsSDP.so -vendor/lib64/lib-imsvt.so -vendor/lib64/lib-imsxml.so -vendor/lib64/lib-rcsimssjni.so -vendor/lib64/lib-rcsjni.so -vendor/lib64/lib-rtpcommon.so -vendor/lib64/lib-rtpcore.so -vendor/lib64/lib-rtpdaemoninterface.so -vendor/lib64/lib-rtpsl.so -vendor/lib64/libimscamera_jni.so -vendor/lib64/libimsmedia_jni.so -vendor/lib64/librcc.so -vendor/lib64/libvoice-svc.so - -# Sensors - from santoni (Redmi 4X) -bin/sensors.qcom -vendor/lib/hw/activity_recognition.msm8937.so -vendor/lib/libsensor1.so -vendor/lib/libsensor_reg.so -vendor/lib/sensor_calibrate.so -vendor/lib/sensors.ssc.so -vendor/lib64/hw/activity_recognition.msm8937.so -vendor/lib64/libsensor1.so -vendor/lib64/libsensor_reg.so -vendor/lib64/sensor_calibrate.so -vendor/lib64/sensors.ssc.so - -# Thermal - from santoni (Redmi 4X) -vendor/bin/thermal-engine -vendor/lib/libthermalclient.so -vendor/lib64/libthermalclient.so -vendor/lib64/libthermalioctl.so - -# Time services - from santoni (Redmi 4X) --app/TimeService/TimeService.apk -bin/time_daemon --vendor/lib/libtime_genoff.so -vendor/lib/libTimeService.so --vendor/lib64/libtime_genoff.so -vendor/lib64/libTimeService.so - -# Widevine - from oneplus3 (OnePlus3) -vendor/lib/libWVStreamControlAPI_L3.so|61673304827483d44b735a3dd08f0783d10ce92d -vendor/lib/libwvdrm_L3.so|7e77482481197997294a834bfbc817a01b6075cd -vendor/lib/mediadrm/libwvdrmengine.so|70419ce1f8eb6bd3aa36234f8d7e8003569efc9c - -# Wi-Fi - from santoni (Redmi 4X) -bin/wcnss_service diff --git a/rootdir/Android.mk b/rootdir/Android.mk index d7024a4..5fdcff8 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -1,84 +1,10 @@ LOCAL_PATH := $(call my-dir) # Init scripts - include $(CLEAR_VARS) -LOCAL_MODULE := fstab.qcom +LOCAL_MODULE := init.device.rc LOCAL_MODULE_TAGS := optional eng LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := fstab.qcom +LOCAL_SRC_FILES := init.device.rc LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.qcom.power.rc -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.power.rc -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.qcom.rc -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.rc -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.target.rc -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.target.rc -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.qcom.sh -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.sh -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.qcom.usb.rc -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.usb.rc -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.qcom.usb.sh -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.usb.sh -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.recovery.qcom.rc -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.power.rc -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := ueventd.qcom.rc -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := ueventd.qcom.rc -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -# Configuration scripts - -include $(CLEAR_VARS) -LOCAL_MODULE := init.qcom.bt.sh -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := etc/init.qcom.bt.sh -include $(BUILD_PREBUILT) diff --git a/rootdir/etc/init.qcom.bt.sh b/rootdir/etc/init.qcom.bt.sh deleted file mode 100755 index 0f09d15..0000000 --- a/rootdir/etc/init.qcom.bt.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/system/bin/sh -# Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of The Linux Foundation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -LOG_TAG="qcom-bluetooth" -LOG_NAME="${0}:" - -loge () -{ - /system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@" -} - -logi () -{ - /system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@" -} - -failed () -{ - loge "$1: exit code $2" - exit $2 -} - -# BR/EDR & LE power class configurations -POWER_CLASS=`getprop qcom.bt.dev_power_class` -LE_POWER_CLASS=`getprop qcom.bt.le_dev_pwr_class` - -setprop bluetooth.status off - -case $POWER_CLASS in - 1) PWR_CLASS="-p 0" ; - logi "Power Class: 1";; - 2) PWR_CLASS="-p 1" ; - logi "Power Class: 2";; - 3) PWR_CLASS="-p 2" ; - logi "Power Class: CUSTOM";; - *) PWR_CLASS=""; - logi "Power Class: Ignored. Default(1) used (1-CLASS1/2-CLASS2/3-CUSTOM)"; - logi "Power Class: To override, Before turning BT ON; setprop qcom.bt.dev_power_class <1 or 2 or 3>";; -esac - -case $LE_POWER_CLASS in - 1) LE_PWR_CLASS="-P 0" ; - logi "LE Power Class: 1";; - 2) LE_PWR_CLASS="-P 1" ; - logi "LE Power Class: 2";; - 3) LE_PWR_CLASS="-P 2" ; - logi "LE Power Class: CUSTOM";; - *) LE_PWR_CLASS="-P 1"; - logi "LE Power Class: Ignored. Default(2) used (1-CLASS1/2-CLASS2/3-CUSTOM)"; - logi "LE Power Class: To override, Before turning BT ON; setprop qcom.bt.le_dev_pwr_class <1 or 2 or 3>";; -esac - -eval $(/system/bin/hci_qcomm_init -e $PWR_CLASS $LE_PWR_CLASS && echo "exit_code_hci_qcomm_init=0" || echo "exit_code_hci_qcomm_init=1") - -case $exit_code_hci_qcomm_init in - 0) logi "Bluetooth QSoC firmware download succeeded, $BTS_DEVICE $BTS_TYPE $BTS_BAUD $BTS_ADDRESS";; - *) failed "Bluetooth QSoC firmware download failed" $exit_code_hci_qcomm_init; - setprop bluetooth.status off - - exit $exit_code_hci_qcomm_init;; -esac - -setprop bluetooth.status on - -exit 0 diff --git a/rootdir/fstab.qcom b/rootdir/fstab.qcom deleted file mode 100644 index cb5d5ef..0000000 --- a/rootdir/fstab.qcom +++ /dev/null @@ -1,21 +0,0 @@ -# Android fstab file. -# The filesystem that contains the filesystem checker binary (typically /system) cannot -# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK - -# -/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults -/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults -/dev/block/bootdevice/by-name/system /system ext4 ro wait -/dev/block/bootdevice/by-name/userdata /data f2fs rw,nosuid,nodev,noatime wait,formattable,check,encryptable=footer -/dev/block/bootdevice/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,noauto_da_alloc wait,formattable,check,encryptable=footer -/dev/block/bootdevice/by-name/cache /cache f2fs nosuid,nodev,noatime,inline_xattr wait,formattable,check -/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime wait,formattable,check -/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev wait,check -/dev/block/bootdevice/by-name/dsp /dsp ext4 ro,nosuid,nodev wait -/dev/block/bootdevice/by-name/modem /firmware vfat ro,context=u:object_r:firmware_file:s0,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait -/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults -/dev/block/bootdevice/by-name/config /frp emmc defaults defaults - -/devices/soc/7864900.sdhci/mmc_host* auto auto nosuid,nodev wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=footer -/devices/soc/78db000.usb/msm_hsusb_host* auto auto nosuid,nodev wait,voldmanaged=usbotg:auto -/dev/block/zram0 none swap defaults zramsize=536870912,zramstreams=4 diff --git a/rootdir/init.qcom.sh b/rootdir/init.device.rc old mode 100755 new mode 100644 similarity index 55% rename from rootdir/init.qcom.sh rename to rootdir/init.device.rc index b76f4c0..bc0b042 --- a/rootdir/init.qcom.sh +++ b/rootdir/init.device.rc @@ -1,5 +1,4 @@ -#!/system/bin/sh -# Copyright (c) 2009-2017, The Linux Foundation. All rights reserved. +# Copyright (c) 2009-2012, 2014-2016, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -26,34 +25,5 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# Set shared touchpanel nodes ownership (these are proc_symlinks to the real sysfs nodes) -chown -LR system.system /proc/touchpanel - -# -# Copy qcril.db if needed for RIL -# -start_copying_prebuilt_qcril_db -echo 1 > /data/misc/radio/db_check_done - -# -# Make modem config folder and copy firmware config to that folder for RIL -# -if [ -f /data/misc/radio/ver_info.txt ]; then - prev_version_info=`cat /data/misc/radio/ver_info.txt` -else - prev_version_info="" -fi - -cur_version_info=`cat /firmware/verinfo/ver_info.txt` -if [ ! -f /firmware/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then - rm -rf /data/misc/radio/modem_config - mkdir /data/misc/radio/modem_config - chmod 770 /data/misc/radio/modem_config - cp -r /firmware/image/modem_pr/mcfg/configs/* /data/misc/radio/modem_config - chown -hR radio.radio /data/misc/radio/modem_config - cp /firmware/verinfo/ver_info.txt /data/misc/radio/ver_info.txt - chown radio.radio /data/misc/radio/ver_info.txt -fi -cp /firmware/image/modem_pr/mbn_ota.txt /data/misc/radio/modem_config -chown radio.radio /data/misc/radio/modem_config/mbn_ota.txt -echo 1 > /data/misc/radio/copy_complete +on init + export LD_SHIM_LIBS "/system/bin/mm-qcamera-daemon|libshims_camera.so" diff --git a/rootdir/init.qcom.power.rc b/rootdir/init.qcom.power.rc deleted file mode 100644 index d29de25..0000000 --- a/rootdir/init.qcom.power.rc +++ /dev/null @@ -1,178 +0,0 @@ -on boot - - # Set RPS mask - write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 2 - - # Add a cpuset for the camera daemon - # we want all cores for camera - mkdir /dev/cpuset/camera-daemon - write /dev/cpuset/camera-daemon/cpus 0-7 - write /dev/cpuset/camera-daemon/mems 0 - chown system system /dev/cpuset/camera-daemon - chown system system /dev/cpuset/camera-daemon/tasks - chmod 0664 /dev/cpuset/camera-daemon/tasks - - # Update foreground and background cpusets - # Reserve CPU 7 for the top app - write /dev/cpuset/foreground/cpus 0-6 - write /dev/cpuset/foreground/boost/cpus 0-3 - write /dev/cpuset/background/cpus 4-6 - write /dev/cpuset/system-background/cpus 4-6 - write /dev/cpuset/top-app/cpus 0-7 - write /dev/cpuset/camera-daemon/cpus 4-7 - -on enable-low-power - # HMP scheduler settings - write /proc/sys/kernel/sched_window_stats_policy 3 - write /proc/sys/kernel/sched_ravg_hist_size 3 - write /proc/sys/kernel/sched_ravg_window 20000000 - - #disable sched_boost in 8937 - write /proc/sys/kernel/sched_boost 0 - - # HMP Task packing settings - write /proc/sys/kernel/sched_small_task 20 - write /sys/devices/system/cpu/cpu0/sched_mostly_idle_load 30 - write /sys/devices/system/cpu/cpu1/sched_mostly_idle_load 30 - write /sys/devices/system/cpu/cpu2/sched_mostly_idle_load 30 - write /sys/devices/system/cpu/cpu3/sched_mostly_idle_load 30 - write /sys/devices/system/cpu/cpu4/sched_mostly_idle_load 30 - write /sys/devices/system/cpu/cpu5/sched_mostly_idle_load 30 - write /sys/devices/system/cpu/cpu6/sched_mostly_idle_load 30 - write /sys/devices/system/cpu/cpu7/sched_mostly_idle_load 30 - - write /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run 3 - write /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run 3 - write /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run 3 - write /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run 3 - write /sys/devices/system/cpu/cpu4/sched_mostly_idle_nr_run 3 - write /sys/devices/system/cpu/cpu5/sched_mostly_idle_nr_run 3 - write /sys/devices/system/cpu/cpu6/sched_mostly_idle_nr_run 3 - write /sys/devices/system/cpu/cpu7/sched_mostly_idle_nr_run 3 - - write /sys/devices/system/cpu/cpu0/sched_prefer_idle 0 - write /sys/devices/system/cpu/cpu1/sched_prefer_idle 0 - write /sys/devices/system/cpu/cpu2/sched_prefer_idle 0 - write /sys/devices/system/cpu/cpu3/sched_prefer_idle 0 - write /sys/devices/system/cpu/cpu4/sched_prefer_idle 0 - write /sys/devices/system/cpu/cpu5/sched_prefer_idle 0 - write /sys/devices/system/cpu/cpu6/sched_prefer_idle 0 - write /sys/devices/system/cpu/cpu7/sched_prefer_idle 0 - - write /sys/class/devfreq/soc:qcom,cpubw/governor bw_hwmon - write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent 20 - write /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps 30 - - # Disable thermal core_control to update interactive gov settings - write /sys/module/msm_thermal/core_control/enabled 0 - - # Enable governor for perf cluster - write /sys/devices/system/cpu/cpu0/online 1 - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay "19000 1094400:39000" - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 85 - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000 - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 1094400 - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 0 - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "1 960000:85 1094400:90 1344000:80" - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 40000 - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor 40000 - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 960000 - - # Enable governor for power cluster - write /sys/devices/system/cpu/cpu4/online 1 - write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor interactive - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay 39000 - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 90 - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 20000 - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 768000 - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy 0 - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "1 768000:90" - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 40000 - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor 40000 - write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 768000 - - # Disable L2-GDHS low power modes - write /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/idle_enabled N - write /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/suspend_enabled N - write /sys/module/lpm_levels/system/perf/perf-l2-gdhs/idle_enabled N - write /sys/module/lpm_levels/system/perf/perf-l2-gdhs/suspend_enabled N - - # Bring all cores online - write /sys/devices/system/cpu/cpu1/online 1 - write /sys/devices/system/cpu/cpu2/online 1 - write /sys/devices/system/cpu/cpu3/online 1 - write /sys/devices/system/cpu/cpu4/online 1 - write /sys/devices/system/cpu/cpu5/online 1 - write /sys/devices/system/cpu/cpu6/online 1 - write /sys/devices/system/cpu/cpu7/online 1 - - # Enable power_efficient workqueue - write /sys/module/workqueue/parameters/power_efficient 1 - - # Enable low power modes - write /sys/module/lpm_levels/parameters/sleep_disabled 0 - - # HMP scheduler (big.Little cluster related) settings - write /proc/sys/kernel/sched_upmigrate 93 - write /proc/sys/kernel/sched_downmigrate 83 - - # Enable sched guided freq control - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load 1 - write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif 1 - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load 1 - write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif 1 - write /proc/sys/kernel/sched_freq_inc_notify 50000 - write /proc/sys/kernel/sched_freq_dec_notify 50000 - - # Enable dynamic clock gating - write /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating 1 - - # Enable timer migration to little cluster - write /proc/sys/kernel/power_aware_timer_migration 1 - - # Set per_process_reclaim tuning parameters - write /sys/module/process_reclaim/parameters/enable_process_reclaim 1 - write /sys/module/process_reclaim/parameters/pressure_max 70 - write /sys/module/process_reclaim/parameters/swap_opt_eff 30 - write /sys/module/process_reclaim/parameters/pressure_min 50 - write /sys/module/process_reclaim/parameters/per_swap_size 512 - - # Set lowmemorykiller tuning parameters - write /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk 1 - write /sys/module/lowmemorykiller/parameters/minfree "15360,19200,23040,26880,34415,43737" - write /sys/module/lowmemorykiller/parameters/vmpressure_file_min 53059 - - # Set ZCache parameters - write /sys/module/zcache/parameters/clear_percent 3 - write /sys/module/zcache/parameters/max_pool_percent 30 - - write /sys/block/mmcblk0/bdi/read_ahead_kb 128 - write /sys/block/mmcblk0/queue/read_ahead_kb 128 - write /sys/block/dm-0/queue/read_ahead_kb 128 - write /sys/block/dm-1/queue/read_ahead_kb 128 - - rm /data/system/perfd/default_values - start perfd - -on class_start:late_start - trigger enable-low-power - -on charger - # Offline all cores other than CPU0 - write /sys/devices/system/cpu/cpu1/online 0 - write /sys/devices/system/cpu/cpu2/online 0 - write /sys/devices/system/cpu/cpu3/online 0 - write /sys/devices/system/cpu/cpu4/online 0 - write /sys/devices/system/cpu/cpu5/online 0 - write /sys/devices/system/cpu/cpu6/online 0 - write /sys/devices/system/cpu/cpu7/online 0 - - write /sys/module/lpm_levels/parameters/sleep_disabled 0 - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave - -on property:init.svc.recovery=running - trigger enable-low-power - -on property:dev.bootcomplete=1 - setprop sys.io.scheduler bfq diff --git a/rootdir/init.qcom.rc b/rootdir/init.qcom.rc deleted file mode 100644 index 7b51c9d..0000000 --- a/rootdir/init.qcom.rc +++ /dev/null @@ -1,471 +0,0 @@ -# Copyright (c) 2009-2012, 2014-2016, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of The Linux Foundation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -import init.qcom.power.rc -import init.qcom.usb.rc -import init.target.rc - -on early-init - mount debugfs debugfs /sys/kernel/debug - chmod 0755 /sys/kernel/debug - -on init - export LD_SHIM_LIBS "/system/bin/mm-qcamera-daemon|libshims_camera.so" - - # Set permissions for persist partition - mkdir /persist 0771 root system - - # Support legacy path - symlink /sdcard /storage/sdcard0 - - write /sys/module/qpnp_rtc/parameters/poweron_alarm 1 - -on post-fs - chmod 0755 /sys/kernel/debug/tracing - -on early-boot - # set RLIMIT_MEMLOCK to 64MB - setrlimit 8 67108864 67108864 - # Allow subsystem (modem etc) debugging - write /sys/kernel/boot_adsp/boot 1 - write /sys/kernel/boot_slpi/boot 1 - - # Graphics - chown system graphics /sys/class/graphics/fb0/idle_time - chmod 0664 /sys/class/graphics/fb0/idle_time - chown system graphics /sys/class/graphics/fb0/dynamic_fps - chmod 0664 /sys/class/graphics/fb0/dynamic_fps - chown system graphics /sys/class/graphics/fb0/dyn_pu - chmod 0664 /sys/class/graphics/fb0/dyn_pu - chown system graphics /sys/class/graphics/fb0/modes - chmod 0664 /sys/class/graphics/fb0/modes - chown system graphics /sys/class/graphics/fb0/mode - chmod 0664 /sys/class/graphics/fb0/mode - chown system graphics /sys/class/graphics/fb0/msm_cmd_autorefresh_en - chmod 0664 /sys/class/graphics/fb0/msm_cmd_autorefresh_en - -on boot - chown system system /sys/module/radio_iris_transport/parameters/fmsmd_set - chmod 0660 /sys/module/radio_iris_transport/parameters/fmsmd_set - - # Create QMUX deamon socket area - mkdir /dev/socket/qmux_radio 0770 radio radio - chmod 2770 /dev/socket/qmux_radio - mkdir /dev/socket/qmux_audio 0770 media audio - chmod 2770 /dev/socket/qmux_audio - mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth - chmod 2770 /dev/socket/qmux_bluetooth - mkdir /dev/socket/qmux_gps 0770 gps gps - chmod 2770 /dev/socket/qmux_gps - - mkdir /persist/drm 0770 system system - mkdir /persist/bluetooth 0770 bluetooth bluetooth - mkdir /persist/misc 0770 system system - mkdir /persist/alarm 0770 system system - mkdir /persist/time 0770 system system - - # Create NETMGR daemon socket area - mkdir /dev/socket/netmgr 0750 radio radio - - # Prevent permission denied error for telephony - chmod 0644 /proc/cmdline - - # enable camera read sensors data - setprop persist.camera.gyro.disable 0 - - # Remove SUID bit for iproute2 ip tool - chmod 0755 /system/bin/ip - - setprop net.tcp.2g_init_rwnd 10 - - # Assign TCP buffer thresholds to be ceiling value of technology maximums - # Increased technology maximums should be reflected here. - write /proc/sys/net/core/rmem_max 8388608 - write /proc/sys/net/core/wmem_max 8388608 - - # To prevent out of order acknowledgements from making - # connection tracking to treat them as not belonging to - # the connection they belong to. - # Otherwise, a weird issue happens in which some long - # connections on high-throughput links get dropped when - # an ack packet comes out of order - write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1 - - # Allow access to dload sysfs node - chown root system /sys/kernel/dload/emmc_dload - chmod 0660 /sys/kernel/dload/emmc_dload - - # Goodix Fingerprint - chown system system /dev/goodix_fp - chmod 0644 /dev/goodix_fp - - setprop persist.sys.fp.vendor none - start gx_fpd - - # IR blaster - chown root system /sys/class/leds/infrared/transmit - chown root system /sys/class/leds/infrared/brightness - - # Notification LEDs - chown root system /sys/class/leds/red/blink - chown root system /sys/class/leds/green/blink - chown root system /sys/class/leds/blue/blink - -# msm specific files that need to be created on /data -on post-fs-data - #Create directories for Fingerprint - mkdir /data/misc/stargate 0770 system system - mkdir /data/misc/stargate/bg_estimation 0770 system system - mkdir /data/misc/stargate/calib_test 0770 system system - mkdir /data/misc/stargate/database 0770 system system - - # Create directory for TZ Apps - mkdir /data/misc/qsee 0770 system system - - #Create folder for mm-qcamera-daemon - mkdir /data/misc/camera 0770 camera camera - - mkdir /data/media 0770 media_rw media_rw - chown media_rw media_rw /data/media - - mkdir /data/misc/bluetooth 0770 bluetooth bluetooth - - # Create the directories used by the Wireless subsystem - mkdir /data/misc/wifi 0770 wifi wifi - mkdir /data/misc/wifi/sockets 0770 wifi wifi - mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi - mkdir /data/misc/dhcp 0770 dhcp dhcp - chown dhcp dhcp /data/misc/dhcp - - # Create netmgr log dir - mkdir /data/misc/netmgr 0770 radio radio - chmod 0770 /data/misc/netmgr - - # Create the directories used by CnE subsystem - mkdir /data/connectivity 0771 system system - chown system system /data/connectivity - - # Create the directories used by DPM subsystem - mkdir /data/dpm 0771 system system - chown system system /data/dpm - - mkdir /data/dpm/nsrm 0771 system system - chown system system /data/dpm/nsrm - - # Create directory used by audio subsystem - mkdir /data/misc/audio 0770 audio audio - - # Create directory for audio delta files - mkdir /data/misc/audio/acdbdata 0770 media audio - mkdir /data/misc/audio/acdbdata/delta 0770 media audio - - # Create directory used by display clients - mkdir /data/misc/display 0770 system graphics - - # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections - # We chown/chmod /persist again so because mount is run as root + defaults - chown root system /persist - chmod 0771 /persist - chown system system /persist/WCNSS_qcom_wlan_nv.bin - - # Create directories for Location services - mkdir /data/misc/location 0770 gps gps - mkdir /data/misc/location/mq 0770 gps gps - mkdir /data/misc/location/xtwifi 0770 gps gps - mkdir /data/misc/location/gpsone_d 0770 system gps - mkdir /data/misc/location/quipc 0770 gps system - mkdir /data/misc/location/gsiff 0770 gps gps - - # Create directory from IMS services - mkdir /data/shared 0755 - chown system system /data/shared - - # Create directory for hostapd - mkdir /data/hostapd 0770 system wifi - - # Create /data/time folder for time-services - mkdir /data/time/ 0700 system system - - mkdir /data/audio/ 0770 media audio - - # Create a folder for audio delta files - mkdir /data/audio/acdbdata 0770 media audio - mkdir /data/audio/acdbdata/delta 0770 media audio - - setprop vold.post_fs_data_done 1 - - # Create a folder for SRS to be able to create a usercfg file - mkdir /data/data/media 0770 media media - - # Create FM dir for patchdownloader - mkdir /data/misc/fm 0770 system system - chmod 0770 /data/misc/fm - - # Create PERFD deamon related dirs - mkdir /data/system/perfd 0770 root system - chmod 2770 /data/system/perfd - rm /data/system/perfd/default_values - start perfd - - # Create IOP deamon related dirs - mkdir /data/misc/iop 0770 root system - - # Mark the copy complete flag to not completed - write /data/misc/radio/copy_complete 0 - chown radio radio /data/misc/radio/copy_complete - chmod 0660 /data/misc/radio/copy_complete - - # copy prebuilt qcril.db files always - copy /system/vendor/qcril.db /data/misc/radio/qcril_prebuilt.db - chown radio radio /data/misc/radio/qcril_prebuilt.db - chmod 0660 /data/misc/radio/qcril_prebuilt.db - # File flags for prebuilt ril db file - write /data/misc/radio/prebuilt_db_support 1 - chown radio radio /data/misc/radio/prebuilt_db_support - chmod 0400 /data/misc/radio/prebuilt_db_support - write /data/misc/radio/db_check_done 0 - chown radio radio /data/misc/radio/db_check_done - chmod 0660 /data/misc/radio/db_check_done - - # set aggressive read ahead for dm-0 and dm-1 during boot up - write /sys/block/dm-0/queue/read_ahead_kb 2048 - write /sys/block/dm-1/queue/read_ahead_kb 2048 - - # Sensors - chmod 0775 /persist/sensors - chmod 0664 /persist/sensors/sensors_settings - chown system root /persist/sensors/sensors_settings - - mkdir /data/misc/sensors - chmod 0775 /data/misc/sensors - -service perfd /system/vendor/bin/perfd - class main - user root - group root readproc - disabled - socket perfd seqpacket 0666 root system - -service iop /system/bin/iop - class main - user root - group root - disabled - socket iop seqpacket 0666 root system - -on property:sys.boot_completed=1 - write /dev/kmsg "Boot completed " - # Reset read ahead for dm-0 and dm-1 to 512kb - write /sys/block/dm-0/queue/read_ahead_kb 512 - write /sys/block/dm-1/queue/read_ahead_kb 512 - # WDSP FW boot sysfs node used by STHAL - chown media audio /sys/kernel/wdsp0/boot - # CPE fw_name used by sound trigger HAL - chown media audio /sys/kernel/wcd_cpe0/fw_name - -on property:vold.decrypt=trigger_restart_framework - start config_bt_addr - start config_bluetooth - start wcnss-service - -on property:persist.env.fastdorm.enabled=true - setprop persist.radio.data_no_toggle 1 - -service cnd /system/bin/cnd - class main - socket cnd stream 660 root inet - writepid /dev/cpuset/system-background/tasks - -service dpmd /system/bin/dpmd - class late_start - socket dpmd stream 660 root system - group system readproc - writepid /dev/cpuset/system-background/tasks - -service irsc_util /system/bin/irsc_util "/etc/sec_config" - class core - user root - oneshot - -service rmt_storage /system/bin/rmt_storage - class core - user root - group system wakelock - writepid /dev/cpuset/system-background/tasks - -service tftp_server /system/bin/tftp_server - class main - user root - writepid /dev/cpuset/system-background/tasks - -service config_bt_addr /system/bin/btnvtool -O - class core - user bluetooth - group bluetooth radio - oneshot - -service hciattach /system/bin/sh /system/etc/init.qcom.bt.sh - class late_start - user bluetooth - group bluetooth net_bt_admin - disabled - seclabel u:r:bluetooth_loader:s0 - oneshot - -on property:bluetooth.hciattach=true - start hciattach - -# FM -on property:hw.fm.init=0 - write /sys/module/radio_iris_transport/parameters/fmsmd_set 0 - -on property:hw.fm.init=1 - write /sys/module/radio_iris_transport/parameters/fmsmd_set 1 - -service netmgrd /system/bin/netmgrd - class main - user root - group root wifi wakelock radio inet - writepid /dev/cpuset/system-background/tasks - -service qti /system/vendor/bin/qti - class main - user radio - group radio qcom_diag usb - writepid /dev/cpuset/system-background/tasks - -service sensors /system/bin/sensors.qcom - class core - user root - group root - writepid /dev/cpuset/system-background/tasks - -# Adjust socket buffer to enlarge TCP receive window for high bandwidth -# but only if ro.data.large_tcp_window_size property is set. -on property:ro.data.large_tcp_window_size=true - write /proc/sys/net/ipv4/tcp_adv_win_scale 2 - -on property:sys.sysctl.tcp_adv_win_scale=* - write /proc/sys/net/ipv4/tcp_adv_win_scale ${sys.sysctl.tcp_adv_win_scale} - -service p2p_supplicant /system/bin/wpa_supplicant \ - -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ - -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \ - -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ - -I/system/etc/wifi/wpa_supplicant_overlay.conf \ - -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 -dd \ - -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 - class main - socket wpa_wlan0 dgram 660 wifi wifi - disabled - oneshot - -service wpa_supplicant /system/bin/wpa_supplicant \ - -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ - -I/system/etc/wifi/wpa_supplicant_overlay.conf \ - -O/data/misc/wifi/sockets -dd \ - -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 - class main - socket wpa_wlan0 dgram 660 wifi wifi - disabled - oneshot - -service loc_launcher /system/bin/loc_launcher - #loc_launcher will start as root and set its uid to gps - class late_start - group gps inet net_raw qcom_diag net_admin wifi - writepid /dev/cpuset/system-background/tasks - -service qcom-sh /system/bin/sh /init.qcom.sh - class late_start - user root - oneshot - -service hostapd /system/bin/hostapd -dd /data/hostapd/hostapd.conf - class late_start - user root - group root - oneshot - disabled - -service ril-daemon2 /system/bin/rild -c 2 - class main - socket rild2 stream 660 root radio - socket sap_uim_socket2 stream 660 bluetooth bluetooth - socket rild-debug2 stream 660 radio system - user root - group radio cache inet misc audio log readproc wakelock qcom_diag - -service charger /charger - class charger - group system graphics - seclabel u:r:healthd:s0 - -service msm_irqbalance /system/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf - class late_start - user root - group root - writepid /dev/cpuset/system-background/tasks - -service qseeproxydaemon /system/vendor/bin/qseeproxydaemon - class late_start - user system - group system - writepid /dev/cpuset/system-background/tasks - -service fingerprintd /system/bin/fingerprintd - class late_start - socket fpce stream 0666 system system - user system - group system sdcard_rw - disabled - -service gx_fpd /system/bin/gx_fpd - class core - user root - group system system - disabled - -on property:persist.sys.fp.vendor=switchf - stop gx_fpd - setprop persist.sys.fp.vendor searchf - start fingerprintd - setprop ro.boot.fpsensor fpc - -on property:persist.sys.fp.vendor=goodix - setprop ro.boot.fpsensor gdx - -on property:persist.sys.fp.onstart=1 - start fingerprintd - -on property:ro.boot.fpsensor=gdx - setprop ro.hardware.fingerprint goodix - -service time_daemon /system/bin/time_daemon - class main - user root - group root diff --git a/rootdir/init.qcom.usb.rc b/rootdir/init.qcom.usb.rc deleted file mode 100644 index 1374c5a..0000000 --- a/rootdir/init.qcom.usb.rc +++ /dev/null @@ -1,1617 +0,0 @@ -# Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of The Linux Foundation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -on charger - setprop sys.usb.config mass_storage - -on boot - mkdir /dev/usb-ffs 0770 shell shell - mkdir /dev/usb-ffs/adb 0770 shell shell - mount configfs none /config - mkdir /config/usb_gadget/g1 0770 shell shell - mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell - write /config/usb_gadget/g1/bcdUSB 0x0200 - write /config/usb_gadget/g1/os_desc/use 1 - write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} - write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} - write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} - mkdir /config/usb_gadget/g1/functions/mass_storage.0 - mkdir /config/usb_gadget/g1/functions/mtp.gs0 - mkdir /config/usb_gadget/g1/functions/ptp.gs1 - mkdir /config/usb_gadget/g1/functions/accessory.gs2 - mkdir /config/usb_gadget/g1/functions/audio_source.gs3 - mkdir /config/usb_gadget/g1/functions/midi.gs5 - mkdir /config/usb_gadget/g1/functions/ffs.adb - mkdir /config/usb_gadget/g1/functions/diag.diag - mkdir /config/usb_gadget/g1/functions/cser.dun.0 - mkdir /config/usb_gadget/g1/functions/cser.nmea.1 - mkdir /config/usb_gadget/g1/functions/gsi.rmnet - mkdir /config/usb_gadget/g1/functions/gsi.rndis - mkdir /config/usb_gadget/g1/functions/gsi.dpl - mkdir /config/usb_gadget/g1/functions/qdss.qdss - mkdir /config/usb_gadget/g1/functions/rndis_bam.rndis - mkdir /config/usb_gadget/g1/functions/ncm.0 - mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell - mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell - write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 - write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" - symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 - mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 - write /sys/class/android_usb/android0/f_ffs/aliases adb - -service qcom-usb-sh /system/bin/sh /init.qcom.usb.sh - class core - user root - oneshot - -# Following are the parameters required for usb functionality. They provide configurable options like -# product_id/vendor id and allows specifying required functions: -# -# Required parameters: -# -# /sys/class/android_usb/android0/enable: Enables/disables usb composition -# Value: 0 (disable), 1 (enable) -# -# /sys/class/android_usb/android0/idVendor: Stores Vendor ID -# Value: 05c6 (Vendor id for Qualcomm Inc) -# -# /sys/class/android_usb/android0/idProduct: Stores Product id corresponding to usb composition -# Value: 0x9xxx for composite interface, 0xFxxx for single interface -# -# /sys/class/android_usb/android0/f_diag/clients: Stores name of clients representing a diag interface. -# Value: Passed one per interface. e.g. diag[,diag_mdm, diag_qsc, diag_mdm2] -# -# /sys/class/android_usb/android0/functions: Stores name of the function drivers used in usb composition. -# Value: Passed one per function driver. e.g. diag[,adb] -# -#Optional parameters: -# -# /sys/class/android_usb/android0/f_serial/transports: Stores type of underlying transports used to -# communicate to serial interface. -# Value: Passed one per interface. One value represents control and data transport together. -# e.g. smd[,sdio,tty,hsic] -# Only required if serial interface is present. -# -# /sys/class/android_usb/android0/f_serial/transport_names: Stores name of the underlying transports -# used to communicate to serial interface. This is used to distinguish between more than one interface -# using same transport type. -# Value: Passed one per interface. One value represents control and data transport together. -# e.g. serial_hsic[,serial_hsusb] -# Only required for transport type hsic, optional for other transport types. -# -# /sys/class/android_usb/android0/f_rmnet/transports: Stores type of underlying transports used to -# communicate to rmnet interface. -# Value: Passed two per interface as control, data transport type pair. -# e.g. smd,bam[,hsuart,hsuart] -# Only required if rmnet interface is present. -# -# /sys/class/android_usb/android0/f_rmnet/transport_names: Stores name of the underlying transports -# used to communicate to rmnet interface. This is used to distinguish between more than one interface -# using same transport type. -# Value: Passed one per interface. One value represents control and data transport together. -# e.g. rmnet_hsic[,rmnet_hsusb] -# Only required for transport type hsic, optional for other transport types. - -# USB compositions -on property:sys.usb.config=diag,serial_tty,serial_smd && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9002 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports tty,smd - write /sys/class/android_usb/android0/functions diag,serial - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_tty,serial_smd,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9020 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/functions diag,adb,serial - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 901D - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 900E - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_bam,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9091 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/functions diag,serial,rmnet,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_qti_bam,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9091 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam - write /sys/class/android_usb/android0/functions diag,serial,rmnet,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_bam && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9092 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/functions diag,serial,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_qti_bam && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9092 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam - write /sys/class/android_usb/android0/functions diag,serial,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9025 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports char_bridge,tty - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9026 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports char_bridge,tty - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9025 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_bam,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903D - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9026 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_bam,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903E - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_smd,rmnet_smd_sdio,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9037 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports sdio,smd - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd_sdio,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_smd,rmnet_smd_sdio,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903B - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_acm/acm_transports sdio,smd - write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd_sdio,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_smd,rmnet_smd_sdio,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9038 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports sdio,smd - write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd_sdio,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_smd,rmnet_smd_sdio,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903C - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_acm/acm_transports sdio,smd - write /sys/class/android_usb/android0/functions diag,acm,rmnet_smd_sdio,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_tty,rmnet_sdio,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9031 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports sdio,tty - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_sdio,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_tty,rmnet_sdio,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903B - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_acm/acm_transports sdio,tty - write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_sdio,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_tty,rmnet_sdio,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9032 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports sdio,tty - write /sys/class/android_usb/android0/functions diag,serial,rmnet_sdio,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_tty,rmnet_sdio,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903C - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_acm/acm_transports sdio,tty - write /sys/class/android_usb/android0/functions diag,acm,rmnet_sdio,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9025 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports tty,tty - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - start port-bridge - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903D - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_acm/acm_transports tty,tty - write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - start port-bridge - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9026 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports tty,tty - write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/enable 1 - start port-bridge - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903E - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_acm/acm_transports tty,tty - write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_smd,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9025 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903D - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty - write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - start port-bridge - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_smd,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9026 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903E - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty - write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -# RmNet using USB BAM to IPA BAM -on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9025 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9026 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_ipa,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9091 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,serial,rmnet,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_ipa && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9092 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,serial,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -# Fusion 3 composition -on property:sys.usb.config=diag,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9025 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports hsic,tty - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic - write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384 - write /sys/module/mdm_bridge/parameters/max_rx_urbs 20 - write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384 - write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# Fusion 3 composition with diag_mdm and adb -on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9031 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports hsic,tty - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic - write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384 - write /sys/module/mdm_bridge/parameters/max_rx_urbs 20 - write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384 - write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# Fusion 3 composition with diag_mdm -on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9032 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports hsic,tty - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic - write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384 - write /sys/module/mdm_bridge/parameters/max_rx_urbs 20 - write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384 - write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20 - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -# Fusion 3 DSDA composition with adb -on property:sys.usb.config=diag,diag_mdm,diag_qsc,serial_hsic,serial_hsuart,rmnet_hsic,rmnet_hsuart,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9065 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc - write /sys/class/android_usb/android0/f_serial/transports hsic,hsuart - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsuart - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsuart,hsuart - write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsuart - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384 - write /sys/module/mdm_bridge/parameters/max_rx_urbs 20 - write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384 - write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# Fusion 3 DSDA composition without adb -on property:sys.usb.config=diag,diag_mdm,diag_qsc,serial_hsic,serial_hsuart,rmnet_hsic,rmnet_hsuart,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9066 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc - write /sys/class/android_usb/android0/f_serial/transports hsic,hsuart - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsuart - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsuart,hsuart - write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsuart - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384 - write /sys/module/mdm_bridge/parameters/max_rx_urbs 20 - write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384 - write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20 - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -# Fusion 3 DSDA2 composition with adb -on property:sys.usb.config=diag,diag_mdm,diag_mdm2,serial_hsic,serial_hsusb,rmnet_hsic,rmnet_hsusb,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9065 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_mdm2 - write /sys/class/android_usb/android0/f_serial/transports hsic,hsic - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsusb - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsic,hsic - write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsusb - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384 - write /sys/module/mdm_bridge/parameters/max_rx_urbs 20 - write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384 - write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# Fusion 3 DSDA2 composition without adb -on property:sys.usb.config=diag,diag_mdm,diag_mdm2,serial_hsic,serial_hsusb,rmnet_hsic,rmnet_hsusb,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9066 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_mdm2 - write /sys/class/android_usb/android0/f_serial/transports hsic,hsic - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsusb - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsic,hsic - write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsusb - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384 - write /sys/module/mdm_bridge/parameters/max_rx_urbs 20 - write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384 - write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20 - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -# Fusion PCIe composition with diag_mdm and adb -# Serial & RmNet bridged in userspace with tty and qti/ether -on property:sys.usb.config=diag,diag_mdm,serial_tty,rmnet_qti_ether,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9035 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports tty - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# Fusion PCIe composition with diag_mdm -# Serial & RmNet bridged in userspace with tty and qti/ether -on property:sys.usb.config=diag,diag_mdm,serial_hsic,rmnet_hsic,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9036 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports tty - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -# Fusion HSIC/PCIe Hybrid composition with diag_mdm and adb -# RmNet is bridged over PCIe using qti,ether ctrl/data transports -on property:sys.usb.config=diag,diag_mdm,serial_hsic,rmnet_qti_ether,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9035 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports hsic - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# Fusion HSIC/PCIe Hybrid composition with diag_mdm -# RmNet is bridged over PCIe using qti,ether ctrl/data transports -on property:sys.usb.config=diag,diag_mdm,serial_hsic,rmnet_hsic,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9036 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports hsic - write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -# Fusion PCIe composition with diag_mdm -# Serial & RmNet bridged in userspace with port bridge and qti/ether -on property:sys.usb.config=diag,diag_mdm,serial_cdev,rmnet_qti_ether,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9036 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports char_bridge - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,serial_cdev,rmnet_qti_ether,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9035 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports char_bridge - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# Fusion 2.2 composition with diag_qsc and adb -on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmnet_hsuart,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9053 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_qsc - write /sys/class/android_usb/android0/f_serial/transports smd,tty,hsuart - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam,hsuart,hsuart - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# Fusion 2.2 composition with diag_qsc -on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmnet_hsuart,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9054 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_qsc - write /sys/class/android_usb/android0/f_serial/transports smd,tty,hsuart - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam,hsuart,hsuart - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.tethering=true - write /sys/class/net/rndis0/queues/rx-0/rps_cpus ${sys.usb.rps_mask} - -on property:sys.usb.config=rndis - setprop sys.usb.config rndis,${persist.sys.usb.config.extra} - -on property:sys.usb.config=rndis,none && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct F00E - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/functions rndis - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state rndis - -on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=0 - setprop sys.usb.config rndis,${persist.sys.usb.config.extra},adb - -on property:sys.usb.config=rndis,none,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9024 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/functions rndis,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state rndis,adb - -on property:sys.usb.config=rndis,diag && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 902C - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions rndis,diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state rndis - -on property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 902D - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions rndis,diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state rndis,adb - -# DPL is implemented using QDSS -on property:sys.usb.config=rndis,diag,dpl && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90BF - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions rndis,diag,qdss - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state rndis - -# DPL is implemented using QDSS -on property:sys.usb.config=rndis,diag,dpl,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90C0 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions rndis,diag,qdss,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state rndis,adb - -on property:sys.usb.config=rndis,serial_smd && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B3 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/functions rndis,serial - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state rndis - -on property:sys.usb.config=rndis,serial_smd,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B4 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/functions rndis,serial,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state rndis,adb - -on property:sys.usb.config=rndis,serial_smd,diag && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B5 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/functions rndis,serial,diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state rndis - -on property:sys.usb.config=rndis,serial_smd,diag,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B6 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/functions rndis,serial,diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state rndis,adb - -on property:sys.usb.config=rndis,serial_cdev,diag && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B5 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports char_bridge - write /sys/class/android_usb/android0/functions rndis,serial,diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state rndis - -on property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B6 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports char_bridge - write /sys/class/android_usb/android0/functions rndis,serial,diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state rndis,adb - -on property:sys.usb.config=rndis,diag,diag_mdm && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9041 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/functions rndis,diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state rndis - -on property:sys.usb.config=rndis,diag,diag_mdm,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9042 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/functions rndis,diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state rndis,adb - -on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9086 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc - write /sys/class/android_usb/android0/functions rndis,diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state rndis - -on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9087 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc - write /sys/class/android_usb/android0/functions rndis,diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state rndis,adb - -on property:sys.usb.config=ptp && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 904D - write /sys/class/android_usb/android0/functions ptp - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 904E - write /sys/class/android_usb/android0/functions ptp,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mtp && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct F003 - write /sys/class/android_usb/android0/functions mtp - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9039 - write /sys/class/android_usb/android0/functions mtp,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mtp,diag && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 901B - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions mtp,diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903A - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions mtp,diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mtp,diag,diag_mdm && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9040 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/functions mtp,diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mtp,diag,diag_mdm,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 903F - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/functions mtp,diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mtp,diag,diag_mdm,diag_qsc && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9088 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc - write /sys/class/android_usb/android0/functions mtp,diag - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mtp,diag,diag_mdm,diag_qsc,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9089 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc - write /sys/class/android_usb/android0/functions mtp,diag,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,ccid && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9045 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/functions diag,ccid - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,ccid,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9044 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/functions diag,adb,ccid - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9015 - write /sys/class/android_usb/android0/functions adb,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -#Mass-storage only composition -on property:sys.usb.config=mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct F000 - write /sys/class/android_usb/android0/functions mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,qdss && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 904A - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9060 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,qdss && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9099 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,qdss,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9098 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,qdss,rmnet_bam && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9083 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,qdss,rmnet_qti_bam && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9083 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,qdss,rmnet_bam,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9084 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,adb,rmnet - write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,qdss,rmnet_qti_bam,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9084 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,adb,rmnet - write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,qdss,rmnet_ipa && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9083 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,qdss,rmnet_ipa,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9084 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,adb,rmnet - write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,qdss,rmnet_hsic && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 909B - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,qdss,rmnet_hsic,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 909A - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions diag,qdss,adb,rmnet - write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,qdss_apq,qdss_mdm,rmnet_hsic && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90A3 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports bam,hsic - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam,qdss_hsic - write /sys/class/android_usb/android0/functions diag,qdss,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,qdss_apq,qdss_mdm,rmnet_hsic,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90A2 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports bam,hsic - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam,qdss_hsic - write /sys/class/android_usb/android0/functions diag,qdss,adb,rmnet - write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=rndis,diag,qdss && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9081 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions rndis,diag,qdss - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 9082 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_qdss/debug_intf 1 - write /sys/class/android_usb/android0/f_qdss/transports bam - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/functions rndis,diag,qdss,adb - write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# same as 9025, plus data packet logging (DPL) using QDSS -on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,dpl,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90AD - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty -# DPL is implemented using QDSS - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage,qdss - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -# same as 9026, plus data packet logging (DPL) -on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,dpl && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B0 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd,tty -# DPL is implemented using QDSS - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage,qdss - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,dpl,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90AD - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports char_bridge,tty -# DPL is implemented using QDSS - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage,qdss - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,dpl && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B0 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports char_bridge,tty -# DPL is implemented using QDSS - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage,qdss - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=ncm && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 0525 - write /sys/class/android_usb/android0/idProduct A4A1 - write /sys/class/android_usb/android0/functions ncm - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=ncm,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 908C - write /sys/class/android_usb/android0/functions ncm,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=charging && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct F006 - write /sys/class/android_usb/android0/functions charging - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_qti_bam,dpl_qti_bam_dmux && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B7 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam - write /sys/class/android_usb/android0/f_qdss/transports qti,bam_dmux - write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_qti_bam,dpl_qti_bam_dmux,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B8 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam - write /sys/class/android_usb/android0/f_qdss/transports qti,bam_dmux - write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_cnss,serial_smd,serial_tty,rmnet_bam,mass_storage,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B2 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_cnss - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/functions diag,diag_cnss,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_cnss,serial_smd,serial_tty,rmnet_bam,mass_storage && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B3 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_cnss - write /sys/class/android_usb/android0/f_serial/transports smd,tty - write /sys/class/android_usb/android0/f_rmnet/transports smd,bam - write /sys/class/android_usb/android0/functions diag,diag_cnss,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=midi && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90BA - write /sys/class/android_usb/android0/functions midi - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=midi,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90BB - write /sys/class/android_usb/android0/functions midi,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_ipa,dpl && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B7 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd -# DPL is implemented using QDSS - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,serial_smd,rmnet_ipa,dpl,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90B8 - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/f_serial/transports smd -# DPL is implemented using QDSS - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam - write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa - write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss,adb - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,serial_tty,rmnet_qti_ether,dpl_ether,mass_storage,adb - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90AE - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports tty - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,ether - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_dpl - write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,qdss,mass_storage - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,diag_mdm,serial_tty,rmnet_qti_ether,dpl_ether,mass_storage - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90AF - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_serial/transports tty - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports qti,ether - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_dpl - write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss,mass_storage - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,adb,uac2 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90CA - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions diag,adb,uac2_func - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,adb,video && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90CB - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions diag,adb,video - write /sys/module/dwc3/parameters/high_bw_ep_in_num 4 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.config=diag,adb,uac2,video && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90CC - write /sys/class/android_usb/android0/f_diag/clients diag - write /sys/class/android_usb/android0/functions diag,adb,uac2_func,video - write /sys/module/dwc3/parameters/high_bw_ep_in_num 5 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} diff --git a/rootdir/init.qcom.usb.sh b/rootdir/init.qcom.usb.sh deleted file mode 100755 index d8dc459..0000000 --- a/rootdir/init.qcom.usb.sh +++ /dev/null @@ -1,308 +0,0 @@ -#!/system/bin/sh -# Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of The Linux Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# -chown -h root.system /sys/devices/platform/msm_hsusb/gadget/wakeup -chmod -h 220 /sys/devices/platform/msm_hsusb/gadget/wakeup - -# Set platform variables -if [ -f /sys/devices/soc0/hw_platform ]; then - soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null -else - soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null -fi - -# Get hardware revision -if [ -f /sys/devices/soc0/revision ]; then - soc_revision=`cat /sys/devices/soc0/revision` 2> /dev/null -else - soc_revision=`cat /sys/devices/system/soc/soc0/revision` 2> /dev/null -fi - -# -# Allow persistent usb charging disabling -# User needs to set usb charging disabled in persist.usb.chgdisabled -# -target=`getprop ro.board.platform` -usbchgdisabled=`getprop persist.usb.chgdisabled` -case "$usbchgdisabled" in - "") ;; #Do nothing here - * ) - case $target in - "msm8660") - echo "$usbchgdisabled" > /sys/module/pmic8058_charger/parameters/disabled - echo "$usbchgdisabled" > /sys/module/smb137b/parameters/disabled - ;; - "msm8960") - echo "$usbchgdisabled" > /sys/module/pm8921_charger/parameters/disabled - ;; - esac -esac - -usbcurrentlimit=`getprop persist.usb.currentlimit` -case "$usbcurrentlimit" in - "") ;; #Do nothing here - * ) - case $target in - "msm8960") - echo "$usbcurrentlimit" > /sys/module/pm8921_charger/parameters/usb_max_current - ;; - esac -esac - -# -# Check ESOC for external MDM -# -# Note: currently only a single MDM is supported -# -if [ -d /sys/bus/esoc/devices ]; then -for f in /sys/bus/esoc/devices/*; do - if [ -d $f ]; then - if [ `grep "^MDM" $f/esoc_name` ]; then - esoc_link=`cat $f/esoc_link` - break - fi - fi -done -fi - -target=`getprop ro.board.platform` - -# soc_ids for 8937 -if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` -else - soc_id=`cat /sys/devices/system/soc/soc0/id` -fi - -# -# Allow USB enumeration with default PID/VID -# -baseband=`getprop ro.baseband` - -echo 1 > /sys/class/android_usb/f_mass_storage/lun/nofua -usb_config=`getprop persist.sys.usb.config` -case "$usb_config" in - "" | "adb") #USB persist config not set, select default configuration - case "$esoc_link" in - "PCIe") - setprop persist.sys.usb.config diag,diag_mdm,serial_cdev,rmnet_qti_ether,mass_storage,adb - ;; - *) - case "$baseband" in - "apq") - setprop persist.sys.usb.config diag,adb - ;; - *) - case "$soc_hwplatform" in - "Dragon" | "SBC") - setprop persist.sys.usb.config diag,adb - ;; - *) - case "$target" in - "msm8916") - setprop persist.sys.usb.config diag,serial_smd,rmnet_bam,adb - ;; - "msm8994" | "msm8992") - setprop persist.sys.usb.config diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,adb - ;; - "msm8996") - setprop persist.sys.usb.config diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,adb - ;; - "msm8909") - setprop persist.sys.usb.config diag,serial_smd,rmnet_qti_bam,adb - ;; - "msm8937") - case "$soc_id" in - "313" | "320") - setprop persist.sys.usb.config diag,serial_smd,rmnet_ipa,adb - ;; - *) - setprop persist.sys.usb.config diag,serial_smd,rmnet_qti_bam,adb - ;; - esac - ;; - "msm8952" | "msm8953") - setprop persist.sys.usb.config diag,serial_smd,rmnet_ipa,adb - ;; - "msm8998") - setprop persist.sys.usb.config diag,serial_cdev,rmnet_gsi,adb - ;; - *) - setprop persist.sys.usb.config diag,adb - ;; - esac - ;; - esac - ;; - esac - ;; - esac - ;; - * ) ;; #USB persist config exists, do nothing -esac - -# set USB controller's device node -case "$target" in - "msm8996") - setprop sys.usb.controller "6a00000.dwc3" - setprop sys.usb.rndis.func.name "rndis_bam" - ;; - "msm8998") - setprop sys.usb.controller "a800000.dwc3" - setprop sys.usb.rndis.func.name "gsi" - ;; - "msmfalcon") - setprop sys.usb.controller "a800000.dwc3" - setprop sys.usb.rndis.func.name "rndis_bam" - ;; - *) - ;; -esac - -# check configfs is mounted or not -if [ -d /config/usb_gadget ]; then - setprop sys.usb.configfs 1 -fi - -# -# Do target specific things -# -case "$target" in - "msm8974") -# Select USB BAM - 2.0 or 3.0 - echo ssusb > /sys/bus/platform/devices/usb_bam/enable - ;; - "apq8084") - if [ "$baseband" == "apq" ]; then - echo "msm_hsic_host" > /sys/bus/platform/drivers/xhci_msm_hsic/unbind - fi - ;; - "msm8226") - if [ -e /sys/bus/platform/drivers/msm_hsic_host ]; then - if [ ! -L /sys/bus/usb/devices/1-1 ]; then - echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind - fi - fi - ;; - "msm8994" | "msm8992" | "msm8996" | "msm8953") - echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports - echo 131072 > /sys/module/g_android/parameters/mtp_tx_req_len - echo 131072 > /sys/module/g_android/parameters/mtp_rx_req_len - ;; - "msm8937") - case "$soc_id" in - "313" | "320") - echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports - ;; - esac - ;; -esac - -# -# set module params for embedded rmnet devices -# -rmnetmux=`getprop persist.rmnet.mux` -case "$baseband" in - "mdm" | "dsda" | "sglte2") - case "$rmnetmux" in - "enabled") - echo 1 > /sys/module/rmnet_usb/parameters/mux_enabled - echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links - echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev - ;; - esac - echo 1 > /sys/module/rmnet_usb/parameters/rmnet_data_init - # Allow QMUX daemon to assign port open wait time - chown -h radio.radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait - ;; - "dsda2") - echo 2 > /sys/module/rmnet_usb/parameters/no_rmnet_devs - echo hsicctl,hsusbctl > /sys/module/rmnet_usb/parameters/rmnet_dev_names - case "$rmnetmux" in - "enabled") #mux is neabled on both mdms - echo 3 > /sys/module/rmnet_usb/parameters/mux_enabled - echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links - echo 17 > write /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev - ;; - "enabled_hsic") #mux is enabled on hsic mdm - echo 1 > /sys/module/rmnet_usb/parameters/mux_enabled - echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links - echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev - ;; - "enabled_hsusb") #mux is enabled on hsusb mdm - echo 2 > /sys/module/rmnet_usb/parameters/mux_enabled - echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links - echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev - ;; - esac - echo 1 > /sys/module/rmnet_usb/parameters/rmnet_data_init - # Allow QMUX daemon to assign port open wait time - chown -h radio.radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait - ;; -esac - -# -# Add support for exposing lun0 as cdrom in mass-storage -# -cdromname="/system/etc/cdrom_install.iso" -platformver=`cat /sys/devices/soc0/hw_platform` -case "$target" in - "msm8226" | "msm8610" | "msm8916") - case $platformver in - "QRD") - echo "mounting usbcdrom lun" - echo $cdromname > /sys/class/android_usb/android0/f_mass_storage/rom/file - chmod 0444 /sys/class/android_usb/android0/f_mass_storage/rom/file - ;; - esac - ;; -esac - -# -# Initialize RNDIS Diag option. If unset, set it to 'none'. -# -diag_extra=`getprop persist.sys.usb.config.extra` -if [ "$diag_extra" == "" ]; then - setprop persist.sys.usb.config.extra none -fi - -# soc_ids for 8937 -if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` -else - soc_id=`cat /sys/devices/system/soc/soc0/id` -fi - -# enable rps cpus on msm8937 target -setprop sys.usb.rps_mask 0 -case "$soc_id" in - "294" | "295") - setprop sys.usb.rps_mask 40 - ;; -esac diff --git a/rootdir/init.target.rc b/rootdir/init.target.rc deleted file mode 100644 index 1ef9081..0000000 --- a/rootdir/init.target.rc +++ /dev/null @@ -1,185 +0,0 @@ -# Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of The Linux Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# - -on early-init - mkdir /firmware 0771 system system - mkdir /system 0777 root root - symlink /data/tombstones /tombstones - mkdir /dsp 0771 media media - -on fs - wait /dev/block/bootdevice - - mount_all fstab.qcom - swapon_all fstab.qcom - write /proc/sys/vm/page-cluster 0 - write /proc/sys/vm/swappiness 100 - - mkdir /persist/data 0700 system system - mkdir /persist/bms 0700 root system - restorecon_recursive /persist - -on post-fs-data - mkdir /data/tombstones 0771 system system - mkdir /tombstones/modem 0771 system system - mkdir /tombstones/lpass 0771 system system - mkdir /tombstones/wcnss 0771 system system - mkdir /tombstones/dsps 0771 system system - mkdir /persist/data/sfs 0700 system system - mkdir /persist/data/tz 0700 system system - mkdir /data/misc/hbtp 0750 system system - mkdir /data/misc/dts 0770 media audio - -# Start camera server as daemon -service qcamerasvr /system/bin/mm-qcamera-daemon - class late_start - user camera - group camera system inet input graphics - writepid /dev/cpuset/system-background/tasks - -# Allow usb charging to be disabled peristently -on property:persist.usb.chgdisabled=1 - write /sys/class/power_supply/battery/charging_enabled 0 - -on property:persist.usb.chgdisabled=0 - write /sys/class/power_supply/battery/charging_enabled 1 - -service qseecomd /system/bin/qseecomd - class core - user root - group root - -service thermal-engine /system/vendor/bin/thermal-engine - class main - user root - socket thermal-send-client stream 0666 system system - socket thermal-recv-client stream 0660 system system - socket thermal-recv-passive-client stream 0666 system system - group root - -service audiod /system/bin/audiod - class late_start - user system - group system - -service wcnss-service /system/bin/wcnss_service - class main - user system - group system wifi radio - oneshot - -service imsqmidaemon /system/bin/imsqmidaemon - class main - user system - socket ims_qmid stream 0660 system radio - group radio log diag - -service imsdatadaemon /system/bin/imsdatadaemon - class main - user system - socket ims_datad stream 0660 system radio - group system wifi radio inet log diag - writepid /dev/cpuset/system-background/tasks - disabled - -on property:sys.ims.QMI_DAEMON_STATUS=1 - start imsdatadaemon - -service ims_rtp_daemon /system/bin/ims_rtp_daemon - class main - user system - socket ims_rtpd stream 0660 system radio - group radio diag diag inet log - disabled - -service imscmservice /system/bin/imscmservice - class main - user system - group radio diag inet log - writepid /dev/cpuset/system-background/tasks - disabled - -on property:sys.ims.DATA_DAEMON_STATUS=1 - start ims_rtp_daemon - start imscmservice - -service ppd /system/vendor/bin/mm-pp-dpps - class late_start - disabled - user system - socket pps stream 0660 system system - group system graphics - -on property:init.svc.surfaceflinger=stopped - stop ppd - -on property:init.svc.surfaceflinger=running - start ppd - -on property:init.svc.surfaceflinger=restarting - stop ppd - -on property:init.svc.zygote=stopped - stop ppd - -on property:init.svc.zygote=running - start ppd - -on property:init.svc.zygote=restarting - stop ppd - -on charger - wait /dev/block/bootdevice/by-name/system - mount ext4 /dev/block/bootdevice/by-name/system /system ro barrier=1 - load_all_props - setprop sys.usb.configfs 0 - setprop persist.sys.usb.config mass_storage - start hvdcp_opti - -service hbtp /system/vendor/bin/hbtp_daemon - class main - user system - group system - disabled - -service adsprpcd /system/bin/adsprpcd - class main - user media - group media - -service per_mgr /system/bin/pm-service - class core - user system - group system net_raw - writepid /dev/cpuset/system-background/tasks - -service hvdcp_opti /system/bin/hvdcp_opti - class main - user root - group root diff --git a/rootdir/ueventd.qcom.rc b/rootdir/ueventd.qcom.rc deleted file mode 100644 index 34d56cd..0000000 --- a/rootdir/ueventd.qcom.rc +++ /dev/null @@ -1,277 +0,0 @@ -# Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of The Linux Foundation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# the DIAG device node is not world writable/readable. -/dev/diag 0660 system qcom_diag - -/dev/genlock 0666 system system -/dev/kgsl 0666 system system -/dev/kgsl-3d0 0666 system system -/dev/kgsl-2d0 0666 root root -/dev/kgsl-2d1 0666 root root -/dev/ion 0664 system system -/dev/rtc0 0660 system system -/dev/smd0 0660 system system -/dev/smd4 0660 system system -/dev/smd_cxm_qmi 0640 radio radio -/dev/smd5 0660 system system -/dev/smd6 0660 system system -/dev/smd7 0660 bluetooth bluetooth -/dev/ccid_bridge 0660 system system -/dev/ipa 0660 system net_admin -/dev/wwan_ioctl 0660 system net_admin -/dev/ipaNatTable 0660 net_admin net_admin -/dev/rmnet_ctrl 0660 usb usb -/dev/dpl_ctrl 0660 usb usb - -#permissions for CSVT -/dev/smd11 0660 radio radio - -/dev/radio0 0640 system system -/dev/rfcomm0 0660 bluetooth bluetooth -/dev/ttyUSB0 0660 bluetooth bluetooth -/dev/smdcntl0 0640 radio radio -/dev/smdcntl1 0640 radio radio -/dev/smdcntl2 0640 radio radio -/dev/smdcntl3 0640 radio radio -/dev/smdcntl4 0640 radio radio -/dev/smdcntl5 0640 radio radio -/dev/smdcntl6 0640 radio radio -/dev/smdcntl7 0640 radio radio -/dev/smdcntl8 0640 radio radio -/dev/smdcnt_rev0 0640 radio radio -/dev/smdcnt_rev1 0640 radio radio -/dev/smdcnt_rev2 0640 radio radio -/dev/smdcnt_rev3 0640 radio radio -/dev/smdcnt_rev4 0640 radio radio -/dev/smdcnt_rev5 0640 radio radio -/dev/smdcnt_rev6 0640 radio radio -/dev/smdcnt_rev7 0640 radio radio -/dev/smdcnt_rev8 0640 radio radio -/dev/smuxctl32 0640 radio radio -/dev/sdioctl0 0640 radio radio -/dev/sdioctl1 0640 radio radio -/dev/sdioctl2 0640 radio radio -/dev/sdioctl3 0640 radio radio -/dev/sdioctl4 0640 radio radio -/dev/sdioctl5 0640 radio radio -/dev/sdioctl6 0640 radio radio -/dev/sdioctl7 0640 radio radio -/dev/sdioctl8 0640 radio radio -/dev/rmnet_mux_ctrl 0640 radio radio -/dev/hsicctl0 0640 radio radio -/dev/hsicctl1 0640 radio radio -/dev/hsicctl2 0640 radio radio -/dev/hsicctl3 0640 radio radio -/dev/hsicctl4 0640 radio radio -/dev/hsicctl5 0640 radio radio -/dev/hsicctl6 0640 radio radio -/dev/hsicctl7 0640 radio radio -/dev/hsicctl8 0640 radio radio -/dev/hsicctl9 0640 radio radio -/dev/hsicctl10 0640 radio radio -/dev/hsicctl11 0640 radio radio -/dev/hsicctl12 0640 radio radio -/dev/hsicctl13 0640 radio radio -/dev/hsicctl14 0640 radio radio -/dev/hsicctl15 0640 radio radio -/dev/hsicctl16 0640 radio radio -/dev/mhi_pipe_14 0640 radio radio -/dev/mhi_pipe_16 0640 radio radio -/dev/mhi_pipe_32 0640 radio radio -/dev/at_usb0 0640 radio radio -/dev/at_mdm0 0640 radio radio -/dev/video* 0660 system camera -/dev/media* 0660 system camera -/dev/v4l-subdev* 0660 system camera -/dev/qseecom 0660 system drmrpc -/dev/qsee_ipc_irq_spss 0660 system drmrpc -/dev/seemplog 0660 system system -/dev/pft 0660 system drmrpc -/dev/spcom 0660 system system -/dev/sp_kernel 0660 system system -/dev/sp_ssr 0660 system system -/dev/sp_keymaster 0660 system system -/dev/cryptoapp 0660 system system -/dev/gemini0 0660 system camera -/dev/jpeg0 0660 system camera -/dev/jpeg1 0660 system camera -/dev/jpeg2 0660 system camera -/dev/jpeg3 0660 system camera -/dev/adsprpc-smd 0664 system system -/dev/system_health_monitor 0644 radio system -/dev/mdss_rotator 0664 system system -/dev/earlycamera 0666 system system -# wlan -/dev/wcnss_wlan 0660 system system -/dev/wcnss_ctrl 0660 system system -/sys/devices/soc/a000000.qcom,wcnss-wlan/net/wlan0/queues/rx-* rps_cpus 0660 system system -/sys/devices/soc/a000000.qcom,wcnss-wlan/net/p2p0/queues/rx-* rps_cpus 0660 system system -/dev/msm_camera/* 0660 system camera -/dev/gemini/ 0660 system camera -/dev/mercury0 0660 system camera -/dev/msm_vidc_reg 0660 system audio -/dev/msm_vidc_dec 0660 system audio -/dev/msm_vidc_dec_sec 0660 system audio -/dev/msm_vidc_enc 0660 system audio -/dev/msm_rotator 0660 system system -/dev/hw_random 0600 root root -/dev/sdsprpc-smd 0660 system system - -#permissions for audio -/dev/wcd-dsp-glink 0660 system audio -/dev/audio_slimslave 0660 system audio -/dev/msm_qcelp 0660 system audio -/dev/msm_evrc 0660 system audio -/dev/msm_wma 0660 system audio -/dev/msm_wmapro 0660 system audio -/dev/msm_alac 0660 system audio -/dev/msm_ape 0660 system audio -/dev/msm_amrnb 0660 system audio -/dev/msm_amrwb 0660 system audio -/dev/msm_amrwbplus 0660 system audio -/dev/msm_aac 0660 system audio -/dev/msm_multi_aac 0660 system audio -/dev/msm_aac_in 0660 system audio -/dev/msm_qcelp_in 0660 system audio -/dev/msm_evrc_in 0660 system audio -/dev/msm_amrnb_in 0640 system audio -/dev/msm_a2dp_in 0660 system audio -/dev/msm_ac3 0660 system audio -/dev/msm_audio_cal 0660 system audio -/dev/msm_hweffects 0660 system audio -/dev/msm_cad 0660 system audio -/dev/msm_fm 0660 system audio -/dev/msm_mvs 0660 system audio -/dev/msm_pcm_lp_dec 0660 system audio -/dev/msm_preproc_ctl 0660 system audio -/dev/msm_rtac 0660 system audio -/dev/msm_voicememo 0660 system audio -/dev/smd3 0660 bluetooth net_bt_stack -/dev/smd2 0660 bluetooth net_bt_stack -/dev/ttyHSL1 0660 system system -/dev/ttyHS1 0660 system system -/dev/mdm 0660 system radio -/sys/devices/virtual/smdpkt/smdcntl* open_timeout 0664 radio radio -/dev/sdio_tty_ciq_00 0660 system system -/dev/tty_sdio_00 0660 system system -/dev/ttyGS0 0660 system system -/dev/i2c-5 0660 media media -/dev/voice_svc 0660 system audio -/dev/avtimer 0660 system audio - -# DVB devices -/dev/dvb/adapter0/demux* 0440 media media -/dev/dvb/adapter0/dvr* 0660 media media -/dev/dvb/adapter0/video* 0660 media media - -# Broadcast devices -/dev/tsc_mux0 0660 media media -/dev/tsc_ci0 0660 media media - -# sensors -/sys/devices/i2c-12/12-* pollrate_ms 0664 system system -/sys/devices/f9925000.i2c/i2c-0/0-* enable 0660 input system -/sys/devices/f9925000.i2c/i2c-0/0-* poll_delay 0660 input system -/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable 0660 input system -/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* poll_delay 0660 input system -/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable_wakeup 0660 input system -/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* max_latency 0660 input system -/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* flush 0660 input system -/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* calibrate 0660 input system -/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* enable 0660 input system -/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* poll_delay 0660 input system -/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* enable_wakeup 0660 input system -/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* max_latency 0660 input system -/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* flush 0660 input system -/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* calibrate 0660 input system -/sys/devices/virtual/optical_sensors/proximity ps_adc 0660 input system -/sys/devices/virtual/optical_sensors/proximity ps_poll_delay 0660 input system -/sys/devices/virtual/optical_sensors/lightsensor ls_auto 0660 input system -/sys/devices/virtual/optical_sensors/lightsensor ls_poll_delay 0660 input system -/sys/devices/virtual/input/input* poll 0660 input system -/sys/devices/virtual/input/input* pollrate_ms 0660 input system -/sys/devices/soc/78b7000.i2c/i2c-3/3-0020/input/input* secure_touch 0440 system drmrpc -/sys/devices/soc/78b7000.i2c/i2c-3/3-0020/input/input* secure_touch_enable 0660 system drmrpc -/sys/devices/soc/78b7000.i2c/i2c-3/3-0038/input/input* secure_touch 0440 system drmrpc -/sys/devices/soc/78b7000.i2c/i2c-3/3-0038/input/input* secure_touch_enable 0660 system drmrpc -/sys/devices/soc/78b7000.i2c/i2c-3/3-004b/input/input* secure_touch 0440 system drmrpc -/sys/devices/soc/78b7000.i2c/i2c-3/3-004b/input/input* secure_touch_enable 0660 system drmrpc -/sys/devices/soc/c179000.i2c/i2c-5/5-0020/input/input* secure_touch 0440 system drmrpc -/sys/devices/soc/c179000.i2c/i2c-5/5-0020/input/input* secure_touch_enable 0660 system drmrpc - -# laser sensor access -/sys/devices/virtual/input/input* enable_ps_sensor 0660 system system -/sys/devices/virtual/input/input* set_delay_ms 0660 system system - -# vm_bms -/dev/vm_bms 0660 system system -/dev/battery_data 0660 system system - -# wlan -/dev/wcnss_wlan 0660 system system -/dev/wcnss_ctrl 0660 system system -/sys/devices/soc/600000.qcom,pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net/wlan0/queues/rx-* rps_cpus 0660 system system -/sys/devices/soc/600000.qcom,pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net/p2p0/queues/rx-* rps_cpus 0660 system system - -#nfc permissions -/dev/nfc-nci 0660 nfc nfc -/dev/nq-nci 0660 nfc nfc -/dev/assd 0660 nfc nfc - -# UIO devices -/dev/uio0 0660 system system -/dev/uio1 0660 system system -/dev/uio2 0660 system system - -# SSR devices -/dev/subsys_* 0640 system system - -# Ultrasound device -/dev/usf1 0660 system system - -# Ramdump devices -/dev/ramdump* 0640 system system - -# Fingerprint device -/dev/qbt1000 0660 system system - -#ImproveTouch device -/dev/hbtp_input 0660 system system -/dev/hbtp_vm 0660 system system - -# Add device block for FRP -/dev/block/platform/soc/7824900.sdhci/by-name/config 0600 system system -/dev/block/platform/soc/7464900.sdhci/by-name/frp 0600 system system -/dev/block/platform/soc/624000.ufshc/by-name/frp 0600 system system -/dev/block/platform/soc/1da4000.ufshc/by-name/frp 0600 system system - -# fpc Fingerprint -/sys/devices/soc/soc:fpc1020 hw_reset 0220 system system -/sys/devices/soc/soc:fpc1020 irq 0660 system system -/sys/devices/soc/soc:fpc1020 wakeup_enable 0220 system system -/sys/devices/soc/soc:fpc1020 compatible_all 0220 system system diff --git a/sepolicy/bluetooth_loader.te b/sepolicy/bluetooth_loader.te deleted file mode 100644 index 4af3d38..0000000 --- a/sepolicy/bluetooth_loader.te +++ /dev/null @@ -1,2 +0,0 @@ -allow bluetooth_loader persist_bluetooth_file:dir search; -allow bluetooth_loader persist_bluetooth_file:file rw_file_perms; diff --git a/sepolicy/device.te b/sepolicy/device.te deleted file mode 100644 index 8b4b5c2..0000000 --- a/sepolicy/device.te +++ /dev/null @@ -1,2 +0,0 @@ -type gx_fpd_device, dev_type; -type lirc_device, dev_type; diff --git a/sepolicy/file.te b/sepolicy/file.te deleted file mode 100644 index abf3166..0000000 --- a/sepolicy/file.te +++ /dev/null @@ -1,5 +0,0 @@ -type fpc_data_file, file_type, data_file_type; -type fpce_socket, file_type; -type fpc_sysfs, fs_type, sysfs_type; -type netmgrd_data_file, file_type; -type gx_fpd_data_file, file_type, data_file_type; diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts deleted file mode 100644 index d1a584e..0000000 --- a/sepolicy/file_contexts +++ /dev/null @@ -1,24 +0,0 @@ -# Block devices -/dev/block/bootdevice/by-name/persist u:object_r:persist_block_device:s0 -/dev/block/bootdevice/by-name/userdata u:object_r:userdata_block_device:s0 - -# Data files -/data/misc/netmgr/log\.txt u:object_r:netmgrd_data_file:s0 - -# Fpc Fingerprint -/data/fpc(/.*)? u:object_r:fpc_data_file:s0 -/dev/socket/fpce(/.*)? u:object_r:fpce_socket:s0 -/sys/devices/soc/soc:fpc1020(/.*)? u:object_r:fpc_sysfs:s0 - -# For Goodix fingerprint -/dev/gf66xx-spi u:object_r:gx_fpd_device:s0 -/dev/ttyACM[0-9]* u:object_r:gx_fpd_device:s0 -/dev/goodix_fp* u:object_r:gx_fpd_device:s0 -/system/bin/gx_fpd u:object_r:gx_fpd_exec:s0 - -# Goodix Fingerprint data -/data/system/fingerprint(/.*)? u:object_r:gx_fpd_data_file:s0 -/persist/data/gxfp(/.*)? u:object_r:gx_fpd_data_file:s0 - -# Ir -/dev/lirc[0-9]* u:object_r:lirc_device:s0 diff --git a/sepolicy/fingerprintd.te b/sepolicy/fingerprintd.te deleted file mode 100644 index 96123e0..0000000 --- a/sepolicy/fingerprintd.te +++ /dev/null @@ -1,12 +0,0 @@ -allow fingerprintd gx_fpd:binder { transfer call }; -allow fingerprintd gx_fpd_service:service_manager find; -allow fingerprintd fingerprint_service:service_manager find; -allow fingerprintd fpc_sysfs:file rw_file_perms; -allow fingerprintd fpc_sysfs:dir rw_dir_perms; -allow fingerprintd tee_device:chr_file rw_file_perms; -allow fingerprintd uhid_device:chr_file rw_file_perms; -allow fingerprintd fpc_data_file:dir rw_dir_perms; -allow fingerprintd fpc_data_file:sock_file create_file_perms; -allow fingerprintd storage_file:dir search; -set_prop(fingerprintd, system_prop) -r_dir_file(fingerprintd, firmware_file) diff --git a/sepolicy/fsck.te b/sepolicy/fsck.te deleted file mode 100644 index 1500b5f..0000000 --- a/sepolicy/fsck.te +++ /dev/null @@ -1 +0,0 @@ -allow fsck persist_block_device:blk_file rw_file_perms; diff --git a/sepolicy/gx_fpd.te b/sepolicy/gx_fpd.te deleted file mode 100644 index 78e02b5..0000000 --- a/sepolicy/gx_fpd.te +++ /dev/null @@ -1,50 +0,0 @@ -type gx_fpd, domain; -type gx_fpd_exec, exec_type, file_type; - -# gx_fpd -init_daemon_domain(gx_fpd) -binder_use(gx_fpd) - -# need to find KeyStore and add self -allow gx_fpd fingerprintd_service:service_manager { add find }; - -# allow HAL module to read dir contents -allow gx_fpd gx_fpd_data_file:file create_file_perms; - -# allow HAL module to read/write/unlink contents of this dir -allow gx_fpd gx_fpd_data_file:dir create_dir_perms; - -# Need to add auth tokens to KeyStore -use_keystore(gx_fpd) -allow gx_fpd keystore:keystore_key { add_auth }; - -# For permissions checking -binder_call(gx_fpd, system_server); -allow gx_fpd permission_service:service_manager find; - -#Allow access to goodix device -allow gx_fpd gx_fpd_device:chr_file rw_file_perms; - -#Allow access to tee device -allow gx_fpd tee_device:chr_file rw_file_perms; - -# Allow access to ion device -allow gx_fpd ion_device:chr_file rw_file_perms; - -#allow create socket -allow gx_fpd self:socket create_socket_perms; -allow gx_fpd self:{ netlink_socket netlink_generic_socket } create_socket_perms; - -#allow read/write property -set_prop(gx_fpd, system_prop) - -allow gx_fpd gx_fpd_service:service_manager { add find }; - -allow gx_fpd fingerprintd:binder { transfer call }; -allow gx_fpd fuse:dir search; -allow gx_fpd fuse:file { getattr open append }; -allow gx_fpd self:capability dac_override; -allow gx_fpd storage_file:dir search; -allow gx_fpd storage_file:lnk_file read; -r_dir_file(gx_fpd, firmware_file) -allow gx_fpd tmpfs:dir search; diff --git a/sepolicy/ims.te b/sepolicy/ims.te deleted file mode 100644 index 7491188..0000000 --- a/sepolicy/ims.te +++ /dev/null @@ -1 +0,0 @@ -allow ims self:capability { net_raw net_admin }; diff --git a/sepolicy/init.te b/sepolicy/init.te deleted file mode 100644 index 9fd89ed..0000000 --- a/sepolicy/init.te +++ /dev/null @@ -1,3 +0,0 @@ -allow init fingerprintd:binder { transfer call }; -allow init gx_fpd_device:chr_file { write ioctl }; -allow init sysfs_devices_system_cpu:dir write; diff --git a/sepolicy/location.te b/sepolicy/location.te deleted file mode 100644 index 0869913..0000000 --- a/sepolicy/location.te +++ /dev/null @@ -1,2 +0,0 @@ -allow location sysfs_wake_lock:file { write open }; -allow location diag_device:chr_file { read write }; diff --git a/sepolicy/netmgrd.te b/sepolicy/netmgrd.te deleted file mode 100644 index 825a231..0000000 --- a/sepolicy/netmgrd.te +++ /dev/null @@ -1,3 +0,0 @@ -type_transition netmgrd system_data_file:file netmgrd_data_file "log.txt"; - -allow netmgrd netmgrd_data_file:file create_file_perms; diff --git a/sepolicy/per_mgr.te b/sepolicy/per_mgr.te deleted file mode 100644 index 6d75682..0000000 --- a/sepolicy/per_mgr.te +++ /dev/null @@ -1 +0,0 @@ -allow per_mgr self:capability net_raw; diff --git a/sepolicy/priv_app.te b/sepolicy/priv_app.te deleted file mode 100644 index f83e41f..0000000 --- a/sepolicy/priv_app.te +++ /dev/null @@ -1 +0,0 @@ -allow priv_app device:dir read; diff --git a/sepolicy/qti_init_shell.te b/sepolicy/qti_init_shell.te deleted file mode 100644 index 965c1b4..0000000 --- a/sepolicy/qti_init_shell.te +++ /dev/null @@ -1,3 +0,0 @@ -allow qti_init_shell bluetooth_data_file:file r_file_perms; -allow qti_init_shell bluetooth_loader_exec:file { read open }; -allow qti_init_shell proc:dir setattr; diff --git a/sepolicy/radio.te b/sepolicy/radio.te deleted file mode 100644 index cedd222..0000000 --- a/sepolicy/radio.te +++ /dev/null @@ -1 +0,0 @@ -allow system_server radio_prop:property_service set; diff --git a/sepolicy/rmt_storage.te b/sepolicy/rmt_storage.te deleted file mode 100644 index a89459d..0000000 --- a/sepolicy/rmt_storage.te +++ /dev/null @@ -1 +0,0 @@ -allow rmt_storage self:capability net_raw; diff --git a/sepolicy/service.te b/sepolicy/service.te deleted file mode 100644 index c6ad55b..0000000 --- a/sepolicy/service.te +++ /dev/null @@ -1 +0,0 @@ -type gx_fpd_service, service_manager_type; diff --git a/sepolicy/service_contexts b/sepolicy/service_contexts deleted file mode 100644 index eb3bd76..0000000 --- a/sepolicy/service_contexts +++ /dev/null @@ -1 +0,0 @@ -goodix.fp u:object_r:gx_fpd_service:s0 diff --git a/sepolicy/system_app.te b/sepolicy/system_app.te deleted file mode 100644 index 9faef20..0000000 --- a/sepolicy/system_app.te +++ /dev/null @@ -1,2 +0,0 @@ -# Allow binder calls to fingerprintd -binder_call(system_app, fingerprintd) diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te deleted file mode 100644 index 9e71316..0000000 --- a/sepolicy/system_server.te +++ /dev/null @@ -1 +0,0 @@ -allow system_server lirc_device:chr_file rw_file_perms; diff --git a/sepolicy/tee.te b/sepolicy/tee.te deleted file mode 100644 index 949da7b..0000000 --- a/sepolicy/tee.te +++ /dev/null @@ -1,6 +0,0 @@ -# /data/goodix labeling -type_transition tee system_data_file:{ dir file } gx_fpd_data_file; - -allow tee gx_fpd_data_file:dir create_dir_perms; -allow tee gx_fpd_data_file:file create_file_perms; -allow tee system_data_file:dir create_dir_perms; diff --git a/sepolicy/ueventd.te b/sepolicy/ueventd.te deleted file mode 100644 index 801be3d..0000000 --- a/sepolicy/ueventd.te +++ /dev/null @@ -1 +0,0 @@ -allow ueventd fpc_sysfs:file rw_file_perms; diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 05cacfb..3bc429e 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -42,9 +42,6 @@ setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" # Copyright headers and guards write_headers -# Common QC blobs -write_makefiles "$MY_DIR"/proprietary-files-qc.txt - # Device blobs write_makefiles "$MY_DIR"/proprietary-files.txt diff --git a/wifi/firmware/WCNSS_cfg.dat b/wifi/firmware/WCNSS_cfg.dat deleted file mode 100644 index 0637816b8238eb9990803e1014ad42a1bd8d2c77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11514 zcmeI137izg6^CE%G&_4Sy(5aZJFdVWAhR3-B1)@-`&h4_MiFF1j0+43ii+CcqG(VD zk07D}Vo*`>zVTS&MLZ%JW8#T1@xlucjRAD?y`HI|ci4&ikZ3d%`|YcK_3Bl1RbTtZ zDhribQeds^AW|SAHnfF4Ek&APYq7K7(}&alhFK!b;Rp>Z?`KPSJ8Y>~P*fh5f|wHv z#Y)AlPDneqwd@1^VK_9acHBY;k96!JD25U!O*v8q%^?C#(vfnA!Zx1cw!m(ibnNY* zC2S8nz>Y8`7LwXzNOnpkWam`EJvA1Wx@24~hRb1>WJ0d?;_j}gQrRu#NCm{iiR~_q zUFkXY9?*(^X7>h!>GV@gGM0aQM0B z#8ym?%NJ03Zd`VU?l1&K!|8AdEP|!*0=x%bLyNk&>Yq!35%xRgOCmPKHxp5=@3u;WU^6r^6X= zCQOC1;A}VtJeUU4;asSL8E_t)4>REcxDb8?v*04Q7%qVnbC?a6CLQ-O?B#F;{5qMC zIn|DPCCr7ZU>;lz*T8S89hnacU?Kb#u7%&hqGZCp4z7nAU@_cC&YO~s`_PQAd$Z@* zOW+o9yLXY}Zny{Th5O)s zXm?TAeE_=@9)ySBVR!`U;Zd&J-?K-L#T@%_cmke;r(hZUA?e7|o+Hn|v+x}Jk@)9f zIlKTb!k^$J_%pl=e}TWkE8JJFlH)aa9p0e-o8rg{c#HPG!Q0~4e}{kIdk5Zy_wc{Z z{62t{@F9GJ?_=6N!F~#>;4^Zr#(oZK;0yQ?{s~{fzi3~JUB~shKIO>Q@C`J8%yz_r z0tiiXTsz9O3xyLMI}Alo3?)zsWyJ6Zm8!`iHCV0dv(}XM#Uh0qC~k$wwpe{8_k!_o zU#ZCZp)||G8|s=z(V~4`4N0hW)4KZfaULwe81?5Ko7kBxm?H-|KSkr1n&`Vk z>uPs~s5%2h+w>ev@n0u#k%oq}$4p)0v|eHYGd8!sx*vHfJ!U4vH@XhGZl;)boUW}F z9nQ>C=cDyn{iP+aDC~0HV!|~bSkKqNoVLa)-!KWKsglocVqGel&x~uVp0`;yvv#IU zZ4lizv+f>sU2L zj!Z?*UvudB>OOHx_(gr%hug(3=9;&hG8SZ1xwu~{dLHFa&%V}AU8YISUXZ)r3+)Nk-X{(PA6 zjnz(WCf@WlZFzGLpN-Abb?MUmj3tI3-;LE=p2qsV##YzYjHTZziXQ8^>NrX@s882H zkB#-)`4z*rK7+2Ij$?BAG5E}J&}y50uc%MgPuEiG+?M|M`VC>eNmI+w5CYWDrbTTq zr^YLFp!bQQF(yvO(7ze9Pw+cKkM*3@>bG&9K9!XsUAmNTRoI~dt0-Kkw+d6!719~% zjL~^ycWGH_7ZgdQwAx{tvf7dTt3+DU)`qsYgqww|LcS)W(R9A<(oU*6v~A_~>e02b zw9qQ(*se{unH?%CDJ~jY6KOtWQnGetoi}yvoGWH6oPW){{d;!n{N;sD;4IzFi8bax>{isaB&lOVB5aP%9YoaolX#C3@ zd9Xs9bYEE(l~Y+mjStHhoMC@Oh4|C*-G zWlvfEWexgM(coWWx}J5^be(hkGlKr24e{sY@t==Bn?DdgGf(^ldHfeP>33w7==Gee z9b4l~oia&g&8$nxm0}fGmStPq09G@r$O>B}REi~cj)0o zWFO-4X~;e4Z#3k6Q;yvW_JjSQH*<8c2QbG2>l0|j3H0N*te+m1KGc29xZaU|^^V;i zI{?s(-9h9WoJ!b3utUMujEOlI4j~4;*glN8X7pki?m1|=4qC2*mg}J9Ix!19czf6j z4uT_L0?dGUa63E&Z@}kJj2>J8d&3|Y1*gG9a4p;q&%-;g4vyxWqBG)h4CgU|@s5R& z%xM&w+;PlhG;^$h<6%s_-jtj1_3ew|kC#2iz$U zxl8!J1~lZmv3+@~^+QAMkA{2?#{ctPhQV43rgVB()dNFP2 z#qMM9I6MJQrqGL-i?0{Q9Q$c_2A+lI0KHhA_Z(RcFTjh?STBx9Rxc*ctMD427u#>Z zo7`I~$bnug=*99j{n3lX*NbU?7v2-}V)y|6O85|by_or-7rW@iE_$*1Su$d;rY%P= zmVjPtuO;6)SPx&rH;mbUl}8h9Rxh6Ihz-r45W;|7>=s88QUV#h*lvz)903Q)AxaES zPyc&uOX$e@HbLa=G79C&f`UM*->eq2|%i{Wt=dA0JPgmAF2A!|w)Z_68qk7DTakiwt z$g+oxD%!`CVBPp~t(m$RdrRrcCZCR{=WW)`tY5yl>E7wzLRviiMF;gYiZ2pzbA22K zi-~9X{Jp=}n#JD~EaO&P+20S{hh-Ve{(Ki*nN-<(MeB`<*^EZcZ$H?~Zr`4G6C=#E zs^K~pL%#08c#Uc5xuAZ%pMU6c(|P>Z%KzJ%nRkz|x?koRY-%k`TT}a*8=rfv>U*H3 zsgC$^V@+7_nXb1R(DvY5wZ5ga=NP$6Zhw6<$GYA+2YZK_AI}ABEgr8U2ZA(E&|3phY7@Z`GoGP5URV UMeEbae{^AZcm5A)(YJK?Hy~E=RR910 diff --git a/wifi/firmware/WCNSS_qcom_cfg.ini b/wifi/firmware/WCNSS_qcom_cfg.ini deleted file mode 100644 index 97b61e9..0000000 --- a/wifi/firmware/WCNSS_qcom_cfg.ini +++ /dev/null @@ -1,483 +0,0 @@ -# This file allows user to override the factory - -# defaults for the WLAN Driver - - -# Enable IMPS or not -gEnableImps=1 - -# Enable/Disable Idle Scan - -gEnableIdleScan=0 - - -# Enable/Disable vsta based on MAX Assoc limit -gEnableVSTASupport=1 - - -# Increase sleep duration (seconds) during IMPS -# 0 implies no periodic wake up from IMPS. Periodic wakeup is -# unnecessary if Idle Scan is disabled. -gImpsModSleepTime=0 - - -# Enable BMPS or not -gEnableBmps=1 - -# Enable suspend or not - -# 1: Enable standby, 2: Enable Deep sleep, 3: Enable Mcast/Bcast Filter - -gEnableSuspend=3 - -# Phy Mode (auto, b, g, n, etc) -# Valid values are 0-9, with 0 = Auto, 4 = 11n, 9 = 11ac -gDot11Mode=0 - - -# CSR Roaming Enable(1) Disable(0) - -gRoamingTime=0 - - -# Assigned MAC Addresses - This will be used until NV items are in place - -# Each byte of MAC address is represented in Hex format as XX - -Intf0MacAddress=000AF58989FF -Intf1MacAddress=000AF58989FE -Intf2MacAddress=000AF58989FD - -Intf3MacAddress=000AF58989FC - - -# UAPSD service interval for VO,VI, BE, BK traffic - -InfraUapsdVoSrvIntv=0 - -InfraUapsdViSrvIntv=0 - -InfraUapsdBeSrvIntv=0 - -InfraUapsdBkSrvIntv=0 - -# Flag to allow STA send AddTspec even when ACM is Off -gAddTSWhenACMIsOff=1 - -# Make 1x1 the default antenna configuration - -gNumRxAnt=1 - - -# Beacon filtering frequency (unit in beacon intervals) - -gNthBeaconFilter=50 - - -# Enable WAPI or not - -# WAPIIsEnabled=0 - - -# Flags to filter Mcast abd Bcast RX packets. - -# Value 0: No filtering, 1: Filter all Multicast. - -# 2: Filter all Broadcast. 3: Filter all Mcast abd Bcast - -McastBcastFilter=3 - - -#Flag to enable HostARPOffload feature or not - -hostArpOffload=1 - - -#Flag to enable HostNSOffload feature or not - -hostNSOffload=0 - -#SoftAP Related Parameters - -# AP MAc addr - -gAPMacAddr=000AF589dcab - - -# 802.11n Protection flag - -gEnableApProt=1 - - -#Enable OBSS protection - -gEnableApOBSSProt=1 - - -#Enable/Disable UAPSD for SoftAP - -gEnableApUapsd=1 - - -# Fixed Rate - -gFixedRate=0 - - -# Maximum Tx power - -# gTxPowerCap=30 - - -# Fragmentation Threshold - -# gFragmentationThreshold=2346 - - -# RTS threshold - -RTSThreshold=2347 - - -# Intra-BSS forward - -gDisableIntraBssFwd=0 - - -# WMM Enable/Disable - -WmmIsEnabled=0 - - -# 802.11d support - -g11dSupportEnabled=1 - -# 802.11h support - -g11hSupportEnabled=1 - -# ESE Support and fast transition -EseEnabled=0 -ImplicitQosIsEnabled=0 -gNeighborScanTimerPeriod=200 - -gNeighborLookupThreshold=76 -gNeighborReassocThreshold=81 - -gNeighborScanChannelMinTime=20 -gNeighborScanChannelMaxTime=30 -gMaxNeighborReqTries=3 - -# Legacy (non-ESE, non-802.11r) Fast Roaming Support -# To enable, set FastRoamEnabled=1 -# To disable, set FastRoamEnabled=0 -FastRoamEnabled=1 - -#Check if the AP to which we are roaming is better than current AP in terms of RSSI. -#Checking is disabled if set to Zero.Otherwise it will use this value as to how better -#the RSSI of the new/roamable AP should be for roaming -RoamRssiDiff=3 - -# If the RSSI of any available candidate is better than currently associated -# AP by at least gImmediateRoamRssiDiff, then being to roam immediately (without -# registering for reassoc threshold). -# NOTE: Value of 0 means that we would register for reassoc threshold. -gImmediateRoamRssiDiff=10 - -# To enable, set gRoamIntraBand=1 (Roaming within band) -# To disable, set gRoamIntraBand=0 (Roaming across band) - -gRoamIntraBand=0 - -#SAP Country code - -# Default Country Code is 2 bytes, 3rd byte is optional indoor or out door. - -# Example - -# US Indoor, USI - -# Korea Outdoor, KRO - -# Japan without optional byte, JP - -# France without optional byte, FR - -#gAPCntryCode=USI - - -#Short Guard Interval Enable/disable - -gShortGI20Mhz=1 - -gShortGI40Mhz=1 - - -#Auto Shutdown Value in seconds. A value of 0 means Auto shutoff is disabled - -gAPAutoShutOff=0 - - -# SAP auto channel selection configuration - -# 0 = disable auto channel selection - -# 1 = enable auto channel selection, channel provided by supplicant will be ignored - -gApAutoChannelSelection=1 - - -# Listen Energy Detect Mode Configuration - -# Valid values 0-128 - -# 128 means disable Energy Detect feature - -# 0-9 are threshold code and 7 is recommended value from system if feature is to be enabled. - -# 10-128 are reserved. - -# The EDET threshold mapping is as follows in 3dB step: - -# 0 = -60 dBm - -# 1 = -63 dBm - -# 2 = -66 dBm - -# ... - -# 7 = -81 dBm - -# 8 = -84 dBm - -# 9 = -87 dBm - -# Note: Any of these settings are valid. Setting 0 would yield the highest power saving (in a noisy environment) at the cost of more range. The range impact is approximately #calculated as: - -# - -# Range Loss (dB) = EDET threshold level (dBm) + 97 dBm. - -# - -gEnablePhyAgcListenMode=128 - - -#Preferred channel to start BT AMP AP mode (0 means, any channel) - -BtAmpPreferredChannel=0 - - -#Preferred band (both or 2.4 only or 5 only) - -BandCapability=0 - - -#Beacon Early Termination (1 = enable the BET feature, 0 = disable) - -enableBeaconEarlyTermination=0 - -beaconEarlyTerminationWakeInterval=3 - - -#Bluetooth Alternate Mac Phy (1 = enable the BT AMP feature, 0 = disable) - -gEnableBtAmp=0 - - -#SOFTAP Channel Range selection - -gAPChannelSelectStartChannel=1 - -gAPChannelSelectEndChannel=11 - - -#SOFTAP Channel Range selection Operating band - -# 0:2.4GHZ 1: LOW-5GHZ 2:MID-5GHZ 3:HIGH-5GHZ 4: 4.9HZ BAND 5: 5GHZ BAND - -gAPChannelSelectOperatingBand=0 - - -#Channel Bonding -gChannelBondingMode5GHz=1 -gChannelBondingMode24GHz=1 - -#Enable Keep alive with non-zero period value - -#gStaKeepAlivePeriod = 30 - -#Say gGoKeepAlivePeriod(5 seconds) and gGoLinkMonitorPeriod(10 seconds). -#For every 10 seconds DUT send Qos Null frame(i.e., Keep Alive frame if link is idle for last 10 seconds.) -#For both active and power save clients. - -#Power save clients: DUT set TIM bit from 10th second onwards and till client honors TIM bit. -#If doesn't honor for 5 seconds then DUT remove client. - -#Active clients: DUT send Qos Null frame for 10th seconds onwards if it is not success still we try on -#11th second if not tries on 12th and so on till 15th second. Hence before disconnection DUT will send 5 NULL frames. -#Hence in any case DUT will detect client got removed in (10+5) seconds. i.e., (gGoKeepAlivePeriod + gGoLinkMonitorPeriod).. - -#gGoLinkMonitorPeriod/ gApLinkMonitorPeriod is period where link is idle and it is period -#where we send NULL frame. - -#gApLinkMonitorPeriod = 10 - -#gGoLinkMonitorPeriod = 10 - -#gGoKeepAlivePeriod/gApKeepAlivePeriod is time to spend to check whether frame are succeed to send or not. -#Hence total effective detection time is gGoLinkMonitorPeriod+ gGoKeepAlivePeriod/gApLinkMonitorPeriod+ gApKeepAlivePeriod. - - -gGoKeepAlivePeriod=30 - -gApKeepAlivePeriod=10 - - -#If set will start with active scan after driver load, otherwise will start with - -#passive scan to find out the domain - -gEnableBypass11d=1 - - -#If set to 0, will not scan DFS channels - -gEnableDFSChnlScan=1 - - -gVhtChannelWidth=2 -gEnableLogp=1 - - -# Enable Automatic Tx Power control - -gEnableAutomaticTxPowerControl=0 - -# 0 for OLPC 1 for CLPC and SCPC -gEnableCloseLoop=1 - -#Data Inactivity Timeout when in powersave (in ms) -gDataInactivityTimeout=200 - -# VHT Tx/Rx MCS values -# Valid values are 0,1,2. If commented out, the default value is 0. -# 0=MCS0-7, 1=MCS0-8, 2=MCS0-9 -gVhtRxMCS=2 -gVhtTxMCS=2 - -# Enable CRDA regulatory support by settings default country code -#gCrdaDefaultCountryCode=TW - -# Scan Timing Parameters -# gPassiveMaxChannelTime=110 -# gPassiveMinChannelTime=60 -# gActiveMaxChannelTime=40 -# gActiveMinChannelTime=20 - -#If set to 0, MCC is not allowed. -gEnableMCCMode=1 - -# 1=enable STBC; 0=disable STBC -gEnableRXSTBC=1 - -# Enable Active mode offload -gEnableActiveModeOffload=1 - -#Enable Scan Results Aging based on timer -#Timer value is in seconds -#If Set to 0 it will not enable the feature -gScanAgingTime=0 - -#Enable Power saving mechanism Based on Android Framework -#If set to 0 Driver internally control the Power saving mechanism -#If set to 1 Android Framwrok control the Power saving mechanism -isAndroidPsEn=0 - -#disable LDPC in STA mode if the AP is TXBF capable -gDisableLDPCWithTxbfAP=1 - -#Enable thermal mitigation -gThermalMitigationEnable=1 - -gEnableFastRoamInConcurrency=1 - -#List of Country codes for which 11ac needs to be disabled -#Each country code must be delimited by comma(,) -gListOfNon11acCountryCode=RU,UA,ZA - -#Maxium Channel time in msec -gMaxMediumTime = 5480 - -# 802.11K support -gRrmEnable=1 -gRrmOperChanMax=8 -gRrmNonOperChanMax=8 -gRrmRandIntvl=100 - -#Scan offload -gEnableDirectedScanOffload=0 - -#FlexConnect Power Factor -#Default is set to 0 (disable) -gFlexConnectPowerFactor=0 - -#SAP/P2P-GO mode traffic monitor -gEnableTrafficMonitor=1 -gTrafficIdleTimeout=3000 - -#Disable/Enable Strict FCC Regulatory -# 0 to disable, 1 to enable -gEnableStrictRegulatoryForFCC=1 - -#Enable/Disable Modulated DTIM feature -gEnableModulatedDTIM=3 - -#max LI value for modulated DTIM -gMaxLIModulatedDTIM=3 - -#Enable/Disable Link Layer Statistics Feature -gEnableLLStats=1 - -#Enable/Disable EXTScan Feature -gEnableEXTScan=1 - -#Enable/Disable TDLS Feature -gEnableTDLSSupport=1 - -#Enable/Disable TDLS Implicit Trigger -gEnableTDLSImplicitTrigger=0 - -#Enable/Disable TDLS Buffer Sta -gEnableTDLSBufferSta=1 - -#Enable/Disable RTS-CTS for HT,VHT -#Bit mask value to enable RTS/CTS for different modes -#For 2.4 GHz, HT20 - 0x0001 i.e 1, for 2.4 GHz, HT40 - 0x0002 i.e 2 -#For 2.4 GHz, VHT20 - 0x0004 i.e 4, for 2.4 GHz, VHT40 - 0x0008 i.e 8 -#For 5 GHz, HT20 - 0x0100 i.e 256, for 5 GHz, HT40 - 0x0200 i.e 512 -#For 5 GHz, VHT20 - 0x0400 i.e 1024, for 5 GHz, VHT40 - 0x0800 i.e 2048 -#For 5 GHz, VHT80 - 0x1000 i.e 4096 -#Can be enabled for multiple modes -#For enabling in both HT20 and HT40 of 2.4 GHz - 0x0003 i.e 3 -#Default is set to 0 (disable) -gEnableRtsCtsHtVht=0 - -#Enable delACK -gEnableDelAck=1 - -#Compute interval for delack -gTcpDelAckComputeInterval=2000 - -#Delack set higher limit -gTcpDelAckThresholdHigh=17000 - -#Delack set lower limit -gTcpDelAckThresholdLow=12000 - -END - -# Note: Configuration parser would not read anything past the END marker - diff --git a/wifi/fstman.ini b/wifi/fstman.ini deleted file mode 100644 index e11b81d..0000000 --- a/wifi/fstman.ini +++ /dev/null @@ -1,24 +0,0 @@ -[fst_manager] -ctrl_iface=/data/misc/wifi/hostapd/global -groups=bond0 - -[bond0] -interfaces=wlan0,wlan1 -mux_type=bonding -mux_ifname=bond0 -mux_managed=1 -mac_address_by=wlan0 -rate_upgrade_master=wlan0 -txqueuelen=100 -rate_upgrade_acl_file=/data/misc/wifi/fst_rate_upgrade.accept - -[wlan0] -priority=100 -default_llt=3600 - -[wlan1] -priority=110 -wpa_group=GCMP -wpa_pairwise=GCMP -hw_mode=ad -channel=2 diff --git a/wifi/hostapd.accept b/wifi/hostapd.accept deleted file mode 100644 index 923eab6..0000000 --- a/wifi/hostapd.accept +++ /dev/null @@ -1,3 +0,0 @@ -# List of MAC addresses that are allowed to authenticate (IEEE 802.11) -# with the AP. Optional VLAN ID can be assigned for clients based on the -# MAC address if dynamic VLANs (hostapd.conf dynamic_vlan option) are used. diff --git a/wifi/hostapd.deny b/wifi/hostapd.deny deleted file mode 100644 index e4b6c09..0000000 --- a/wifi/hostapd.deny +++ /dev/null @@ -1,2 +0,0 @@ -# List of MAC addresses that are not allowed to authenticate (IEEE 802.11) -# with the AP. diff --git a/wifi/hostapd_default.conf b/wifi/hostapd_default.conf deleted file mode 100644 index 915ceff..0000000 --- a/wifi/hostapd_default.conf +++ /dev/null @@ -1,1043 +0,0 @@ -##### hostapd configuration file ############################################## -# Empty lines and lines starting with # are ignored - -# AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for -# management frames); ath0 for madwifi -interface=wlan0 - -# In case of madwifi and nl80211 driver interfaces, an additional configuration -# parameter, bridge, must be used to notify hostapd if the interface is -# included in a bridge. This parameter is not used with Host AP driver. -#bridge=br0 - -# Driver interface type (hostap/wired/madwifi/prism54/test/none/nl80211/bsd); -# default: hostap). nl80211 is used with all Linux mac80211 drivers. -# Use driver=none if building hostapd as a standalone RADIUS server that does -# not control any wireless/wired driver. -driver=nl80211 - -# hostapd event logger configuration -# -# Two output method: syslog and stdout (only usable if not forking to -# background). -# -# Module bitfield (ORed bitfield of modules that will be logged; -1 = all -# modules): -# bit 0 (1) = IEEE 802.11 -# bit 1 (2) = IEEE 802.1X -# bit 2 (4) = RADIUS -# bit 3 (8) = WPA -# bit 4 (16) = driver interface -# bit 5 (32) = IAPP -# bit 6 (64) = MLME -# -# Levels (minimum value for logged events): -# 0 = verbose debugging -# 1 = debugging -# 2 = informational messages -# 3 = notification -# 4 = warning -# -logger_syslog=-1 -logger_syslog_level=2 -logger_stdout=-1 -logger_stdout_level=2 - -# Dump file for state information (on SIGUSR1) -dump_file=/tmp/hostapd.dump - -# Interface for separate control program. If this is specified, hostapd -# will create this directory and a UNIX domain socket for listening to requests -# from external programs (CLI/GUI, etc.) for status information and -# configuration. The socket file will be named based on the interface name, so -# multiple hostapd processes/interfaces can be run at the same time if more -# than one interface is used. -# /var/run/hostapd is the recommended directory for sockets and by default, -# hostapd_cli will use it when trying to connect with hostapd. -ctrl_interface=/data/misc/wifi/hostapd - - -# Access control for the control interface can be configured by setting the -# directory to allow only members of a group to use sockets. This way, it is -# possible to run hostapd as root (since it needs to change network -# configuration and open raw sockets) and still allow GUI/CLI components to be -# run as non-root users. However, since the control interface can be used to -# change the network configuration, this access needs to be protected in many -# cases. By default, hostapd is configured to use gid 0 (root). If you -# want to allow non-root users to use the contron interface, add a new group -# and change this value to match with that group. Add users that should have -# control interface access to this group. -# -# This variable can be a group name or gid. -#ctrl_interface_group=wheel -#ctrl_interface_group=0 - - -##### IEEE 802.11 related configuration ####################################### - -# SSID to be used in IEEE 802.11 management frames -ssid=QualcommSoftAP - -# Country code (ISO/IEC 3166-1). Used to set regulatory domain. -# Set as needed to indicate country in which device is operating. -# This can limit available channels and transmit power. -#country_code=US - -# Enable IEEE 802.11d. This advertises the country_code and the set of allowed -# channels and transmit power levels based on the regulatory limits. The -# country_code setting must be configured with the correct country for -# IEEE 802.11d functions. -# (default: 0 = disabled) -#ieee80211d=1 - -# Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g, -# n = IEEE 802.11n, g_only = IEEE 802.11g_only, n_only = IEEE 802.11n_only, -# Default: IEEE 802.11n -hw_mode=g - -# Channel number (IEEE 802.11) -# (default: 0, i.e., not set) -# Please note that some drivers (e.g., madwifi) do not use this value from -# hostapd and the channel will need to be configuration separately with -# iwconfig. -channel=6 - -# Beacon interval in kus (1.024 ms) (default: 100; range 15..65535) -beacon_int=100 - -# DTIM (delivery trafic information message) period (range 1..255): -# number of beacons between DTIMs (1 = every beacon includes DTIM element) -# (default: 2) -dtim_period=2 - -# Maximum number of stations allowed in station table. New stations will be -# rejected after the station table is full. IEEE 802.11 has a limit of 2007 -# different association IDs, so this number should not be larger than that. -# (default: 2007) -max_num_sta=255 - -# RTS/CTS threshold; 2347 = disabled (default); range 0..2347 -# If this field is not included in hostapd.conf, hostapd will not control -# RTS threshold and 'iwconfig wlan# rts ' can be used to set it. -#rts_threshold=2347 - -# Fragmentation threshold; 2346 = disabled (default); range 256..2346 -# If this field is not included in hostapd.conf, hostapd will not control -# fragmentation threshold and 'iwconfig wlan# frag ' can be used to set -# it. -#fragm_threshold=2346 - -# Rate configuration -# Default is to enable all rates supported by the hardware. This configuration -# item allows this list be filtered so that only the listed rates will be left -# in the list. If the list is empty, all rates are used. This list can have -# entries that are not in the list of rates the hardware supports (such entries -# are ignored). The entries in this list are in 100 kbps, i.e., 11 Mbps = 110. -# If this item is present, at least one rate have to be matching with the rates -# hardware supports. -# default: use the most common supported rate setting for the selected -# hw_mode (i.e., this line can be removed from configuration file in most -# cases) -#supported_rates=10 20 55 110 60 90 120 180 240 360 480 540 - -# Basic rate set configuration -# List of rates (in 100 kbps) that are included in the basic rate set. -# If this item is not included, usually reasonable default set is used. -# This basic rates set is currently used for g-only profile -#basic_rates=60 - -# Short Preamble -# This parameter can be used to enable optional use of short preamble for -# frames sent at 2 Mbps, 5.5 Mbps, and 11 Mbps to improve network performance. -# This applies only to IEEE 802.11b-compatible networks and this should only be -# enabled if the local hardware supports use of short preamble. If any of the -# associated STAs do not support short preamble, use of short preamble will be -# disabled (and enabled when such STAs disassociate) dynamically. -# 0 = do not allow use of short preamble (default) -# 1 = allow use of short preamble -#preamble=1 - -# Station MAC address -based authentication -# Please note that this kind of access control requires a driver that uses -# hostapd to take care of management frame processing and as such, this can be -# used with driver=hostap or driver=nl80211, but not with driver=madwifi. -# 0 = accept unless in deny list -# 1 = deny unless in accept list -# 2 = use external RADIUS server (accept/deny lists are searched first) -macaddr_acl=0 - -# Accept/deny lists are read from separate files (containing list of -# MAC addresses, one per line). Use absolute path name to make sure that the -# files can be read on SIGHUP configuration reloads. -accept_mac_file=/data/misc/wifi/hostapd.accept -deny_mac_file=/data/misc/wifi/hostapd.deny - -# IEEE 802.11 specifies two authentication algorithms. hostapd can be -# configured to allow both of these or only one. Open system authentication -# should be used with IEEE 802.1X. -# Bit fields of allowed authentication algorithms: -# bit 0 = Open System Authentication -# bit 1 = Shared Key Authentication (requires WEP) -auth_algs=3 - -# Send empty SSID in beacons and ignore probe request frames that do not -# specify full SSID, i.e., require stations to know SSID. -# default: disabled (0) -# 1 = send empty (length=0) SSID in beacon and ignore probe request for -# broadcast SSID -# 2 = clear SSID (ASCII 0), but keep the original length (this may be required -# with some clients that do not support empty SSID) and ignore probe -# requests for broadcast SSID -ignore_broadcast_ssid=0 - -# TX queue parameters (EDCF / bursting) -# default for all these fields: not set, use hardware defaults -# tx_queue__ -# queues: data0, data1, data2, data3, after_beacon, beacon -# (data0 is the highest priority queue) -# parameters: -# aifs: AIFS (default 2) -# cwmin: cwMin (1, 3, 7, 15, 31, 63, 127, 255, 511, 1023) -# cwmax: cwMax (1, 3, 7, 15, 31, 63, 127, 255, 511, 1023); cwMax >= cwMin -# burst: maximum length (in milliseconds with precision of up to 0.1 ms) for -# bursting -# -# Default WMM parameters (IEEE 802.11 draft; 11-03-0504-03-000e): -# These parameters are used by the access point when transmitting frames -# to the clients. -# -# Low priority / AC_BK = background -#tx_queue_data3_aifs=7 -#tx_queue_data3_cwmin=15 -#tx_queue_data3_cwmax=1023 -#tx_queue_data3_burst=0 -# Note: for IEEE 802.11b mode: cWmin=31 cWmax=1023 burst=0 -# -# Normal priority / AC_BE = best effort -#tx_queue_data2_aifs=3 -#tx_queue_data2_cwmin=15 -#tx_queue_data2_cwmax=63 -#tx_queue_data2_burst=0 -# Note: for IEEE 802.11b mode: cWmin=31 cWmax=127 burst=0 -# -# High priority / AC_VI = video -#tx_queue_data1_aifs=1 -#tx_queue_data1_cwmin=7 -#tx_queue_data1_cwmax=15 -#tx_queue_data1_burst=3.0 -# Note: for IEEE 802.11b mode: cWmin=15 cWmax=31 burst=6.0 -# -# Highest priority / AC_VO = voice -#tx_queue_data0_aifs=1 -#tx_queue_data0_cwmin=3 -#tx_queue_data0_cwmax=7 -#tx_queue_data0_burst=1.5 -# Note: for IEEE 802.11b mode: cWmin=7 cWmax=15 burst=3.3 -# -# Special queues; normally not user configurable -# -#tx_queue_after_beacon_aifs=2 -#tx_queue_after_beacon_cwmin=15 -#tx_queue_after_beacon_cwmax=1023 -#tx_queue_after_beacon_burst=0 -# -#tx_queue_beacon_aifs=2 -#tx_queue_beacon_cwmin=3 -#tx_queue_beacon_cwmax=7 -#tx_queue_beacon_burst=1.5 - -# 802.1D Tag (= UP) to AC mappings -# WMM specifies following mapping of data frames to different ACs. This mapping -# can be configured using Linux QoS/tc and sch_pktpri.o module. -# 802.1D Tag 802.1D Designation Access Category WMM Designation -# 1 BK AC_BK Background -# 2 - AC_BK Background -# 0 BE AC_BE Best Effort -# 3 EE AC_BE Best Effort -# 4 CL AC_VI Video -# 5 VI AC_VI Video -# 6 VO AC_VO Voice -# 7 NC AC_VO Voice -# Data frames with no priority information: AC_BE -# Management frames: AC_VO -# PS-Poll frames: AC_BE - -# Default WMM parameters (IEEE 802.11 draft; 11-03-0504-03-000e): -# for 802.11a or 802.11g networks -# These parameters are sent to WMM clients when they associate. -# The parameters will be used by WMM clients for frames transmitted to the -# access point. -# -# note - txop_limit is in units of 32microseconds -# note - acm is admission control mandatory flag. 0 = admission control not -# required, 1 = mandatory -# note - here cwMin and cmMax are in exponent form. the actual cw value used -# will be (2^n)-1 where n is the value given here -# -wmm_enabled=1 -# -# Low priority / AC_BK = background -wmm_ac_bk_cwmin=4 -wmm_ac_bk_cwmax=10 -wmm_ac_bk_aifs=7 -wmm_ac_bk_txop_limit=0 -wmm_ac_bk_acm=0 -# Note: for IEEE 802.11b mode: cWmin=5 cWmax=10 -# -# Normal priority / AC_BE = best effort -wmm_ac_be_aifs=3 -wmm_ac_be_cwmin=4 -wmm_ac_be_cwmax=10 -wmm_ac_be_txop_limit=0 -wmm_ac_be_acm=0 -# Note: for IEEE 802.11b mode: cWmin=5 cWmax=7 -# -# High priority / AC_VI = video -wmm_ac_vi_aifs=2 -wmm_ac_vi_cwmin=3 -wmm_ac_vi_cwmax=4 -wmm_ac_vi_txop_limit=94 -wmm_ac_vi_acm=0 -# Note: for IEEE 802.11b mode: cWmin=4 cWmax=5 txop_limit=188 -# -# Highest priority / AC_VO = voice -wmm_ac_vo_aifs=2 -wmm_ac_vo_cwmin=2 -wmm_ac_vo_cwmax=3 -wmm_ac_vo_txop_limit=47 -wmm_ac_vo_acm=0 -# Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102 - -# Static WEP key configuration -# -# The key number to use when transmitting. -# It must be between 0 and 3, and the corresponding key must be set. -# default: not set -#wep_default_key=0 -# The WEP keys to use. -# A key may be a quoted string or unquoted hexadecimal digits. -# The key length should be 5, 13, or 16 characters, or 10, 26, or 32 -# digits, depending on whether 40-bit (64-bit), 104-bit (128-bit), or -# 128-bit (152-bit) WEP is used. -# Only the default key must be supplied; the others are optional. -# default: not set -#wep_key0=1234567890 -#wep_key1=1234567890 -#wep_key2=1234567890 -#wep_key3=1234567890 - -# Station inactivity limit -# -# If a station does not send anything in ap_max_inactivity seconds, an -# empty data frame is sent to it in order to verify whether it is -# still in range. If this frame is not ACKed, the station will be -# disassociated and then deauthenticated. This feature is used to -# clear station table of old entries when the STAs move out of the -# range. -# -# The station can associate again with the AP if it is still in range; -# this inactivity poll is just used as a nicer way of verifying -# inactivity; i.e., client will not report broken connection because -# disassociation frame is not sent immediately without first polling -# the STA with a data frame. -# default: 300 (i.e., 5 minutes) -#ap_max_inactivity=300 - -# Enable/disable internal bridge for packets between associated stations. -# -# When IEEE 802.11 is used in managed mode, packets are usually send through -# the AP even if they are from a wireless station to another wireless station. -# This functionality requires that the AP has a bridge functionality that sends -# frames back to the same interface if their destination is another associated -# station. In addition, broadcast/multicast frames from wireless stations will -# be sent both to the host system net stack (e.g., to eventually wired network) -# and back to the wireless interface. -# -# The internal bridge is implemented within the wireless kernel module and it -# bypasses kernel filtering (netfilter/iptables/ebtables). If direct -# communication between the stations needs to be prevented, the internal -# bridge can be disabled by setting bridge_packets=0. -# -# Note: If this variable is not included in hostapd.conf, hostapd does not -# change the configuration and iwpriv can be used to set the value with -# 'iwpriv wlan# param 10 0' command. If the variable is in hostapd.conf, -# hostapd will override possible iwpriv configuration whenever configuration -# file is reloaded. -# -# default: do not control from hostapd (80211.o defaults to 1=enabled) -#bridge_packets=1 - -# Maximum allowed Listen Interval (how many Beacon periods STAs are allowed to -# remain asleep). Default: 65535 (no limit apart from field size) -#max_listen_interval=100 - -# Client isolation can be used to prevent low-level bridging of frames between -# associated stations in the BSS. By default, this bridging is allowed. -#ap_isolate=1 - -##### IEEE 802.11n related configuration ###################################### - -# ieee80211n: Whether IEEE 802.11n (HT) is enabled -# 0 = disabled (default) -# 1 = enabled -# Note: You will also need to enable WMM for full HT functionality. -ieee80211n=1 - -#require_ht=1 - -# ht_capab: HT capabilities (list of flags) -# LDPC coding capability: [LDPC] = supported -# Supported channel width set: [HT40-] = both 20 MHz and 40 MHz with secondary -# channel below the primary channel; [HT40+] = both 20 MHz and 40 MHz -# with secondary channel below the primary channel -# (20 MHz only if neither is set) -# Note: There are limits on which channels can be used with HT40- and -# HT40+. Following table shows the channels that may be available for -# HT40- and HT40+ use per IEEE 802.11n Annex J: -# freq HT40- HT40+ -# 2.4 GHz 5-13 1-7 (1-9 in Europe/Japan) -# 5 GHz 40,48,56,64 36,44,52,60 -# (depending on the location, not all of these channels may be available -# for use) -# Spatial Multiplexing (SM) Power Save: [SMPS-STATIC] or [SMPS-DYNAMIC] -# (SMPS disabled if neither is set) -# HT-greenfield: [GF] (disabled if not set) -# Short GI for 20 MHz: [SHORT-GI-20] (disabled if not set) -# Short GI for 40 MHz: [SHORT-GI-40] (disabled if not set) -# Tx STBC: [TX-STBC] (disabled if not set) -# Rx STBC: [RX-STBC1] (one spatial stream), [RX-STBC12] (one or two spatial -# streams), or [RX-STBC123] (one, two, or three spatial streams); Rx STBC -# disabled if none of these set -# HT-delayed Block Ack: [DELAYED-BA] (disabled if not set) -# Maximum A-MSDU length: [MAX-AMSDU-7935] for 7935 octets (3839 octets if not -# set) -# DSSS/CCK Mode in 40 MHz: [DSSS_CCK-40] = allowed (not allowed if not set) -# PSMP support: [PSMP] (disabled if not set) -# L-SIG TXOP protection support: [LSIG-TXOP-PROT] (disabled if not set) -# QcHostapd: -# LOWER byte for associated stations -# UPPER byte for overlapping stations -# each byte will have the following info -# bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 -# OBSS RIFS LSIG_TXOP NON_GF HT20 FROM_11G FROM_11B FROM_11A -# bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 -# OBSS RIFS LSIG_TXOP NON_GF HT_20 FROM_11G FROM_11B FROM_11A -#ht_capab=[HT40-] [SHORT-GI-20] [SHORT-GI-40] -ht_capab=[SHORT-GI-20] [GF] [DSSS_CCK-40] [LSIG-TXOP-PROT] -#ht_capab=[LDPC] [HT40-] [HT40+] [SMPS-STATIC] [SMPS-DYNAMIC] [GF] [SHORT-GI-20] [SHORT-GI-40] [TX-STBC] [RX-STBC1] [RX-STBC12] [RX-STBC123] [DELAYED-BA] [MAX-AMSDU-7935] [DSSS_CCK-40] [PSMP] [LSIG-TXOP-PROT] - -##### IEEE 802.1X-2004 related configuration ################################## - -# Require IEEE 802.1X authorization -#ieee8021x=1 - -# IEEE 802.1X/EAPOL version -# hostapd is implemented based on IEEE Std 802.1X-2004 which defines EAPOL -# version 2. However, there are many client implementations that do not handle -# the new version number correctly (they seem to drop the frames completely). -# In order to make hostapd interoperate with these clients, the version number -# can be set to the older version (1) with this configuration value. -#eapol_version=2 - -# Optional displayable message sent with EAP Request-Identity. The first \0 -# in this string will be converted to ASCII-0 (nul). This can be used to -# separate network info (comma separated list of attribute=value pairs); see, -# e.g., RFC 4284. -#eap_message=hello -#eap_message=hello\0networkid=netw,nasid=foo,portid=0,NAIRealms=example.com - -# WEP rekeying (disabled if key lengths are not set or are set to 0) -# Key lengths for default/broadcast and individual/unicast keys: -# 5 = 40-bit WEP (also known as 64-bit WEP with 40 secret bits) -# 13 = 104-bit WEP (also known as 128-bit WEP with 104 secret bits) -#wep_key_len_broadcast=5 -#wep_key_len_unicast=5 -# Rekeying period in seconds. 0 = do not rekey (i.e., set keys only once) -#wep_rekey_period=300 - -# EAPOL-Key index workaround (set bit7) for WinXP Supplicant (needed only if -# only broadcast keys are used) -eapol_key_index_workaround=0 - -# EAP reauthentication period in seconds (default: 3600 seconds; 0 = disable -# reauthentication). -#eap_reauth_period=3600 - -# Use PAE group address (01:80:c2:00:00:03) instead of individual target -# address when sending EAPOL frames with driver=wired. This is the most common -# mechanism used in wired authentication, but it also requires that the port -# is only used by one station. -#use_pae_group_addr=1 - -##### Integrated EAP server ################################################### - -# Optionally, hostapd can be configured to use an integrated EAP server -# to process EAP authentication locally without need for an external RADIUS -# server. This functionality can be used both as a local authentication server -# for IEEE 802.1X/EAPOL and as a RADIUS server for other devices. - -# Use integrated EAP server instead of external RADIUS authentication -# server. This is also needed if hostapd is configured to act as a RADIUS -# authentication server. -eap_server=1 - -# Path for EAP server user database -#eap_user_file=/etc/hostapd.eap_user - -# CA certificate (PEM or DER file) for EAP-TLS/PEAP/TTLS -#ca_cert=/etc/hostapd.ca.pem - -# Server certificate (PEM or DER file) for EAP-TLS/PEAP/TTLS -#server_cert=/etc/hostapd.server.pem - -# Private key matching with the server certificate for EAP-TLS/PEAP/TTLS -# This may point to the same file as server_cert if both certificate and key -# are included in a single file. PKCS#12 (PFX) file (.p12/.pfx) can also be -# used by commenting out server_cert and specifying the PFX file as the -# private_key. -#private_key=/etc/hostapd.server.prv - -# Passphrase for private key -#private_key_passwd=secret passphrase - -# Enable CRL verification. -# Note: hostapd does not yet support CRL downloading based on CDP. Thus, a -# valid CRL signed by the CA is required to be included in the ca_cert file. -# This can be done by using PEM format for CA certificate and CRL and -# concatenating these into one file. Whenever CRL changes, hostapd needs to be -# restarted to take the new CRL into use. -# 0 = do not verify CRLs (default) -# 1 = check the CRL of the user certificate -# 2 = check all CRLs in the certificate path -#check_crl=1 - -# dh_file: File path to DH/DSA parameters file (in PEM format) -# This is an optional configuration file for setting parameters for an -# ephemeral DH key exchange. In most cases, the default RSA authentication does -# not use this configuration. However, it is possible setup RSA to use -# ephemeral DH key exchange. In addition, ciphers with DSA keys always use -# ephemeral DH keys. This can be used to achieve forward secrecy. If the file -# is in DSA parameters format, it will be automatically converted into DH -# params. This parameter is required if anonymous EAP-FAST is used. -# You can generate DH parameters file with OpenSSL, e.g., -# "openssl dhparam -out /etc/hostapd.dh.pem 1024" -#dh_file=/etc/hostapd.dh.pem - -# Configuration data for EAP-SIM database/authentication gateway interface. -# This is a text string in implementation specific format. The example -# implementation in eap_sim_db.c uses this as the UNIX domain socket name for -# the HLR/AuC gateway (e.g., hlr_auc_gw). In this case, the path uses "unix:" -# prefix. -#eap_sim_db=unix:/tmp/hlr_auc_gw.sock - -# Encryption key for EAP-FAST PAC-Opaque values. This key must be a secret, -# random value. It is configured as a 16-octet value in hex format. It can be -# generated, e.g., with the following command: -# od -tx1 -v -N16 /dev/random | colrm 1 8 | tr -d ' ' -#pac_opaque_encr_key=000102030405060708090a0b0c0d0e0f - -# EAP-FAST authority identity (A-ID) -# A-ID indicates the identity of the authority that issues PACs. The A-ID -# should be unique across all issuing servers. In theory, this is a variable -# length field, but due to some existing implementations required A-ID to be -# 16 octets in length, it is strongly recommended to use that length for the -# field to provided interoperability with deployed peer implementation. This -# field is configured in hex format. -#eap_fast_a_id=101112131415161718191a1b1c1d1e1f - -# EAP-FAST authority identifier information (A-ID-Info) -# This is a user-friendly name for the A-ID. For example, the enterprise name -# and server name in a human-readable format. This field is encoded as UTF-8. -#eap_fast_a_id_info=test server - -# Enable/disable different EAP-FAST provisioning modes: -#0 = provisioning disabled -#1 = only anonymous provisioning allowed -#2 = only authenticated provisioning allowed -#3 = both provisioning modes allowed (default) -#eap_fast_prov=3 - -# EAP-FAST PAC-Key lifetime in seconds (hard limit) -#pac_key_lifetime=604800 - -# EAP-FAST PAC-Key refresh time in seconds (soft limit on remaining hard -# limit). The server will generate a new PAC-Key when this number of seconds -# (or fewer) of the lifetime remains. -#pac_key_refresh_time=86400 - -# EAP-SIM and EAP-AKA protected success/failure indication using AT_RESULT_IND -# (default: 0 = disabled). -#eap_sim_aka_result_ind=1 - -# Trusted Network Connect (TNC) -# If enabled, TNC validation will be required before the peer is allowed to -# connect. Note: This is only used with EAP-TTLS and EAP-FAST. If any other -# EAP method is enabled, the peer will be allowed to connect without TNC. -#tnc=1 - - -##### IEEE 802.11f - Inter-Access Point Protocol (IAPP) ####################### - -# Interface to be used for IAPP broadcast packets -#iapp_interface=eth0 - - -##### RADIUS client configuration ############################################# -# for IEEE 802.1X with external Authentication Server, IEEE 802.11 -# authentication with external ACL for MAC addresses, and accounting - -# The own IP address of the access point (used as NAS-IP-Address) -own_ip_addr=127.0.0.1 - -# Optional NAS-Identifier string for RADIUS messages. When used, this should be -# a unique to the NAS within the scope of the RADIUS server. For example, a -# fully qualified domain name can be used here. -# When using IEEE 802.11r, nas_identifier must be set and must be between 1 and -# 48 octets long. -#nas_identifier=ap.example.com - -# RADIUS authentication server -#auth_server_addr=127.0.0.1 -#auth_server_port=1812 -#auth_server_shared_secret=secret - -# RADIUS accounting server -#acct_server_addr=127.0.0.1 -#acct_server_port=1813 -#acct_server_shared_secret=secret - -# Secondary RADIUS servers; to be used if primary one does not reply to -# RADIUS packets. These are optional and there can be more than one secondary -# server listed. -#auth_server_addr=127.0.0.2 -#auth_server_port=1812 -#auth_server_shared_secret=secret2 -# -#acct_server_addr=127.0.0.2 -#acct_server_port=1813 -#acct_server_shared_secret=secret2 - -# Retry interval for trying to return to the primary RADIUS server (in -# seconds). RADIUS client code will automatically try to use the next server -# when the current server is not replying to requests. If this interval is set, -# primary server will be retried after configured amount of time even if the -# currently used secondary server is still working. -#radius_retry_primary_interval=600 - - -# Interim accounting update interval -# If this is set (larger than 0) and acct_server is configured, hostapd will -# send interim accounting updates every N seconds. Note: if set, this overrides -# possible Acct-Interim-Interval attribute in Access-Accept message. Thus, this -# value should not be configured in hostapd.conf, if RADIUS server is used to -# control the interim interval. -# This value should not be less 600 (10 minutes) and must not be less than -# 60 (1 minute). -#radius_acct_interim_interval=600 - -# Dynamic VLAN mode; allow RADIUS authentication server to decide which VLAN -# is used for the stations. This information is parsed from following RADIUS -# attributes based on RFC 3580 and RFC 2868: Tunnel-Type (value 13 = VLAN), -# Tunnel-Medium-Type (value 6 = IEEE 802), Tunnel-Private-Group-ID (value -# VLANID as a string). vlan_file option below must be configured if dynamic -# VLANs are used. Optionally, the local MAC ACL list (accept_mac_file) can be -# used to set static client MAC address to VLAN ID mapping. -# 0 = disabled (default) -# 1 = option; use default interface if RADIUS server does not include VLAN ID -# 2 = required; reject authentication if RADIUS server does not include VLAN ID -#dynamic_vlan=0 - -# VLAN interface list for dynamic VLAN mode is read from a separate text file. -# This list is used to map VLAN ID from the RADIUS server to a network -# interface. Each station is bound to one interface in the same way as with -# multiple BSSIDs or SSIDs. Each line in this text file is defining a new -# interface and the line must include VLAN ID and interface name separated by -# white space (space or tab). -#vlan_file=/etc/hostapd.vlan - -# Interface where 802.1q tagged packets should appear when a RADIUS server is -# used to determine which VLAN a station is on. hostapd creates a bridge for -# each VLAN. Then hostapd adds a VLAN interface (associated with the interface -# indicated by 'vlan_tagged_interface') and the appropriate wireless interface -# to the bridge. -#vlan_tagged_interface=eth0 - - -##### RADIUS authentication server configuration ############################## - -# hostapd can be used as a RADIUS authentication server for other hosts. This -# requires that the integrated EAP server is also enabled and both -# authentication services are sharing the same configuration. - -# File name of the RADIUS clients configuration for the RADIUS server. If this -# commented out, RADIUS server is disabled. -#radius_server_clients=/etc/hostapd.radius_clients - -# The UDP port number for the RADIUS authentication server -#radius_server_auth_port=1812 - -# Use IPv6 with RADIUS server (IPv4 will also be supported using IPv6 API) -#radius_server_ipv6=1 - - -##### WPA/IEEE 802.11i configuration ########################################## - -# Enable WPA. Setting this variable configures the AP to require WPA (either -# WPA-PSK or WPA-RADIUS/EAP based on other configuration). For WPA-PSK, either -# wpa_psk or wpa_passphrase must be set and wpa_key_mgmt must include WPA-PSK. -# For WPA-RADIUS/EAP, ieee8021x must be set (but without dynamic WEP keys), -# RADIUS authentication server must be configured, and WPA-EAP must be included -# in wpa_key_mgmt. -# This field is a bit field that can be used to enable WPA (IEEE 802.11i/D3.0) -# and/or WPA2 (full IEEE 802.11i/RSN): -# bit0 = WPA -# bit1 = IEEE 802.11i/RSN (WPA2) (dot11RSNAEnabled) -#wpa=1 - -# WPA pre-shared keys for WPA-PSK. This can be either entered as a 256-bit -# secret in hex format (64 hex digits), wpa_psk, or as an ASCII passphrase -# (8..63 characters) that will be converted to PSK. This conversion uses SSID -# so the PSK changes when ASCII passphrase is used and the SSID is changed. -# wpa_psk (dot11RSNAConfigPSKValue) -# wpa_passphrase (dot11RSNAConfigPSKPassPhrase) -#wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef -#wpa_passphrase=qualcomm - -# Optionally, WPA PSKs can be read from a separate text file (containing list -# of (PSK,MAC address) pairs. This allows more than one PSK to be configured. -# Use absolute path name to make sure that the files can be read on SIGHUP -# configuration reloads. -#wpa_psk_file=/etc/hostapd.wpa_psk - -# Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The -# entries are separated with a space. WPA-PSK-SHA256 and WPA-EAP-SHA256 can be -# added to enable SHA256-based stronger algorithms. -# (dot11RSNAConfigAuthenticationSuitesTable) -#wpa_key_mgmt=WPA-PSK -#wpa_key_mgmt=WPA-EAP - -# Set of accepted cipher suites (encryption algorithms) for pairwise keys -# (unicast packets). This is a space separated list of algorithms: -# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] -# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] -# Group cipher suite (encryption algorithm for broadcast and multicast frames) -# is automatically selected based on this configuration. If only CCMP is -# allowed as the pairwise cipher, group cipher will also be CCMP. Otherwise, -# TKIP will be used as the group cipher. -# (dot11RSNAConfigPairwiseCiphersTable) -# Pairwise cipher for WPA (v1) (default: TKIP) -#wpa_pairwise=TKIP CCMP -# Pairwise cipher for RSN/WPA2 (default: use wpa_pairwise value) -#rsn_pairwise=CCMP - -# Time interval for rekeying GTK (broadcast/multicast encryption keys) in -# seconds. (dot11RSNAConfigGroupRekeyTime) -wpa_group_rekey=86400 - -# Rekey GTK when any STA that possesses the current GTK is leaving the BSS. -# (dot11RSNAConfigGroupRekeyStrict) -#wpa_strict_rekey=1 - -# Time interval for rekeying GMK (master key used internally to generate GTKs -# (in seconds). -#wpa_gmk_rekey=86400 - -# Maximum lifetime for PTK in seconds. This can be used to enforce rekeying of -# PTK to mitigate some attacks against TKIP deficiencies. -#wpa_ptk_rekey=600 - -# Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up -# roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN -# authentication and key handshake before actually associating with a new AP. -# (dot11RSNAPreauthenticationEnabled) -#rsn_preauth=1 -# -# Space separated list of interfaces from which pre-authentication frames are -# accepted (e.g., 'eth0' or 'eth0 wlan0wds0'. This list should include all -# interface that are used for connections to other APs. This could include -# wired interfaces and WDS links. The normal wireless data interface towards -# associated stations (e.g., wlan0) should not be added, since -# pre-authentication is only used with APs other than the currently associated -# one. -#rsn_preauth_interfaces=eth0 - -# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e) is -# allowed. This is only used with RSN/WPA2. -# 0 = disabled (default) -# 1 = enabled -#peerkey=1 - -# ieee80211w: Whether management frame protection (MFP) is enabled -# 0 = disabled (default) -# 1 = optional -# 2 = required -#ieee80211w=0 - -# Association SA Query maximum timeout (in TU = 1.024 ms; for MFP) -# (maximum time to wait for a SA Query response) -# dot11AssociationSAQueryMaximumTimeout, 1...4294967295 -#assoc_sa_query_max_timeout=1000 - -# Association SA Query retry timeout (in TU = 1.024 ms; for MFP) -# (time between two subsequent SA Query requests) -# dot11AssociationSAQueryRetryTimeout, 1...4294967295 -#assoc_sa_query_retry_timeout=201 - - -# okc: Opportunistic Key Caching (aka Proactive Key Caching) -# Allow PMK cache to be shared opportunistically among configured interfaces -# and BSSes (i.e., all configurations within a single hostapd process). -# 0 = disabled (default) -# 1 = enabled -#okc=1 - - -##### IEEE 802.11r configuration ############################################## - -# Mobility Domain identifier (dot11FTMobilityDomainID, MDID) -# MDID is used to indicate a group of APs (within an ESS, i.e., sharing the -# same SSID) between which a STA can use Fast BSS Transition. -# 2-octet identifier as a hex string. -#mobility_domain=a1b2 - -# PMK-R0 Key Holder identifier (dot11FTR0KeyHolderID) -# 1 to 48 octet identifier. -# This is configured with nas_identifier (see RADIUS client section above). - -# Default lifetime of the PMK-RO in minutes; range 1..65535 -# (dot11FTR0KeyLifetime) -#r0_key_lifetime=10000 - -# PMK-R1 Key Holder identifier (dot11FTR1KeyHolderID) -# 6-octet identifier as a hex string. -#r1_key_holder=000102030405 - -# Reassociation deadline in time units (TUs / 1.024 ms; range 1000..65535) -# (dot11FTReassociationDeadline) -#reassociation_deadline=1000 - -# List of R0KHs in the same Mobility Domain -# format: <128-bit key as hex string> -# This list is used to map R0KH-ID (NAS Identifier) to a destination MAC -# address when requesting PMK-R1 key from the R0KH that the STA used during the -# Initial Mobility Domain Association. -#r0kh=02:01:02:03:04:05 r0kh-1.example.com 000102030405060708090a0b0c0d0e0f -#r0kh=02:01:02:03:04:06 r0kh-2.example.com 00112233445566778899aabbccddeeff -# And so on.. One line per R0KH. - -# List of R1KHs in the same Mobility Domain -# format: <128-bit key as hex string> -# This list is used to map R1KH-ID to a destination MAC address when sending -# PMK-R1 key from the R0KH. This is also the list of authorized R1KHs in the MD -# that can request PMK-R1 keys. -#r1kh=02:01:02:03:04:05 02:11:22:33:44:55 000102030405060708090a0b0c0d0e0f -#r1kh=02:01:02:03:04:06 02:11:22:33:44:66 00112233445566778899aabbccddeeff -# And so on.. One line per R1KH. - -# Whether PMK-R1 push is enabled at R0KH -# 0 = do not push PMK-R1 to all configured R1KHs (default) -# 1 = push PMK-R1 to all configured R1KHs whenever a new PMK-R0 is derived -#pmk_r1_push=1 - -##### Passive scanning ######################################################## -# Scan different channels every N seconds. 0 = disable passive scanning. -#passive_scan_interval=60 - -# Listen N usecs on each channel when doing passive scanning. -# This value plus the time needed for changing channels should be less than -# 32 milliseconds (i.e. 32000 usec) to avoid interruptions to normal -# operations. Time needed for channel changing varies based on the used wlan -# hardware. -# default: disabled (0) -#passive_scan_listen=10000 - -# Passive scanning mode: -# 0 = scan all supported modes (802.11a/b/g/Turbo) (default) -# 1 = scan only the mode that is currently used for normal operations -#passive_scan_mode=1 - -# Maximum number of entries kept in AP table (either for passive scanning or -# for detecting Overlapping Legacy BSS Condition). The oldest entry will be -# removed when adding a new entry that would make the list grow over this -# limit. Note! Wi-Fi certification for IEEE 802.11g requires that OLBC is -# enabled, so this field should not be set to 0 when using IEEE 802.11g. -# default: 255 -#ap_table_max_size=255 - -# Number of seconds of no frames received after which entries may be deleted -# from the AP table. Since passive scanning is not usually performed frequently -# this should not be set to very small value. In addition, there is no -# guarantee that every scan cycle will receive beacon frames from the -# neighboring APs. -# default: 60 -#ap_table_expiration_time=3600 - - -##### Wi-Fi Protected Setup (WPS) ############################################# - -# WPS state -# 0 = WPS disabled (default) -# 1 = WPS enabled, not configured -# 2 = WPS enabled, configured -#wps_state=2 - -# AP can be configured into a locked state where new WPS Registrar are not -# accepted, but previously authorized Registrars (including the internal one) -# can continue to add new Enrollees. -ap_setup_locked=1 - -# Universally Unique IDentifier (UUID; see RFC 4122) of the device -# This value is used as the UUID for the internal WPS Registrar. If the AP -# is also using UPnP, this value should be set to the device's UPnP UUID. -# If not configured, UUID will be generated based on the local MAC address. -#uuid=12345678-9abc-def0-1234-56789abcdef0 - -# Note: If wpa_psk_file is set, WPS is used to generate random, per-device PSKs -# that will be appended to the wpa_psk_file. If wpa_psk_file is not set, the -# default PSK (wpa_psk/wpa_passphrase) will be delivered to Enrollees. Use of -# per-device PSKs is recommended as the more secure option (i.e., make sure to -# set wpa_psk_file when using WPS with WPA-PSK). - -# When an Enrollee requests access to the network with PIN method, the Enrollee -# PIN will need to be entered for the Registrar. PIN request notifications are -# sent to hostapd ctrl_iface monitor. In addition, they can be written to a -# text file that could be used, e.g., to populate the AP administration UI with -# pending PIN requests. If the following variable is set, the PIN requests will -# be written to the configured file. -#wps_pin_requests=/var/run/hostapd_wps_pin_requests - -# Device Name -# User-friendly description of device; up to 32 octets encoded in UTF-8 -#device_name=Wireless AP - -# Manufacturer -# The manufacturer of the device (up to 64 ASCII characters) -#manufacturer=Qualcomm - -# Model Name -# Model of the device (up to 32 ASCII characters) -#model_name=QualcommSoftAP - -# Model Number -# Additional device description (up to 32 ASCII characters) -#model_number=123 - -# Serial Number -# Serial number of the device (up to 32 characters) -#serial_number=12345 - -# Primary Device Type -# Used format: -- -# categ = Category as an integer value -# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for -# default WPS OUI -# subcateg = OUI-specific Sub Category as an integer value -# Examples: -# 1-0050F204-1 (Computer / PC) -# 1-0050F204-2 (Computer / Server) -# 5-0050F204-1 (Storage / NAS) -# 6-0050F204-1 (Network Infrastructure / AP) -#device_type=6-0050F204-1 - -# OS Version -# 4-octet operating system version number (hex string) -#os_version=01020300 - -# Config Methods -# List of the supported configuration methods -config_methods=label display push_button keypad - -# Access point PIN for initial configuration and adding Registrars -# If not set, hostapd will not allow external WPS Registrars to control the -# access point. -#ap_pin=12345670 - -# Skip building of automatic WPS credential -# This can be used to allow the automatically generated Credential attribute to -# be replaced with pre-configured Credential(s). -#skip_cred_build=1 - -# Additional Credential attribute(s) -# This option can be used to add pre-configured Credential attributes into M8 -# message when acting as a Registrar. If skip_cred_build=1, this data will also -# be able to override the Credential attribute that would have otherwise been -# automatically generated based on network configuration. This configuration -# option points to an external file that much contain the WPS Credential -# attribute(s) as binary data. -#extra_cred=hostapd.cred - -# Credential processing -# 0 = process received credentials internally (default) -# 1 = do not process received credentials; just pass them over ctrl_iface to -# external program(s) -# 2 = process received credentials internally and pass them over ctrl_iface -# to external program(s) -# Note: With wps_cred_processing=1, skip_cred_build should be set to 1 and -# extra_cred be used to provide the Credential data for Enrollees. -# -# wps_cred_processing=1 will disabled automatic updates of hostapd.conf file -# both for Credential processing and for marking AP Setup Locked based on -# validation failures of AP PIN. An external program is responsible on updating -# the configuration appropriately in this case. -#wps_cred_processing=0 - -# AP Settings Attributes for M7 -# By default, hostapd generates the AP Settings Attributes for M7 based on the -# current configuration. It is possible to override this by providing a file -# with pre-configured attributes. This is similar to extra_cred file format, -# but the AP Settings attributes are not encapsulated in a Credential -# attribute. -#ap_settings=hostapd.ap_settings - -# WPS UPnP interface -# If set, support for external Registrars is enabled. -#upnp_iface=br0 - -# Friendly Name (required for UPnP) -# Short description for end use. Should be less than 64 characters. -#friendly_name=Qualcomm Access Point - -# Manufacturer URL (optional for UPnP) -#manufacturer_url=http://www.qualcomm.com/ - -# Model Description (recommended for UPnP) -# Long description for end user. Should be less than 128 characters. -#model_description=Wireless Access Point - -# Model URL (optional for UPnP) -#model_url=http://www.qualcomm.com/ - -# Universal Product Code (optional for UPnP) -# 12-digit, all-numeric code that identifies the consumer package. -#upc=123456789012 - -##### Multiple BSSID support ################################################## -# -# Above configuration is using the default interface (wlan#, or multi-SSID VLAN -# interfaces). Other BSSIDs can be added by using separator 'bss' with -# default interface name to be allocated for the data packets of the new BSS. -# -# hostapd will generate BSSID mask based on the BSSIDs that are -# configured. hostapd will verify that dev_addr & MASK == dev_addr. If this is -# not the case, the MAC address of the radio must be changed before starting -# hostapd (ifconfig wlan0 hw ether ). -# -# BSSIDs are assigned in order to each BSS, unless an explicit BSSID is -# specified using the 'bssid' parameter. -# If an explicit BSSID is specified, it must be chosen such that it: -# - results in a valid MASK that covers it and the dev_addr -# - is not the same as the MAC address of the radio -# - is not the same as any other explicitly specified BSSID -# -# Please note that hostapd uses some of the values configured for the first BSS -# as the defaults for the following BSSes. However, it is recommended that all -# BSSes include explicit configuration of all relevant configuration items. -# -#bss=wlan0_0 -#ssid=test2 -# most of the above items can be used here (apart from radio interface specific -# items, like channel) - -#bss=wlan0_1 -#bssid=00:13:10:95:fe:0b -# ... diff --git a/wifi/p2p_supplicant_overlay.conf b/wifi/p2p_supplicant_overlay.conf deleted file mode 100644 index b5e89e0..0000000 --- a/wifi/p2p_supplicant_overlay.conf +++ /dev/null @@ -1,2 +0,0 @@ -disable_scan_offload=1 -p2p_no_group_iface=1 diff --git a/wifi/wpa_supplicant_overlay.conf b/wifi/wpa_supplicant_overlay.conf deleted file mode 100644 index 58c2639..0000000 --- a/wifi/wpa_supplicant_overlay.conf +++ /dev/null @@ -1,2 +0,0 @@ -disable_scan_offload=1 -p2p_disabled=1